To: dylan-partners@cambridge.apple.com Subject: macro open issues fcc: out-copy Reply-To: ram+@cs.cmu.edu -------- define method macros: It seems to us that users will often want macros that look like: define frobboz ?body end; Is there some syntactic reason why these aren't allowed? If this is just due to the definitional complexity of potentially destructuring the parameter list, it would be better to have parameter lists match as a unit than to forego the natural syntax for code containing defining forms. Reservedness of statement macro intermediate words: We do think it would be nice if intermediate words were only reserved within uses of that macro. We don't think it should be done if it forbids LR(1) parsing. So far as we can tell, it would work to change the lexical class of the defining words dynamically during the parse. This could be triggered (as already suggested by somebody) by seeing the statement keyword, or possibly by an early semantic action in parsing the statement. This might have bad interactions with macro hygiene (see below.) Obviously, we would need an implementation of this before we could choose local reserving. We don't think that it is all that bad to reserve intermediate words in all the modules where the macro is visible, but... Renaming intermediate words: If intermediate words are module-reserved, then it would be very nice if they could be renamed via the module system. This way, it would always be possible to work around conflicts that arise from using separately developed modules. Is there some reason why it doesn't make sense to make all intermediate words be handled (separately) by the module system in the same way as the initial word? Reserving define words: We don't think that reserving the names of define macros is a problem. It seems like it might be desirably consistent for the "keywords" of all (non-function) macros to be reserved. That is, if we decide to reserve statement intermediate words, then begin words and intermediate words are already consistent. Why not make define words reserved too? If define words are reserved, then the -definer suffix issue is moot. Pattern variable constraint/name: We favor changing the "?constraint:name" syntax to "?name:constraint". Note that NAME still defaults to the constraint, so "?body" still is a constrained variable. Constraint name abbreviation: We mildly favor keeping the abbreviations; they are quite clear, so the only possible confusion is when typing them in. Constraint name digits: We oppose allowing "?var2"; if you really are that uncreative, you can always say "?var2:var". Reserved word hygiene: Since macros can introduce new reserved words, we want some sort of hygiene for reserved words. The intent isn't really clear from the existing discussion of hygiene. For example, can I have a macro whose expansion freely references a normal variable which happens to be a reserved word in some modules which call that macro?