(This is just a WISH reminder for vic, but if you want to impl this, feel free to do so, also comment).
Fancy is an smalltalk' like language, in the sense of how messages are sent and message selectors having ":". One thing I don't like very much in many languages, is seeing lots of curly braces as code is
being nested (ie. in ruby we face the same problem, and it's not un-common to see several
trailing end end end end)
I've noticed the following...
try {
something
} catch StdError => e {
e println
} finally {
resources free
}
with an indentation sensitive parser, could be written like this, notice the smalltalk-ish/pythonic flavor.
try:
something
catch: StdError => e
e println
finally:
resources free
Another example:
def class Something {
def hello {
"Hello World" println
}
def hello: name {
"Hello " ++ name . println
}
}
Could be
def class: Something # or even simply.. class: Something
def: hello
"Hello World" println
def: hello: name
"Hello " ++ name . println
We don't need to eliminate usage of { }, as they are useful for block literals
{ condition } if_true:
"The condition was true" println
else:
"Nope" println
A block literal without curly brackets might seem like:
[1, 2, 3] each |a|
a println
some large body(working with: a)
Need to study this further, and see if it would be plausible for fancy, and desirable by its users.
(This is just a WISH reminder for vic, but if you want to impl this, feel free to do so, also comment).
Fancy is an smalltalk' like language, in the sense of how messages are sent and message selectors having ":". One thing I don't like very much in many languages, is seeing lots of curly braces as code is being nested (ie. in ruby we face the same problem, and it's not un-common to see several trailing end end end end)
I've noticed the following... try { something } catch StdError => e { e println } finally { resources free }
with an indentation sensitive parser, could be written like this, notice the smalltalk-ish/pythonic flavor.
Another example:
Could be
We don't need to eliminate usage of { }, as they are useful for block literals
A block literal without curly brackets might seem like:
Need to study this further, and see if it would be plausible for fancy, and desirable by its users.