Syntax Tips
Posted: Thu Feb 21, 2008 2:45 pm
Hi, I am looking at Cobra and I think its pretty nice, but there are a couple tweaks I would recommend:
for statements would be better if they used syntax like the following:
Another idea is nested for/where statements:
A where statement can be like variable declaration (or term binding).
. . .
Another good feature to add is parameteric constraints:
Basically, one should be able to exactly specify complex constraints on valid parameters.
. . .
Also, instead of using the term "def", it might be better to use the term "has" and other keywords in a streamlined way for objects:
. . .
Anyways, just some thoughts. Keep up the good work!
for statements would be better if they used syntax like the following:
- Code: Select all
for each integer A in L
print A
Another idea is nested for/where statements:
- Code: Select all
where L is a list
for each item A in L
display A
A where statement can be like variable declaration (or term binding).
. . .
Another good feature to add is parameteric constraints:
- Code: Select all
def check(checkbox C where (C.checked))
C.checked = false
number N is non-zero when (N != 0)
def div(number {A, B} where (B is non-zero)) = A / B
Basically, one should be able to exactly specify complex constraints on valid parameters.
. . .
Also, instead of using the term "def", it might be better to use the term "has" and other keywords in a streamlined way for objects:
- Code: Select all
class Foo
extendes
...
implements
...
requires
...
has
method bar(s as String?)
if s # same as "if s is not nil"
print Utils.countChars(s, c'x')
. . .
Anyways, just some thoughts. Keep up the good work!