Kat - the language of calculations
Mikus Vanags
Kat - the language of calculations Mikus Vanags Parameter - - PowerPoint PPT Presentation
Kat - the language of calculations Mikus Vanags Parameter declaration explicitly function(x) {return x;} Parameter declaration implicitly function() {return x;} Solution without redundant x syntactic code parts 2 Parameter order in Order
Mikus Vanags
Parameter declaration implicitly
Parameter declaration explicitly
2
Solution without redundant syntactic code parts
Order in which parameters are used in function body are different
Postfix form of Grace~ operator Prefix form of Grace~ operator
Parameter declaration implicitly Parameter declaration explicitly
Parameter order in parameters list
3
… … …
4
F
… … 1 2 3 4 5 6 7 8 9
Function name Function parameters list Function body
Pseudo code: KatLang code:
5
www.ilcalculus.org
Windows Phone 8.1 standard calculator Il Calculus 1.3 Windows Phone 8.1
6
www.ilcalculus.org
Drag me like using modern smartphone! Touch me like
calculator!
people.Sort((x, y) => x.LastName.CompareTo(y.LastName)); people.Sort(func x.LastName.CompareTo(y.LastName));
Parameter declaration explicitly
Lambda symbol
7
Beginning of lambda expression Implicit parameter in canonical form
people.sort(comparing(Person::getLastName)); people.sort(comparing(func Person.getLastName));
Method reference Implicit parameter in anonymous form Beginning of lambda expression Method usage
8
var reversed = sorted(names, { $0 > $1 } ) var reversed = sorted(names, { current > next } ) let names = ["Chris", "Alex", "Ewa", "Barry", "Daniella"]
Shorthand argument name Implicit parameter in canonical form
9