On Sat, 25 Jan 2025 14:38:41 +0100
"Jakub T. Jankiewicz" <xxxxxx@onet.pl> wrote:
> I have a question related to usage uninterned symbols with macros.
>
> If uninterned symbol is self evaluated with :|srfi| how can you use it with
> macros as part of the code?
>
> (define-macro (foo expr)
> (let ((gensym :|srfi|))
> `(let ((,gensym ,expr))
> (+ ,gensym ,gensym))))
>
> If I have code like this, the gensym in expression + will evaluate to the
> symbol itself and return error that you can't use + operation on symbols. Or
> maybe :|srfi| syntax is only part of the reader and the output is something
> else?
>
> Note: that I've tried to make :|srfi| literal self evaluating symbol (in
> LIPS) and it breaks everything, since I've made gensyms also use uninterned
> symbols. So now the code can't reference a variable anymore only symbol as
> data.
>
> Or did I miss something?
>
In LIPS #:symbol is a syntax extension that expand into:
`(quote ,(gensym symbol))
Maybe the same should happen with :|symbol|
--
Jakub T. Jankiewicz, Senior Front-End Developer
https://jcubic.pl/me
https://lips.js.org
https://koduj.org