|
From: john s. <sk...@us...> - 2015-03-29 18:43:06
|
Apart from in structs, unions, and function/procedure definitions,
here is a possibly incomplete catalogue:
{ expr } --> function returning expr
{ stmt; stmt; expr } -> function returning expr
{ stmt; stmt; return expr; } -> function returning expr
{ stmt; stmt; } --> procedure
{ pattern : type | expr } --> set form
( expr ) --> expr
( expr, expr ) --> tuple
(x=expr, y=expr) -> record
struct {x = expr; y=expr; } -> record (deprecated)
( stmt; stmt; expr ) --> expr // means #{ stmt; stmt; expr }
() --> unit tuple
( var expr ) --> expr (eagerly evaluated, same as (let x = expr in x))
I am looking at some more short forms, such as
if(x)stmt;
while(x)stmt;
like C. It's not clear these will work, since they're ambiguous.
An alternative (from COBOL):
if x perform stmt;
while x perform stmt;
Note these are already allowed:
if x call expr;
if x goto label;
if x return;
cond ?? stmt;
I also kind of like:
0..99
meaning a subrange of int, inclusive, and ascending order. Hece
for i in 0..99 do ...
but then, that's from Pascal, my training language (actually I learned
Fortran first, and then Compass Assembler ..)
Yep, I used Pascal for years, then C++, when it got multiple inheritance.
And I learned C after that :) [I don't count learning BCPL .. :]
--
john skaller
sk...@us...
http://felix-lang.org
|