Quote:
Original post by Matei
Well, I'd say that print "Hello World" is understandable to anyone who knows English, whereas System.out.println is pretty cryptic.
However, I'm really wondering why you're making no distinction between functions and objects. I think this makes the language more confusing, and is also wrong at a conceptual level. A function is a representation of an algorithm. An object is data, with perhaps some functions that operate on that data. It doesn't make sense for a function to have "fields" or "properties" like an object does. Nor does it make sense for an object to be "executed", or to take "arguments" (well, unless it's an object representing a function).
You can make a block a complete function, but not allowing access to any inner variables, and you can make a block a class, by controlling what is exposed and what's not. You can make it polymorphic (this it the more advanced stuff, that beginners wouldn't even care about) where you could inherit only certain variables
ie:
exposed inheritable int State;
If an block has a return type and or a parameter list, it is treated pretty much how a functor is treated in C++. If a block has none of those (a void return type is not the same as omitting one completely) then it is basically a class-type structure (that screams redundancy)
A block that is treated like a function, even though it IS a function, can share its exposed variables.
this allows for some interesting things to happen
blocks can return other blocks, including functions. And blocks can be built anonymously at runtime, using the Janko RTTI interface. lambda is naturally used to describe anonymous blocks. Lambda (like scheme) is what builds a block.
block block_that_returns_a_custom_block returns lambda{ ... return lambda { ... stuff that is returned. }}//or return another named block blockblock other_block (int arg) returns block_that_returns_a_custom_block{ ...}
of couse this can all be horribly abused, but i'm working on that
this really makes the code easy to parse for me (my parser is VERY simple)
I have a lot of work to do yet on the language, but I am happy with how it is turning out.