Am I writing PostScript wrong?

Skip to first unread message

luser droog

Nov 25, 2021, 9:46:33 PM11/25/21
(I asked a similar question in comp.lang.c wrt C)

I've been really hooked on the parser combinator stuff for a while
and I've implemented a dozen or so versions in PostScript. But having
questioned whether I'm writing C wrong by turning it into Lisp,
the question naturally follows: Is my PostScript code too Lisp-y?

I'm regularly relying on my "pairs" and "func" extensions described

And along with these come `combine` and `curry`. So there's a whole
lotta currying going on. But I also noticed that I may be needlessly
creating extra Lisp-ish structures where they aren't needed or helpful.

The big problems with my last round of test cases for the parsers was
due to creating results as cons lists. When I just stopped doing that
and did something more sensible from the PS point of view, the whole
problem smoothed out and fizzled.

But even now, I'm adding extra structure to wrap up the "reply" from
each parser as a single object. PostScript doesn't naturally impose
this restriction. You can just return multiple values by leaving
multiple values. Invisible tuples, so to speak.

So, I might try one more re-write to strip away the structure and

<result> <remainder> true
<message> <remainder> false

And that's almost the same as the `token` interface. So, it feels
like the right direction.

Is my lisp showing in other places?
Reply all
Reply to author
0 new messages