I actually thought that was the neatest thing about this proposed language. I didn't get too excited about any of the design goals, but regarding syntax, this seems pretty original.
It allows for less syntax, which is a win for readability and also less boilerplate tokens, but still gives you a little freedom to mess with your indentation, unlike python. It means that (true) lambdas wouldn't be a syntactical enigma like they would be in python.
I don't think that you would need to use "}" to end a block though, since it looks like its missing the opening bracket, but maybe double semicolons would work, since they apparently aren't used elsewhere:
MAIN()
IO.write("Hello, World!\n")
;;
To be honest, the syntax that I have found to be nicest on the eyes so far has been Io:
`True lambdas' are overrated. The Python way is just fine. If you want to do anything that needs two lines, you are probably doing something complicated enough that this function deserves its own name.
The former is an error ("UnboundLocalError: local variable 'foo' referenced before assignment"), the latter is a workaround by manually boxing the variable in a list. I'm not sure why that works, but it's rather ugly.
The same, in Lua:
function acc(x)
local foo = x
return function()
foo = foo + 1
return foo
end
end
Oh, yes. You are mutating variables. You shouldn't do that anyway in a functional setting.
Python's syntax forces the language to guess whether you want to make a new variable or use the variable of the same name from the outer scope. The heuristic they have, says that if you assign something to the variable, you get a new one by default. You can declare
global x
before to assign to the variable in the outerscope.
It allows for less syntax, which is a win for readability and also less boilerplate tokens, but still gives you a little freedom to mess with your indentation, unlike python. It means that (true) lambdas wouldn't be a syntactical enigma like they would be in python.
I don't think that you would need to use "}" to end a block though, since it looks like its missing the opening bracket, but maybe double semicolons would work, since they apparently aren't used elsewhere:
To be honest, the syntax that I have found to be nicest on the eyes so far has been Io: taken from http://www.iolanguage.com/scm/git/checkout/Io/docs/IoGuide.h...