|
|
|
|
|
by klibertp
3499 days ago
|
|
Did you guys notice that both of your examples use sigils? Try Avail[1]: allChecked = select element from todos list where [element is completed]
allNotChecked = select element from todos list where [element is not completed]
todoCount = count of element in todos list where [element is completed]
I'm cheating a tiny little bit: `todos list` would probably need to be defined above as a method (I don't remember if one can have variable names with a space inside the name in Avail) and `_is completed`/`_is not completed` would also need to be defined.Rebol or Red could be also interesting in this regard, also Forth and Factor. Still, Avail goes the farthest in terms of allowing you to write a truly human-readable code (EDIT: however, they support all of Unicode for names and such, so you can go nuts with sigils too, if you want). (Possibly also Inform 7[2], but I don't know it, so can't really say much.) [1] http://www.availlang.org/
[2] http://inform7.com/ |
|
As the person that initially mentioned sigils, I did not say that they are always evil. I just said that you cannot use them and at the same time claim that you have a human-centered fully intuitive programming language.
I'm very fine with using -> symbols for anonymous functions... In fact, I'm fine with other sigils as well, if they are explained properly.
> allChecked = select element from todos list where [element is completed]
To me, knowing nothing about this language, this reads like collecting the subset of the completed elements out of all the elements. But the original task was to compute whether all elements are completed, i.e., whether this subset is equal to the whole. So you're doing something else, or your language is misleading me.