guile-devel
[Top][All Lists]
Advanced

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

Re: How do I really do this?


From: Bruce Korb
Subject: Re: How do I really do this?
Date: Sat, 06 Mar 2004 09:43:44 -0800

Neil Jerram wrote:
> 
> Bruce Korb <address@hidden> writes:
> 
> > I would like to be able to associate a value with a string.

> > hash functions look perfect, except I can't use them unless
> > I have a hash table and there isn't any clear way I've found
> > to create hash table entries without having a hash table
> 
> You what?  What does it mean to create a hash table entry without a
> hash table?

How do I get a hash table started?  I've grepped throught he
ice-9 code and I'm sure something's in there.  But looking at
code around 'hash-create' and 'hashq-create' or even just "hash"
didn't yield anything that worked.  I guess I just need something
really explicit, like:

   (define my-hash-table (hash-table-create))

except that doesn't work.  What does?

> > I've tried:
> >
> >   (define (string->symbol (function-returning-string))
> >           (value-function))
> 
> This is bizarre and makes no sense.  The syntax is wrong, and I can't
> guess what you mean.

OK.  This works:

   (define sym-name (value-function))

So, why doesn't this:

   (define (string->symbol "sym-name") (val-func))

If the "sym-name" in the first expression is a symbol, then
why isn't the string->symbol function yielding a symbol?

> > I thought that to be really obvious, but I was wrong.
> > If either of these mecanisms are documented somewhere,
> > I'd gladly read it.  Meanwhile, can someone send me a hint?
> > Thank you. - Bruce
> 
> No, although I'd like to!  Please ask again with more clarity.

:-)  Thank you, Neil.

Regards, Bruce




reply via email to

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