NetsBlox / Snap--Build-Your-Own-Blocks

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

Autofill issues in closure-like areas #1532

Closed dragazo closed 1 month ago

dragazo commented 2 months ago

This simple program misbehaves:

image

The issue seems to be the inner empty list constructor actually is not returning an empty list. Presumably this is because its single variadic slot counts as empty and is getting something auto-inserted into it (the previous list apparently) a la closure calls. This is coupled with the fact that the varaidic form of the list constructor block does not create a shallow copy (as it is supposed to), but rather returns the list directly. Thus, we see all rows of the result are referentially equal rather than compounding.

So basically there are two bugs:

  1. Empty variadic slots should not participate in closure auto-fill args.
  2. The variadic form of the list constructor should return a shallow copy of its input.