View previous topic :: View next topic |
Author |
Message |
JarrettBillingsley
Joined: 20 Jun 2006 Posts: 457 Location: Pennsylvania!
|
Posted: Sat Jun 13, 2009 3:42 pm Post subject: Breaking Change to format() and related functions |
|
|
I've recently simplified the way format and related functions (writef, writefln, and all their brethren in the streamlib and in the StringBuffer class) work. Instead of working like Phobos1, where all params are printed, and where any string in the param list could be used as a format string (unless it was already printed by a previous format string!), it's now just that the first parameter is the format string, followed by any parameters that it will reference. This works like printf(), Phobos2, Tango, .Net, Java, etc. etc. etc.
So please grep for (writef|format) and update accordingly! |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
spir
Joined: 11 Oct 2010 Posts: 2
|
Posted: Wed Feb 09, 2011 10:26 am Post subject: |
|
|
I plan to use
"hello, 'userName', who are you?"
for
format("hello, {}, who are you?", userName)
(Not 100% sure of MiniD syntax,, please excuse, nut I guess you guess what I mean).
To make things simple, '...' would maybe hold only IDs (which includes qualified and indexed thingies), unlike eg in Cobra where {} can hold any expression.
By the way, I saw the issue you have about notations like
[[1 2] [3]]
I consider this issue artificial, in that there is no need to allow optional spacing between a collection and an index applying on it. Just declare
names[i]
to be a (compund) identifier for the element #i of names. Just obj.m. I use '#i' instead of '[i]', which makes the parallel with qualified names more obvious:
names#i
And yes, collections in my case use spacing as separator (no ',' at all), like the nested list example above, or:
('a':1 'b':2 'c':3)
fo "units" (kinds of named tuple, objects like prototype langs or Lua tables used as objects).
Denis
(PS: those markup lang that do not respect author's spacing are VERY annoying) |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
JarrettBillingsley
Joined: 20 Jun 2006 Posts: 457 Location: Pennsylvania!
|
Posted: Thu Mar 31, 2011 7:47 pm Post subject: |
|
|
Okay? X) |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|