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

Special-casing macros with &BODY #4

Closed
phoe opened this issue Apr 27, 2019 · 3 comments
Closed

Special-casing macros with &BODY #4

phoe opened this issue Apr 27, 2019 · 3 comments

Comments

@phoe
Copy link

phoe commented Apr 27, 2019

The README mentions:

output = with-output-to-string (`(*standard-output*), //; To preserve parens, I used Lisp escape
format(t, "Found '~C' starting at '~A'", target, result));

I think it should be possible to specify either manual or semi-automatic translations for macros which have a &BODY parameter, such as WITH-OPEN-FILE. A &BODY parameter is equivalent to a logical block that could be enclosed within a C-style block.

For example, the above macro could be written as:

output = with-output-to-string(*standard-output*) {
    format(t, "Found '~C' starting at '~A'", target, result));
  };
@y2q-actionman
Copy link
Owner

It looks interesting. I remind with syntax of JavaScript. However I take a time to implement it, because I found a bug in compound form processing...

@y2q-actionman
Copy link
Owner

Sorry for the late reply. (three years..)
I finally implemented a new syntax for doing this.

See examples in README:
https://github.com/y2q-actionman/with-c-syntax#support-with--like-macros

@phoe
Copy link
Author

phoe commented Oct 9, 2022

Thank you!

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

2 participants