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.

Attachment: signature.asc
Description: PGP signature

Reply via email to