guile-user
[Top][All Lists]
Advanced

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

Re: hashmark in symbols


From: Taylan Kammer
Subject: Re: hashmark in symbols
Date: Mon, 2 Jan 2023 07:59:40 +0100
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1

On 02.01.2023 07:25, Andreas Reuleaux wrote:
> Ah, OK, this helps indeed
> 
> --8<---------------cut here---------------start------------->8---
> (read-enable  'r7rs-symbols)
> --8<---------------cut here---------------end--------------->8---
> 
Another option would be to use string->symbol:

  (string->symbol "#444")

That being said, I wonder if it's not better to use strings for this.

Is there any particular reason you want to use symbols to represent CSS
color values?  I assume that your main requirements are:

- Easy to represent as literal values in code.

- Easy to splice into a bigger string (or write into an output stream) that
  will become an entire CSS code snippet or file.

Strings seem like the most straightforward choice.  All in all there's not
much difference though, given that symbols are basically just automatically
interned immutable strings.

-- 
Taylan




reply via email to

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