# New custom block: default title text vs input name

It seems like in BJC a : is a fairly consistent convention for indicating input name to follow.

It would be cool if, when I clicked 'make a block' and typed the name for the block, it would recognize colons and automatically interpret the following strings as input names. For instance:

make a block 'pinwheel with branches: n forward: fwd back: bak'

would automatically set n, fwd, and bak to be input names, and the rest title text.

I think you got the general idea. You added more by including # to indicate type and = to indicate default, that's a cool idea and it works great for numbers, but would be more difficult to generalize to other types (lists, sprites, blocks, ...)

You also smushed things together like say:string to indicate that word should be separated into title text before and input name after. That would be another possible convention that an implementer could choose.

But all I meant was, all words are title text (as current), except if any word has a colon as the last character, then the next word is to be interpreted as an input name.

I just discovered Snap! has right-click 'Script Pic', so I can show what I mean.

Right now, if you make a block and type

say this: what for this long: nsecs seconds

you would get:

and then you would have to manually change what and nsecs to InputName. But what I am proposing is that you would instead automatically get this:

I'm confused what you're comparing there.

I'm saying the current way involves typing 'say this: what for this long: nsecs seconds' in the make a block dialog, PLUS also 6 clicks (3 clicks each) to convert 'what' and 'nsecs' from title text to input name.

My proposed way involves only typing, the extra 3 clicks per parameter become unnecessary.

This sounds like a good idea. My only concern is whether there's any predictable use case in which a colon doesn't mean that an input follows. For starters, I would exempt a colon as a word all by itself.

While you're waiting for us to get around to this, did you know that if a word in the title starts with a percent sign, it becomes an input name? So you'd say

say this: %what for this long: %nsecs seconds

(By the way, since computers operate on the nanosecond scale these days, I wouldn't pick "nsecs" as the name for that variable! Since in a block language you don't have to type procedure names every time you use them, you can call it "number of seconds," which also makes the program more self-documenting. The only downside is that you can't use the % shorthand for multi-word names, but you can say %number and then edit the name inside the Block Editor.)

Oh, I did not know about the %trick. I'd say that scratches the itch I had, and no need for an alternative/competing way to shortcut title text vs params, that would just invite confusion.