thank you very much Tomas,
it solved my problem:
(symbol->keyword (list->symbol ....
me too i was digging the manual for 2 hours :-)
Damien
note: seems a bit weird anyway that guile react differently in this case
than Kawa and Racket


On Thu, Jan 4, 2024 at 11:40 AM Tomas Volf <~@wolfsden.cz> wrote:

> On 2024-01-04 11:15:55 +0100, Damien Mattei wrote:
> > Hi,
> > why does
> > (string->symbol "#:hello")
> > $1 = #{#:hello}#
> >
> > gives #{#:hello}# in guile instead of #:hello ?
>
> My understanding is that keywords are not the same as symbols, that is why
> you
> get a different representation.
>
> >
> > like in Kawa or Racket
> >
> > i understand it is special to guile as i can write:
> > scheme@(guile-user)> #:hello
> > $1 = #:hello
> >
> > but then how can i generate a #:hello from a string or a list of char?
>
> You need to create a symbol and after that a keyword from it:
>
>     scheme@(guile-user)> (eq? #:hello (symbol->keyword (string->symbol
> "hello")))
>     $1 = #t
>
> There might be a direct way, but this is what I managed to put together
> after
> digging in the manual.
>
> Have a nice day,
> Tomas Volf
>
> --
> There are only two hard things in Computer Science:
> cache invalidation, naming things and off-by-one errors.
>

Reply via email to