Ask block with number list input

If I enter the number list [0,1,2] as input in an ask block, a menu query is generated from these three numbers as desired.

However, if I create the same list with the block "numbers from 0 to 2" instead of entering it manually as [0,1,2], the menu query only shows the numbers 1 and 2.

The upload form didn't allow me to post a screenshot, so here's the plain text:

Version 1:
ask (list 0,1,2)
yields a menu with options 0,1,2

Version 2:
ask (numbers from 0 to 2)
yields a menu with options only 1,2

Tested in Safari and Chrome.

Confirmed.
untitled script pic (7)  


untitled script pic (8)  

So it's not just dropping the first item; it especially dislikes zero.

It seems that it dislikes 0 when it is a number rather than a string:


In fact, it seems that 0, when a number, is being treated like it doesn't exist by the ask block. When fed the number 0 (not a list), it acts like an empty string and clears the answer variable without creating a speech balloon. I'll upload an image when the forum is working properly again.
untitled script pic (20)

possibly due to snap not having a NULL value?

Maybe it has something to do with empty slots = 0?

thanks for the report! I've just fixed this in dev.

With 0 in a list, it works. However, there still is a problem with asking 0 directly (e.g. ask ((0) * (0)) and wait).

that's intentional: ASK(zero/empty/false) un-asks and unblocks another thread that's asking something.

Then my bug report is this:


As I recall, users of Snap! aren't supposed to have to think about the distinction between numbers and strings.

Moreover, this is inconsistent with the say block, where only an empty string will behave in this way:



image

As I've mentioned above, for ASK this behavior is intentional, so another thread can un-block an ASKing one. I know some folks in this forum like to speculate and harbor strong opinions about the deeper meanings behind zero / empty / false values and their numerical / textual / semantic consistency in whatever context they might surface. I don't encourage such obsession (and I won't participate in any design discussion around this).

Yes, I did see that, I was just noting the inconsistency between ask and say as well as the fact that "0" as a string was different from 0 as a number. But ask is different from say, so I'll stop bothering you!

Alright. Now that I've confirmed that you are aware of the behaviour, I'll believe you know what you're doing and leave it at that :~).

PS: I've been looking at the dev version, and I have been having fun with the new "sigmoid of ()" feature. I'm looking forward to the release!

thanks! I'm not yet entirely sure about including the logistic function, but it sure does come in handy when fooling around with neural networks, which is what i'm currently exploring in Snap!