This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: embedding question: defining symbols?


jimb@red-bean.com writes:
> Hail, Han-Wen!  (gosh)
> 
> 
> You have the right idea.  However, guile doesn't have first-class
> environments at the moment; we just use ordinary hash tables to map
> our symbols to their values.
> 
> So I think (if I can read your C++) that you want to make a C++ class
> that wraps Guile symbol objects with a few methods, and then use a
> Dictionary<Guile_Symbol> in class Bla.  

Is it guaranteed that the value of SCM is not changed from under
during GC, so that I can just use ((SCM >> 32) ^ (SCM & 0xffffffff))
as a hashing function?

> That is, find some way to use
> symbols as the keys in your table.
> 
> When Guile acquires real first-class environments, then you may want
> to change your code.

So what you are saying is, that I also cannot recode C++ methods in
Scheme? Hmm...

> I wonder if Guile's new MOP could somehow accomodate your classes, and
> let LilyPond objects be subclassed in Scheme, etc.

What is a MOP?

-- 

Han-Wen Nienhuys, hanwen@cs.uu.nl ** GNU LilyPond - The Music Typesetter 
      http://www.cs.uu.nl/people/hanwen/lilypond/index.html