-
Notifications
You must be signed in to change notification settings - Fork 33
Cull keyword explosion
jckarter edited this page Nov 17, 2010
·
3 revisions
Clay's syntax currently has 41 keywords! We should explore ways of simplifying the grammar without sacrificing readability or power of the language.
Some keyword groups have similar semantics and could be folded into a single keyword:
-
alias
andcallbyname
definitions both have call-by-name semantics -
ref
andlvalue
respectively create and consume lvalues -
default
andelse
Some fixed keyword syntax could be replaced with more general language features:
-
record
,variant
,enum
, andinstance
all deal with types, and could be folded into a singletype
facility -
inline
andexternal
could be indicated using generalized function attributes. perhapsstatic
andcallbyname
too -
and
/or
could use a generalized named infix operator feature -
not
could be a function
Other keywords could be replaced with symbols:
-
=
might work as anas
replacement in import statements:import bar = foo.bar; import foo.(bar = fooBar);
-
in
in for statements