Re: term_expansion/2 with DCG clauses
Michael Hendricks <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <CAFHuXuYdf=3_ROcfZh7xynBmvcznPTecMsgjjYZuNmq8m0yWVQ@mail.gmail.com> |
On Wed, Aug 14, 2013 at 3:24 AM, Jan Wielemaker <[email protected]> wrote: > On 08/14/2013 04:28 AM, Richard A. O'Keefe wrote: > >> If I recall correctly, DCG expansion was done *before* user expansion. >> With there being no goal_expansion in those days, this was important if >> you wanted users to be able to plug their own goal_expansion code in and >> have it apply to the result of DCG expansion. >> Further, DCG expansion was available as library code, so if you wanted it, >> you could very easily call it yourself. >> > > So not doing DCG expansion if user expansion is involved seems out of > date. The idea to chain `translation packages' is also implemented in > Ciao and ECLiPSe (and Logtalk?), although the way the packages are > specified there is much more fine-grained. > Is there a reason why macro expansions are not all iterated until a fixed point is reached? expand_goal/2 behaves that way and I find it quite practical. It seems to eliminate some of the problems we get from doing one kind of expansion always before another. -- Michael -------------- next part -------------- HTML attachment scrubbed and removed