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

@code_llvm, @code_native, etc. macros? #5674

Closed
quinnj opened this issue Feb 4, 2014 · 8 comments
Closed

@code_llvm, @code_native, etc. macros? #5674

quinnj opened this issue Feb 4, 2014 · 8 comments

Comments

@quinnj
Copy link
Member

quinnj commented Feb 4, 2014

Similar to the @which macro, could we also have the code_... family of functions available as macros? That would allow one to check generated code even faster:

@code_llvm Date(2014,2,4)

would translate to a call of:

code_llvm(Date,(Int64,Int64,Int64))

This would be a pull request, but my meta chops are probably not quite Base-worthy, after taking a look at the @which implementation.

@quinnj
Copy link
Member Author

quinnj commented Feb 4, 2014

cc: @astrieanna

@johnmyleswhite
Copy link
Member

This seems like it might be a bit brittle since the only input types that could be reasoned about by the macro are those with literal syntax that uniquely defines the types: Int, Float64 and ByteString. For most other functions I'm not sure how'd you make this work.

@simonster
Copy link
Member

You could just rewrite @code_llvm f(x, y, z) to code_llvm(f, (typeof(x), typeof(y), typeof(z))), no?

@johnmyleswhite
Copy link
Member

That's true: you could defer type knowledge to runtime.

@JeffBezanson
Copy link
Sponsor Member

Yes, @simonster has the right idea.

@filmackay
Copy link

great idea

@ivarne
Copy link
Sponsor Member

ivarne commented Feb 5, 2014

I want @less and @edit also. Sometimes I just want to see the source of the function instead of the file and line that I get from @which

@mbauman
Copy link
Sponsor Member

mbauman commented Apr 8, 2014

Closed by #5832.

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

7 participants