ProjetPP / Documentation

Documentation and protocol specification of the Projet Pensées Profondes
Creative Commons Zero v1.0 Universal
7 stars 1 forks source link

Adds nth operator (closes #51) #59

Closed Tpt closed 9 years ago

Ezibenroc commented 9 years ago

(the first element of the list is at position 1). If i < 0 then it returns the _i_th element from the end (nth(-1, l) returns the last element of the list).

Would be better to begin indexing at 0 (this is almost a standard in CS). Especially if -1 is the last element. Would be great to allow other negatives than -1.

Tpt commented 9 years ago

Would be better to begin indexing at 0

Yes, make sense

Would be great to allow other negatives than -1.

It's what is done: "If i < 0 then it returns the _i_th element from the end"

Ezibenroc commented 9 years ago

It's what is done: "If i < 0 then it returns the ith element from the end"

Sorry, read too fast.

Ok for me.

rcharron commented 9 years ago

Would be better to begin indexing at 0 (this is almost a standard in CS) => So be carefull when parsing, because in natural language, indexing start at 1

Tpt commented 9 years ago

Let's go with it!