Usage with macros Jakub T. Jankiewicz (25 Jan 2025 13:38 UTC)
Re: Usage with macros Jakub T. Jankiewicz (25 Jan 2025 14:34 UTC)
Re: Usage with macros Wolfgang Corcoran-Mathe (25 Jan 2025 17:57 UTC)
Re: Usage with macros Marc Nieper-Wißkirchen (25 Jan 2025 18:11 UTC)
Re: Usage with macros Jakub T. Jankiewicz (25 Jan 2025 20:25 UTC)
Re: Usage with macros Marc Nieper-Wißkirchen (25 Jan 2025 20:30 UTC)
Re: Usage with macros Jakub T. Jankiewicz (26 Jan 2025 00:01 UTC)

Usage with macros Jakub T. Jankiewicz 25 Jan 2025 13:38 UTC

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?

--
Jakub T. Jankiewicz, Senior Front-End Developer
https://jcubic.pl/me
https://lips.js.org
https://koduj.org