FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Breaking Change to format() and related functions

 
Post new topic   Reply to topic     Forum Index -> MiniD
View previous topic :: View next topic  
Author Message
JarrettBillingsley



Joined: 20 Jun 2006
Posts: 457
Location: Pennsylvania!

PostPosted: Sat Jun 13, 2009 3:42 pm    Post subject: Breaking Change to format() and related functions Reply with quote

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
View user's profile Send private message
spir



Joined: 11 Oct 2010
Posts: 2

PostPosted: Wed Feb 09, 2011 10:26 am    Post subject: Reply with quote

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
View user's profile Send private message
JarrettBillingsley



Joined: 20 Jun 2006
Posts: 457
Location: Pennsylvania!

PostPosted: Thu Mar 31, 2011 7:47 pm    Post subject: Reply with quote

Okay? X)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> MiniD All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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