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

How to match any quoted expression? #60

Closed
Qiyamah opened this issue May 8, 2018 · 1 comment
Closed

How to match any quoted expression? #60

Qiyamah opened this issue May 8, 2018 · 1 comment

Comments

@Qiyamah
Copy link

Qiyamah commented May 8, 2018

I want to match things like :(x+y)
basically anything quoted, how can i do that?

i tried this:
ff(:R{:, quoted}), didn't work

Thanks

@fcard
Copy link
Owner

fcard commented May 10, 2018

Either :quoted or :(quoted) will work.

julia> @metafunction f(:(quoted)) = quoted
f (generic function with 1 method)

julia> f(:(:(x+y)))
:(x + y)
julia> @metafunction g(:(x + y)) = x,y
g (generic function with 1 method)

julia> g(:(:(1 + 2)))
(1, 2)

But see #20, I am still unsure if :quoted should match the literal :quoted, or stay the way it is.

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

No branches or pull requests

2 participants