quick question

Can someone point me in the proper direction for making this phrase compile:

Instead of putting flashlight into your wallet:
say “Thats seems like a silly idea, dont you think?”

that produces:

Problem. You wrote ‘Instead of putting flashlight into your wallet’ , which seems to introduce a rule taking effect only if the action is ‘putting flashlight into your wallet’. But that did not make sense as a description of an action. I am unable to place this rule into any rulebook.

What would be the proper wording?

That action is called “inserting _ into _” (or “inserting it into”.)

Look at the Actions tab of the Index, or type “actions” in your game for a debugging trace of actions being invoked.

I’ve often wondered, but I don’t think I’ve ever asked … this is such a common syntax error for newcomers to make, why the heck doesn’t the compiler just quietly translate “putting … in …” and “putting … into …” into “inserting … into …”? The utility of the synonym seems inarguable.

–JA

…or just call it putting into to begin with. I’ve made these goofs too, though I did know by then to check the Index in such cases. Still, the colloquial putting seems more natural. (Maybe putting isn’t colloquial in the UK?)

Na. It’s a mistake thats made in the UK as well.

The compiler doesn’t do that because the language doesn’t know any action names. They’re defined in the library.

The library doesn’t do that because the language has no facility for defining synonyms for actions. If you think that’s worthwhile, suggest it.

This has come up before (there’s some discussion of it on the suggestions forum and the old January document).

Brief-mode summary of the answer: it would probably be possible to get around the limitations zarf mentions, but it’s less clear that this is a good idea overall. If library-defined actions have predefined synonyms, we use up more and more of the namespace that might be wanted by authors; doing this in one or two places creates an expectation that it will be done in many cases; and we start to see novices asking questions like “how come I can’t use ‘considering’ as my own action? it keeps translating itself to ‘thinking’!” (etc.) Or: “I see some source with rules about ‘stealing something’. Is that the same thing as the taking action, or not?”

I7 is full of these trade-offs about exactly how robust and accepting it should be of variant input and code styles vs. how syntactically predictable it should be, so I’m not claiming this is a unique case. But in this particular instance, there really only seemed to be a single issue that came up frequently. We concluded that a “putting it in” --> “inserting it into” conversion led in a direction we weren’t sure we wanted to take the language and library.

Possibly it just needs a more blatant example or call-out in the documentation. It’s definitely a specific problem that continues to crop up – I myself had to deal with several tables full of pouting middle-schoolers when I tried to explain it.

Given that this does come up all the time, maybe it would make sense to tailor an error message to this situation? A very rough stab for illustration’s sake:

–Erik

For what it’s worth, the mistake I make all the time is typing “inserting it in” or “putting it onto”. (Both are wrong.)

I’ve got an idea. How about instead of making synonyms, make special compiler errors?

Problem: “putting it in” is not an action defined in the Standard Library. Did you mean “inserting it into?” … etc.

This is certainly a sensible way to look at it. Just as a suggestion, how about a Use Mode option? Something like “use action synonyms” at the head of the source code. But maybe it would be more trouble than it would be worth, since in that case people would (a) not know about it, which would lead to the same problem as at present, or (b) ask for the message to be more customizable, which would be a lot of extra work to no good purpose.

–JA

thank you btw.