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

zero argument macro parse bug #194

Closed
StefanKarpinski opened this issue Sep 5, 2011 · 1 comment
Closed

zero argument macro parse bug #194

StefanKarpinski opened this issue Sep 5, 2011 · 1 comment
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@StefanKarpinski
Copy link
Sponsor Member

julia> macro todo()
         :(error("TODO: unimplemented code called"))
       end

julia> @todo
TODO: unimplemented code called

julia> e = try     
         @todo
       catch e
syntax error: unexpected catch

Not sure of the general utility of zero-argument macros, but it seems like this ought to work.

@StefanKarpinski
Copy link
Sponsor Member Author

Actually, now that I think about it, zero-argument macros can be very handy for debugging. It's pretty common to pepper a section of code with the same debug statement that prints a bunch of state data, and which is often pretty long. Cut-and-paste makes this fairly easy, but just defining a macro and then writing @debug or just @d to print debug info is even easier and far less noisy. It also makes it easy to leave the @debug statements in and just make the macro emit a no-op to turn off all the debugging code.

@ghost ghost assigned JeffBezanson Sep 5, 2011
JeffBezanson added a commit that referenced this issue Sep 5, 2011
StefanKarpinski added a commit that referenced this issue Sep 6, 2011
* 'master' of github.com:JuliaLang/julia:
  Build CBLAS as part of openblas. perf.cc works on all platforms now.
  fixing issue #194
  fixing a case where code at the prompt containing closures wouldn't get type inference run on it
  lowering 1-element blocks more efficiently; was inhibiting some tuple   elimination fixing tuple elimination for LHS variables with declared types, where   conversion is done
  Wrap cblas call in __APPLE__
  Reorganize tests in perf.cc to make it closer to julia tests. Start implementation of randmatstat.
  take(r), put(r,val) for RemoteRefs, making them 1-element shared queues adding dcell()
  Sort n-d arrays along any dimension.
  Fix bug in sort(x,2)
  dgemm_ declaration is unnecessary in perf.cc.
  fixing bug in method caching logic for certain tuple type arguments
StefanKarpinski pushed a commit that referenced this issue Feb 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants