Le samedi 20 décembre 2014 à 10:04 -0800, Daniel Carrera a écrit :
> Hello,
> 
> 
> Here is my problem in a nutshell:
> 
> 
> julia> @sprintf("%10f "^6, 1,2,3,4,5,6)
> ERROR: @sprintf: first argument must be a format string
> 
> 
> 
> 
> I cannot use the ^ operator inside a @sprintf, probably because
> @sprintf is a macro and something weird happens with the order of
> operation. This is irritating because it is making me write ugly-long
> lines in my code for something that should be shortened with "^".
> 
> 
> Is it possible to make @sprintf work correctly? If not, would you
> consider re-implementing it as a function? I don't understand why
> Julia makes @sprintf into a macro. The idea seems like a needless
> deviation from standard behaviour, and in this case it forces me to
> write uglier code.
This has been discussed recently on the mailing list about the question
of macros within @sprintf. It resulted in this issue being opened:
https://github.com/JuliaLang/julia/pull/9243


Regards

Reply via email to