Hi Doug,

> Might be something to consider adding to pilog.l Seems to be fairly
> standard in prologs - and useful for creating parsers :-)

OK, so let's see how it works out. Should perhaps be put into the

To make such rule declarations easier in the future, I've added a new
'clause' function, an evaluating equivalent of 'be'. It is available in
version (current testing release), and also in Mini and Ersatz.

With that, the definition of 'dcg' can be slightly simplified:

   (de dcg CL
         (if (pair (cadr CL))
               (car CL)
               (list (cons (caadr CL) '"@A") '"@A") )
               (car CL)
               '("@In" "@Out")
               (let Vars
                     (link "@In")
                     (for (I . @) (cddr CL)
                        (link (pack "@" I)) )
                     (link "@Out") )
                  (mapcar list
                     (cdr CL)
                     (cdr Vars) ) ) ) ) ) )

'be' makes use of it:

   (de be CL
      (clause CL) )

- Alex
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to