[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] A question about keywords and symbol->string
From: |
megane |
Subject: |
Re: [Chicken-users] A question about keywords and symbol->string |
Date: |
Tue, 21 Mar 2017 22:04:37 +0200 |
User-agent: |
mu4e 0.9.16; emacs 24.4.1 |
Evan Hanson <address@hidden> writes:
> Anyway, to get a string that *looks* like a keyword, the easiest option
> is probably to go via the written representation with something like:
>
> (format "~s" foo:)
>
> However note that this is sensitive to the keyword-style parameter, as
> hinted at above:
>
> (parameterize ((keyword-style #:prefix)) (format "~s" #:foo)) ; => ":foo"
> (parameterize ((keyword-style #:suffix)) (format "~s" #:foo)) ; => "foo:"
> (parameterize ((keyword-style #f)) (format "~s" #:foo)) ; => "#:foo"
>
> Hope that helps,
Yes, thanks.
I went with an error message if the prefix is a keyword suggesting to
use a string instead.