Open h2non opened 10 years ago
I'm not sure... The concept of void does not make sense to me without the presence of functions. Can you think of any examples?
Could be something like this:
block: void
JSON equivalent to null primitive type:
"block": null
By the way... another alternative could be nil
like null
, but more ruby-like :)
Anywway I'm not too much convinced about the idea to introduce reserved alphanumeric keywords (except the end
block terminator keyword)
Maybe introduce a symbol-based token representing unassigned or undefined would be a better choice and more unobstructive solution, following the language design principles...
Some possible not bright ideas:
block: !!
block: (nil)
That sounds better. What about this:
block:!
or
block::
First one rules!! :+1:
I will add a new operator called AssignNot
right now :-)
Additionally, after some reflexions, I think it could be practical to have a reserved keyword called nil
that represented null
or undefined.
I think this will be useful for serialization processes. The main inconvenience will be that this implies to reserve another keyword in the language, so at this time, there are only 2 alphabetic keyword reserved: end
and nil
So.. Oli language should support the following expressions:
# assign not operator
hello!:
# nil keyword assignment
hello: nil
Finally approved the following expressions to be a part of the specification
# assign not operator
hello!:
# nil keyword assignment
hello: nil
Proposal Just to define empty assignment blocks that points to nothing.... but it can generate a bit of FUD and confusion...