So a while ago, in Add step value to number 1 to 10 block
So, now snap does have the variadic input, and even has it for custom blocks. So can we have the variadic step option as promised?
So a while ago, in Add step value to number 1 to 10 block
So, now snap does have the variadic input, and even has it for custom blocks. So can we have the variadic step option as promised?
That would also be a way to solve my UPTO issue. Thanks for bumping this. Maybe Jens will allow it?
Oh, once you have STEP (with default 1) you don't need UPTO because STEP 1 implies that. In order for the starting number to be bigger than the ending one, the implied step has to be -1.
I can't believe I didn't think of that. but what happens when someone does, for example, NUMBERS FROM 1 to 10 STEP -1?
What do think it should output?
Empty list.
I wasn't asking you
Oh, sorry.
What do think it should output?
Empty list.
Maybe Jens will allow it?
do you think he will? (just asking)
Sooner or later, is my guess. I've been trying for quite a while now, though, so it clearly isn't a priority for him. :~/
oh
it's not just not a priority for me, I'm convinced (and was taught) that designing around applying principles consistently and avoiding special cases ("numbers only go up") reduces cognitive load and fosters a broader range of applications. Mathematicians have no issue with the bidirectionality of the number line, in fact, it's even sort of a big idea. Of course, with power comes responsibility, with abstraction comes ambiguity, and increased expressivity naturally increases the chance for bugs. So, you want your blocks to be bureaucratic forms with more fields to fill out, depending on the inputs in previous fields? Make you own!
Fine, so never mind UPTO. Can we have STEP? If it's okay to add complexity to blocks such as BROADCAST by means of 0/0/1 variadic inputs, how about FOR? That would get me to shut up about UPTO while also helping the people who want to step by 2 or whatever (or step crayon numbers by 5, for example).
Oh, once you have STEP (with default 1) you don't need UPTO because STEP 1 implies that. In order for the starting number to be bigger than the ending one, the implied step has to be -1.
actually, I just realized, I would probably expect 10 to 1 step 1 to still report list from 10 to 1 since the step distance is still 1, since thats how it works in snap currently - higher first number = negative step
I think you are now overthinking things
+ve step value would be coded to only try to step upwards
-ve step value would be coded to only try to step downwards
default would be current behaviour
Ok
it's not just not a priority for me
Anyone interested may want to use this block (which I happen to need for a project):
Demo
More or less regular cases:
Incorrect input:
numbers from _ to _
block)
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.