Category:Lambdatalk: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 25:
-> 2+3 is equal to 5
 
==B) more about {lambda talk}'s foundations==
 
{lambda talk} is freely inspired by the λ-calculus. At the lowest level a {lambda talk} expression is exclusively made of words, abstractions and applications:
 
=== structure & evaluation
 
expression is [word|abstraction|application]*
Line 50 ⟶ 52:
 
What can be done with so little?
 
===Examples===
 
Hello World
Line 91 ⟶ 95:
{CAR {CONS Hello World}} -> World
 
===about the implementation===
===Implementation===
 
{lambda talk} is not implemented following the standard process, code -> tokens -> tree -> eval. '''The code is a string from beginning to end'''. At each keyboard input, the code is processed by a single function, do_eval(), which returns words sent to the browser for the final evaluation and display:
Line 114 ⟶ 118:
- lambdas accept de facto '''partial function application''': called with a number of values lesser than its arity, a lambda memorizes the given values and returns a new lambda waiting for the rest.
 
===and?===
Upon these foundations, after '''Alonzo Church''', we could define the set of natural numbers [ZERO, ONE, TWO, ...] and their associate operators, [SUCC, ADD, MUL, POWER, PRED, ...] allowing to build iterations and recursions. For instance, computing factorials:
 
Upon these foundations, after '''Alonzo Church''', we could define the set of natural numbers [ZERO, ONE, TWO, ...] and their associate operators, [SUCC, ADD, MUL, POWER, PRED, ...] allowing to build '''iterations''' and ''recursions'''. For instance, computing factorials:
 
{CHURCH