Bug in 'for each' or 'all but first of'

Please fill out these questions for all feature requests and bug reports. If you're requesting a feature, please let us know why this feature is important or useful, not just what it should do.

  1. What browsers show this problem? Firefox - Snap! V6

  2. Please share an example project (if possible).

  3. Describes the steps to reproduce this issue.
    load the APL library for transpose. create the script above, and the variables A, V1

  4. What does Snap! currently do?
    item is zero for both items in the list, i.e. say shows V1 = (0,1), but item is 0, 0

  5. What should Snap! do instead?
    item should reflect what is in the list.
    If you use either of the other 'set V1...' lines you get correct behavior.

    Also, if you replace 'for each' with 'for i = 1 to length V1' and manually set item to 'item i of V1', then it works

Is this bug a security concern? If so, please do not post security concerns directly to the forum. Please email us at contact@snap.berkeley.edu. Thank you!

@jens: Confirmed. You don't have to do all that complicated stuff in the FOR EACH; just SAY [ ] for 1 SECS.

Whew! It's not APL's fault. The problem is that FOR EACH doesn't like hybrid lists (ones that start linked but end with an array):

Edit: Fixed. One-line change. I made a PR. @jens
P.S. Not a 6.0 bug, been there since primitive foreach.

thanks, Brian, for the quick analysis and fix!

Glad it was a quick fix. I suspected something along those lines. This leads me back the 'shimmering' discussion and the operations that flip the list representations. Will the new matrix/vector operations behave consistently in terms of that? The lowest level LApack routines are mostly vector operations, but as I get higher up the chain, transpose and inner product, in particular, become more important. Many routines also make use of slices/sub-matrices that require heavy use of item of and replace item of.

The ITEM block allows you to select slices (or even noncontiguous subsets).

The hyperized scalar functions preserve the shape(s) of the input(s). We have transpose and inner product in the APL library.