Macro Headaches

Dave has requested that I created a new S-code for macro indexes, but upon examining the problem I came up with a host of new problems. First, why is it that, when you insert a function or procedure that uses macros, you must then follow up with additional button-pushes on the macro button to actually create those macros? You have no choice here anyway &emdash; why doesn't the initial insertion also insert the macro definitions as well as the macro calls? And if it does so, who needs the macro button?

 

OK, I can do that, but there's more. The macro definitions need different prompts, prompts that reflect their use in the function or procedure. That will take additional coding.

 

Also, the macro call should show the same type coloring that the macro definition uses. That's more work.

 

Furthermore, you can use substitution on a macro call; that's really dumb. And what happens if the storybuilder uses substitution inside a macro definition? Can the interpreter handle that situation?

 

Next, how does the storybuilder insert the macro index at the appropriate places? Remember, the macro index will have to follow the rules of data typing, so we need a way to cheat the data typing logic when we're playing with the macro definition. It would seem that the only solution here is to have a menu of data-typed macro indeces, and let that menu go through the same data typing logic that all the other menus go through. This would certainly work, but I am loathe to waste precious menu space on such a kluge. Nonetheless, it might be possible to rearrange the menu layout to free up some more space for menus, especially if we dispense with the macro button.

 

So it appears for now that the solution is a set of seven macro indeces, one for each data type. But here's a new problem: what happens if the user attempts to insert a macro index in the wrong location? Suppose, for example, that the user has a function with two arguements of different datatypes, like so: MyFunction(SomeVerb, SomeCharacter). What happens if this function is inside a macro definition for PickBestCharacter, and the user attempts to insert a macro index of type Verb in place of SomeVerb? Somehow we need to enable only the datatype that is appropriate to that macro call. Gad, what a headache!