Re: [stack] fundamental type system problems + possible solutions
John Nowak <[email protected]>
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <[email protected]> |
On May 1, 2008, at 11:30 AM, William Tanksley, Jr wrote: >> The problem is not typing the arguments to the macro; it's dealing >> with the situation where the expansion of the macro is not inferable >> and there's no way to provide annotations to quotations within the >> expansion because the expansion is obviously not in the source code. > > I can read this okay up until the phrase "obviously not in the source > code." ... (unless you mean > not part of the original source code pre-generation, but again, I > don't see how it makes a difference whether the code was typed out by > hand or generated by a macro). That is what I mean. Say you give a macro a quotation. That quotation type checks. Now say the macro tears the quotation apart, and one of the individual parts of the quotation doesn't check (which is very possible). How would you annotate the fragment of the quotation that failed to check? > But a dynamic failure "during a compile time expansion" is actually a > static failure during the definition of the word using the macro, and > you've got all the same problems you wanted to solve as far as > printing out a readable error message that the person trying to use > the macro will be able to figure out. Good point. Debugging macros is already little fun to begin with though. My point was just that you won't be getting an error at runtime. In any case, I have another approach for a type system I want to try that more heavily depends on the algebraic properties of the language. Initial results are encouraging, but I'll need another couple of months to implement it as it's rather complex and I'm guessing my way through it. - John