Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interpol macro? #12

Open
mmontone opened this issue Feb 3, 2023 · 4 comments
Open

interpol macro? #12

mmontone opened this issue Feb 3, 2023 · 4 comments

Comments

@mmontone
Copy link

mmontone commented Feb 3, 2023

Hello,

I have this macro in my code:

(defmacro interpol (string) 
  (with-input-from-string (s (prin1-to-string string))
    (cl-interpol:interpol-reader s nil nil :recursive-p nil)))

So I don't need to use the reader syntax. I just use the macro.

What do you think of including in cl-interpol?

@dieggsy
Copy link

dieggsy commented Jan 15, 2025

I think this is pretty nice. It would be great to include this.

@dieggsy
Copy link

dieggsy commented Jan 15, 2025

Oh, this doesn't seem to work in all cases?

CL-USER> #?"\N{Greek capital letter Sigma}"
"Σ"
CL-USER> (interpol "\N{Greek capital letter Sigma}")
"N{Greek captial letter Sigma}"

@phoe
Copy link

phoe commented Jan 20, 2025

You must now double-backslash the N because now it is read with the standard Lisp reader, not via the cl-interpol one.

@dieggsy
Copy link

dieggsy commented Jan 24, 2025

Oh, I thought I added that in my examples. I did try it, but it seemed not to work anyway:

CL-USER> (interpol "\\N{Greek capital letter Sigma}")
"\\N{Greek capital letter Sigma}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants