Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Syntax for typed lamdas

Name: Anonymous 2012-06-09 21:56

Help me /prog/, i'm making a language and i can't decide on what syntax to use for typed lambdas

Name: Anonymous 2012-06-13 1:27

(INT x)INT: x * x;
(INT x, y)INT: x + y;
INT: (INT i; read(i); i);
PROC f := (REF INT x)PROC REF INT: INT: x *:= 2;
INT i := 10;
PROC INT g = f(i);
MODE P = PROC(P)P;
# Y combinator: #
PROC y = (P f)P: ((P x)P: f((P v)P: x(x)(v))) ((P x)P: f((P v)P: x(x)(v)))

Algol 68's function syntax is the best because it's clean and uncluttered, with no unnecessary keywords like "return" and "function". The value returned by the function is simply the value of the last expression. All statements are also expressions, so you don't need to distinguish between parentheses and curly braces and you could insert the text of a procedure anywhere you can use a call to that procedure.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List