unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Damien Mattei <damien.mattei@gmail.com>
To: Damien Mattei <damien.mattei@gmail.com>, guile-user <guile-user@gnu.org>
Subject: Re: symbol is nested in #{ ...... }#
Date: Thu, 4 Jan 2024 12:35:18 +0100	[thread overview]
Message-ID: <CADEOadeKN9r6dmei_2Yo=fWUB0KbvnTwrqYqr+rfjU8s5FO0WA@mail.gmail.com> (raw)
In-Reply-To: <ZZaLNWp8PogNrNjp@ws>

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	other threads:[~2024-01-04 11:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-04 10:15 symbol is nested in #{ ...... }# Damien Mattei
2024-01-04 10:40 ` Tomas Volf
2024-01-04 11:35   ` Damien Mattei [this message]
2024-01-04 19:04     ` Thompson, David
2024-01-04 20:12       ` Damien Mattei
2024-01-04 20:20         ` Zelphir Kaltstahl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADEOadeKN9r6dmei_2Yo=fWUB0KbvnTwrqYqr+rfjU8s5FO0WA@mail.gmail.com' \
    --to=damien.mattei@gmail.com \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).