jmoenig / Snap

a visual programming language inspired by Scratch
http://snap.berkeley.edu
GNU Affero General Public License v3.0
1.51k stars 745 forks source link

Inconsistent behavior in list primitives while using negative index #669

Open studej opened 9 years ago

studej commented 9 years ago

Using negative index in some list primitives let you work with items from list tail. This can be really handy thing, but it is not consistent for all list primitives and it has also some other problems.

Please, visit THIS project for demonstration.

Question: Should Snap! let user work with list items from its tail by using negative index? A) If yes, then EVERY primitive should do the same thing B) if no, then we should take care about passed values into numeric inputs

studej commented 9 years ago

I am done with description of this issue. You can read it :)

bb010g commented 8 years ago

bump

jmoenig commented 8 years ago

negative list indices are not part of Snap's design, so don't rely on them. If - in some instances - they produce something else than an error that's only because I'm not (yet) asserting a valid range (same as using floating point indices, btw) in the list primitives, and that is purely for performance reasons.