On 2020/04/27 09:11:16, dak wrote:
> Han-Wen Nienhuys <mailto:hanw...@gmail.com> writes:
> 
> > On Mon, Apr 27, 2020 at 10:59 AM <mailto:d...@gnu.org> wrote:
> >> When the parser sees some \blabla it will generally first have to
check
> >> for a keyword and (when it has no match) afterwards for a variable
with
> >> that name, and a lot of those are actually music functions these
days
> >> that used to be keyword.
> >>
> >> Wouldn't it make sense to just convert \xxx into a symbol early on
in
> >> the lexer?  That is essentially a hash code, and we have lookups
for
> >> those.  It seems wasteful to use two completely different ways of
> >> hashing a string in succession when we can just turn this into a
symbol
> >> early on and work with that instead.
> >
> > If you can make Bison work off SCM symbol values, be my guest.
> 
> Yo may have missed the memo, but everything passed into and out of the
> parser and Lexer these days is SCM.  And for looking up a token ID
from
> an SCM symbol, Guile has hashtables, and we also habe Scm_hashtable.
> 
> -- 
> David Kastrup

Tracker issue: 5946
(https://sourceforge.net/p/testlilyissues/issues/5946/)
Rietveld issue: 577840053 (https://codereview.appspot.com/577840053)
Issue description:
  Use Scheme_hash_table for keyword handling


https://codereview.appspot.com/549920043/

Reply via email to