I hate those numbers. Talk about being user-unfriendly!
Jens chose to use numbers to avoid problems with translation to non-English. But I think we really need a serious user interface; Jens doesn't think so only because he thinks people shouldn't do metaprogramming in the first place. He's starting to get over that (Why does "this continuation" keep the caller as part of the script? - #17 by jens) so I'm hopeful that eventually he'll see what a kludge those numbers are compared to the wonderful UI of everything else in Snap!. I have a couple of ideas about how this should work.
-
Have a prototype text format (e.g., for use in the make-a-block initial dialog) that lets you say things like
move %distance# steps
map %function\r over %data:
if %test? then %action\c
(in which the \ is an ascii-keyboard representation of λ). Then also allow using that format in DEFINE in place of the label, and to specify what's inside when you make a Group input. -
For Group inputs, allow interactive definition by opening a little mini block editor that just has a jagged block picture (like the input pictures in the long form input dialog) that initially just has a plus sign but into which you can put inputs and title text just as in the main block prototype.
-
The DEFINE primitive doesn't want an interactive GUI; the whole point is that your program defines the new block all by itself. But still I think we can do better than having to SET a zillion properties of the new block individually (especially with that kludgy upvar that works only in the same script as the DEFINE). The text format in point 1 above would help with that, but if we could have the option downarrow feature I asked for above, then I think those things could be added to the DEFINE block itself, which would end with a downarrow-accessed menu for all those trillions of things
that you have to specify for a new custom block.
PS I also think we could improve variadic inputs by removing initial, min, max slots from that menu and putting them next to the radio button for variadic inputs, like the "default" box for regular (monadic?) inputs.