10.07.2015 Views

An Introduction to Functional Programming Through Lambda Calculus

An Introduction to Functional Programming Through Lambda Calculus

An Introduction to Functional Programming Through Lambda Calculus

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

- 190 -(+ 12 25 5) ->42(- 59 8 9) ->42(* 3 2 7) ->42(/ 336 4 2) ->42/ is actually a real division opera<strong>to</strong>r. The primitivetruncaterounds a single argument down <strong>to</strong> the nearest integer. If truncate is given two arguments then it divides one by theother and rounds the result down <strong>to</strong> the nearest integer, for example:(truncate 43 6) ->7The primitive:remreturns the integer remainder after division, for example:(rem 43 6) ->1The numeric less than, less than or equal, equality, greater than and greater than or equal primitive comparisonfunctions are:< = >These may all be used with more than two arguments. Thus = checks that all its arguments are equal, for example:(= 2 2 2 2 2) ->tnil>= checks that its arguments are in descending order, for example:(>= 5 4 3 3 2 1) ->tand > checks that its arguments are in strictly descending order, for example:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!