I believe that Jeff changed that to make the code generated by assertions less costly to evaluate in the common case that the assertion isn't triggered. I'm not certain why delaying the string construction to run time does that, but it seems to.
On Wed, Feb 19, 2014 at 11:41 AM, andrew cooke <[email protected]> wrote: > according to > http://julia.readthedocs.org/en/latest/manual/metaprogramming/ @assert is > defined as: > > macro assert(ex) > :($ex ? nothing : error("Assertion failed: ", $(string(ex))))end > > and i am wondering why there is a $(...) around the call to string. is this > to delay evaluation? > if so, why? > > thanks, > andrew > > > >
