Kat - the language of calculations Mikus Vanags Parameter - - PowerPoint PPT Presentation

kat the language of calculations
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

Kat - the language of calculations

Mikus Vanags

slide-2
SLIDE 2

Parameter declaration implicitly

function() {return x;} function(x) {return x;}

Parameter declaration explicitly

2

x

Solution without redundant syntactic code parts

slide-3
SLIDE 3

function(x, y) {return y - x;}

Order in which parameters are used in function body are different

function() {return y~ - x;} function() {return y - ~x;}

Postfix form of Grace~ operator Prefix form of Grace~ operator

Parameter declaration implicitly Parameter declaration explicitly

Parameter order in parameters list

3

slide-4
SLIDE 4

Simplest use case of implicit parameters: super calculator

Lens focus = ∗ + KatLang code: F=d*f/(f+d);

d*f/(f+d)

… … …

4

slide-5
SLIDE 5

f, d d*~f/(f+d)

F

… … 1 2 3 4 5 6 7 8 9

F = function(f, d) { return d*f/(f+d); };

Function name Function parameters list Function body

Pseudo code: KatLang code:

5

www.ilcalculus.org

slide-6
SLIDE 6

Kat calculator demonstration

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

  • ld electronic

calculator!

slide-7
SLIDE 7

C# 3.0:

people.Sort((x, y) => x.LastName.CompareTo(y.LastName)); people.Sort(func x.LastName.CompareTo(y.LastName));

Parameter declaration explicitly

Potential of implicit parameters (pseudo code C):

Lambda symbol

7

Beginning of lambda expression Implicit parameter in canonical form

slide-8
SLIDE 8

Java 8.0

people.sort(comparing(Person::getLastName)); people.sort(comparing(func Person.getLastName));

Method reference Implicit parameter in anonymous form Beginning of lambda expression Method usage

Potential of implicit parameters (pseudo code J):

8

slide-9
SLIDE 9

Swift

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

Potential of implicit parameters (pseudo code S):

9

slide-10
SLIDE 10

If You are interested in good abstractions in symbolic computation and programming languages, email to: m m m mikus ikus ikus ikus. . . .v v v vanags@logicsresearchcentre.com anags@logicsresearchcentre.com anags@logicsresearchcentre.com anags@logicsresearchcentre.com