Closed Ezibenroc closed 9 years ago
We have Nth(l,4) = First(Minus(Minus(Minus(l,First(l)),First(l)),First(l))).
No way! (for Minus)
+1 for Nth
Yes I find it very ugly, and this might trigger huge communications if one user ask for the billionth item.
But the operator Minus
is more general and could be usefull in other cases.
My 2 cents:
I'm not sure that these two languages have the best readability. It's not because some other people do something that this thing is good.
I think the two operators are useful, but not now. Wa can add the minus later if needed...
And I like the name nth, it is much more popular in english than the two examples can make think and, indeed, it is very clear.
This issue was still opened here: https://github.com/ProjetPP/Documentation/issues/35
Here's what it says (i closed the issue):
position(l, i) should returns the ith element of l.
First(l) would became an alias for position(l, 1) et last(l) one of position(l, -1).
I think we all agree on the use cases of the operator.
Two questions remain:
On 16/02/2015 15:05, Thomas Tanon wrote:
I think we all agree on the use cases of the operators.
Two questions remain:
- Position(l, i) or Nth(l, i)?
- Should we tag First and Last as deprecated in order to remove them in the future or should we keep them indefinitely as aliases of position(, 1) and position(, -1)? (in both cases, datamodel libs may do some normalization in order to allow modules to don't have to deal with the two writing of the same thing).
Reply to this email directly or view it on GitHub: https://github.com/ProjetPP/Documentation/issues/51#issuecomment-74512590
@ProgVal: +1
Cf. https://github.com/ProjetPP/PPP-QuestionParsing-Grammatical/issues/95#issuecomment-72521874
I don't see any way to describe a question such as "Who is the fourth president of the United States?" with the current datamodel.
We should add an operator for this.
Two alternatives:
Nth(l,n)
returns then
-th element of the listl
.Minus(l1,l2)
returns the list containing the elements ofl1
which are not inl2
.We have
Nth(l,4) = First(Minus(Minus(Minus(l,First(l)),First(l)),First(l)))
.