() Matt Wette <[email protected]>
() Mon, 29 Dec 2014 06:05:35 -0800

   (define (non-terminal? term tokl)
     (and (symbol? term) (not (memq term tokl))))

If ‘tokl’ contains only symbols, then the first sub-expression
‘(symbol? term)’ is superfluous, thanks to ‘memq’.

   (define (non-terminal? term)
     (symbol? term))

How about using an object property?

 (define terminal (make-object-property))
 
 (define (non-terminal? obj)
   (not (terminal obj)))

You would have to ‘(set! (terminal OBJ) #t)’ for every terminal,
of course.  This works fine w/ either symbols or keywords, btw.

-- 
Thien-Thi Nguyen
   GPG key: 4C807502
   (if you're human and you know it)
      read my lisp: (responsep (questions 'technical)
                               (not (via 'mailing-list)))
                     => nil

Attachment: signature.asc
Description: PGP signature

Reply via email to