Problem with number//1

For a few weeks I was writing a PostScript interpreter in SWI-Prolog (ref) for use with PDFs and found that using EDGCs was more advantageous as the state being passed around was getting rather complex.

I did get it to the point it could interpret some simple postscript but not the full language. Then I found a better way to solve my problem so abandoned that part of the project.


EDIT

FYI for those looking to use EDCGs.

From my personal experience in using them I learned that they take the idea of DCGs and show one how they can step up to higher levels for processing data in complex streams. But also learned that EDCGs as implemented for the Aquarius compiler were very specific for that need. In other words, if it seems you are shoe-horning the logic to work with the existing syntax for EDCG, then consider rolling your own. e.g.

Aquarius has syntax such as

X/Acc
Acc/X
X/Acc/Y

but with stack based languages, the idea of pop and push make more sense.

If I knew and felt comfortable with Conditional compilation and program transformation better I would probably have used that with EDCGs.