jmoenig / Snap

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

COMBINE doesn't know APPEND's base case (and others) #3324

Open brianharvey opened 3 months ago

brianharvey commented 3 months ago

When we turned a bunch of former library blocks into primitives, some variadic ones should have been added to COMBINE's list of base cases: help-test script pic help-test script pic (1) Don't forget that in COMBINATIONS the base case result isn't empty: help-test script pic (2)

COMBINE also lost the base cases of some formerly dyadic blocks that have become variadic: help-test script pic (3) help-test script pic (4) help-test script pic (5) help-test script pic (6) These latter ones are sort of important even though I gave this a "low priority" label, because I think we use them in BJC.

These are all the ones I found but I didn't carefully check every block.

jmoenig commented 3 months ago

thanks! (although I'm 100% sure that we've never in the past special-cased those base-cases in any version of combine, so I'm having a hard time believing that BJC teaches about them). Will try to fix it!

ego-lay-atman-bay commented 3 months ago

That's how they behave in snap 9.2.10 untitled script pic (9)

brianharvey commented 3 months ago

Umm okay I guess what I meant is that BJC uses COMBINE USING AND/OR, not that it does so with empty lists; of course if you know the list is empty you don't need COMBINE at all. It's just that you run the risk that a list might turn out to be empty in an unusual situation that still isn't a (user) bug, e.g., COMBINE (KEEP ...) USING AND.

Anyway, I'm not claiming it's a new bug in dev!

ego-lay-atman-bay commented 3 months ago

Oh, I must've read this

When we turned a bunch of former library blocks into primitives

And thought it said

When we turned primitives to blocks

So I thought you were suggesting it was a bug introduced in the dev version.