Le samedi 20 décembre 2014 à 19:53 +0100, Daniel Carrera a écrit : > Thanks! > > > Do I need to move to Julia 0.4 to use this? I know that 0.4 is > unstable, so maybe I should wait until 0.4 comes out... This is only on 0.4 AFAICT. But note I didn't say this fixes your problem, just that the discussion that was prompted by this change was tightly related to your issue. No general solution has been implemented so far.
Regards > Cheers, > Daniel. > > On 20 December 2014 at 19:10, Milan Bouchet-Valat <[email protected]> > wrote: > 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 > > > > > > -- > When an engineer says that something can't be done, it's a code phrase > that means it's not fun to do. >
