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

Determining if the prefix is being called within a given function/macro #119

Closed
vemv opened this issue Apr 11, 2024 · 2 comments
Closed
Labels

Comments

@vemv
Copy link
Contributor

vemv commented Apr 11, 2024

For clojure-emacs/cider-nrepl#863 (comment) , I'd need to know if the prefix is being called within a given function macro, given a context.

e.g. "is __prefix__ within a future call"?

That would be true here:

(future
  __prefix__)

(future
  (foo __prefix__))

But not here:

(do
  (future 42)
  (foo __prefix__))

...I'm wondering if this is something you've solved before, or that might be easy with some existing Compliment primitives?

Cheers - V

@vemv
Copy link
Contributor Author

vemv commented Apr 15, 2024

Any thoughts on this one?

The way I'd implement it would be probably by repatedly going up zippers.

@alexander-yakushev
Copy link
Owner

This should be possible without having to use zippers. The context format that Compliment provides is suitable for that. See https://github.com/alexander-yakushev/compliment/wiki/Context.

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

No branches or pull requests

2 participants