guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: style Q: use keywords for my LALR parser generator?


From: Thien-Thi Nguyen
Subject: Re: style Q: use keywords for my LALR parser generator?
Date: Mon, 29 Dec 2014 12:23:50 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

() Matt Wette <address@hidden>
() Sun, 28 Dec 2014 16:23:28 -0800

   Now in the code I will need to be going through the
   productions checking if symbols are terminals (i.e., declared
   with "token").  This could end up being inefficient.

Why could it end up being inefficient?

   In order to make the code more efficient I am considering
   using keywords (e.g., test for terminal with "keyword?").
   However, I wonder if using keywords instead of "token"
   declarations would be considered "bad form."  For example, in
   the above, replace

       (token integer float)
       ...
       (factor (integer) (float))
   with
       (factor (#:integer) (#:float))

   Comments?

I like keywords because they font-lock (in Emacs) nicely, but
that's merely aesthetics.  I find working w/ keywords as data
slightly balky, and of late, have been migrating keyword-ful
code to use symbols, instead.

-- 
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

[Prev in Thread] Current Thread [Next in Thread]