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.)
> Did you guys notice that both of your examples use sigils?
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.
Of course not; but they are not human-readable. I thought that the posters above me used Ruby and C# examples to say that they (Ruby and C#) may be human-readable. I'm not sure if that was the intention, so I just noted that -> and &: are also sigils.
> So you're doing something else, or your language is misleading me.
It's the former! However, it's what the two posters before me did in Ruby and C#. The fact that all three of us misinterpreted the Eve code is interesting in the context of this discussion...
Correct Avail code would look like this:
areAllEntriesChecked ::= (count of element in todos where [element is checked])→boolean
Anyway, that's not "my language" at all, I just happen to know quite a bit of strange languages and wanted to share info on one with an interesting take on readability. They call it "articulate programming", which seems to be an evolution of Knuth's literate programming.
Try Avail[1]:
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/