Re: rethinking printf

2002-03-19 Thread Rich Morin
The ListMom for FWP has asked that this thread be removed from that list. Please edit your submissions accordingly. -r -- email: [EMAIL PROTECTED]; phone: +1 650-873-7841 http://www.cfcl.com/rdm- my home page, resume, etc. http://www.cfcl.com/Meta - The FreeBSD Browser, Meta Project, etc.

Re: rethinking printf

2002-03-18 Thread Luke Palmer
On Mon, 18 Mar 2002, Jim Cromie wrote: > Rich Morin wrote: > > > At 11:24 PM -0500 3/6/02, Uri Guttman wrote: > > > >> qn would be just like qq but not allow any > >> direct hash interpolations (%foo or %foo{bar}). you can always get those > >> with $() if needed. this solves the common c

Re: rethinking printf

2002-03-18 Thread Jim Cromie
Rich Morin wrote: > At 11:24 PM -0500 3/6/02, Uri Guttman wrote: > >> qn would be just like qq but not allow any >> direct hash interpolations (%foo or %foo{bar}). you can always get those >> with $() if needed. this solves the common case with a minimal of noise >> and the uncommon case h

Re: rethinking printf

2002-03-11 Thread Tony Hall
On 10 Mar 02 at 11:14:26PM, Uri Guttman wrote: > i really think that the printf format spec is so standard and ingrained > that changing it with # for % or requiring \% is not a good idea. > > but then again, backwards compatibility is not a rule you must always > obey. i just think in this case

Re: rethinking printf

2002-03-11 Thread ianb
On 10 Mar 02 at 11:14:26PM, Uri Guttman wrote: > i really think that the printf format spec is so standard and ingrained > that changing it with # for % or requiring \% is not a good idea. > > but then again, backwards compatibility is not a rule you must always > obey. i just think in this case

Re: rethinking printf

2002-03-10 Thread Uri Guttman
> "PS" == Peter Scott <[EMAIL PROTECTED]> writes: PS> At 01:39 AM 3/11/02 +0100, Eugene van der Pijll wrote: >> Why not replace the escape character '%' with '#'? No new quoting >> operators or functions to learn. PS> Beat me to it. >> And introduce a warning if there are >> no

Re: rethinking printf

2002-03-10 Thread Peter Scott
At 01:39 AM 3/11/02 +0100, Eugene van der Pijll wrote: >Why not replace the escape character '%' with '#'? No new quoting >operators or functions to learn. Beat me to it. >And introduce a warning if there are >no #'s in the format string. Maybe if it's a constant, but not if you're doing someth

Re: rethinking printf

2002-03-10 Thread Uri Guttman
> "BD" == Brent Dax <[EMAIL PROTECTED]> writes: BD> Uri Guttman: BD> # $prec = %hash{width} ; BD> # sprintf( qf"%${prec}s", $string); BD> # BD> # sprintf( "\%${prec}s", $string); BD> # BD> # is one of your alternatives. :-/ BD> You forgot one. BD> sprintf('%'_%hash{width

Re: rethinking printf

2002-03-10 Thread Eugene van der Pijll
Why not replace the escape character '%' with '#'? No new quoting operators or functions to learn. And introduce a warning if there are no #'s in the format string. Eugene

RE: rethinking printf

2002-03-10 Thread Brent Dax
Uri Guttman: # > "BD" == Brent Dax <[EMAIL PROTECTED]> writes: # # BD> I think qn counts as weird syntax. I ask again, what's # wrong with one # BD> of: # # BD> sprintf("%hash\%s", $string); # # BD> sprintf(%hash.'%s', $string); # BD> sprintf('%s%s', _%hash,

Re: rethinking printf

2002-03-10 Thread Uri Guttman
> "BD" == Brent Dax <[EMAIL PROTECTED]> writes: BD> I think qn counts as weird syntax. I ask again, what's wrong with one BD> of: BD> sprintf("%hash\%s", $string); BD> sprintf(%hash.'%s', $string); BD> sprintf('%s%s', _%hash, $string); what if you want to use %hash{width}

RE: rethinking printf

2002-03-10 Thread Brent Dax
Abigail: # I'd think it would be much better that '%' followed by a word *not* # followed by a { isn't interpolated. Granted, you cannot do # interpolation # of hashes (well, one could always write "@{[%hash]}", just # like in perl5, # and there's little change of clashing with printf formats. # T

RE: rethinking printf

2002-03-10 Thread Brent Dax
Uri Guttman: # i disagree. but we shall see if larry is listening to this thread and # will back away from hash interpolation or take some of our suggestions # that make it work without killing format strings. i hate to see a # special call or wierd syntax for that. my qn (or qf) # suggestion seem

Re: rethinking printf

2002-03-10 Thread Uri Guttman
> "a" == abigail <[EMAIL PROTECTED]> writes: a> On Wed, Mar 06, 2002 at 11:15:30PM -0500, Uri Guttman wrote: >> >> good point. $() can still wrap that but then there has to be a balance >> between printf strings and double quoters. how about this wacky idea: >> >> make a new ty

Re: rethinking printf

2002-03-10 Thread abigail
On Wed, Mar 06, 2002 at 11:15:30PM -0500, Uri Guttman wrote: > > "BL" == Bart Lateur <[EMAIL PROTECTED]> writes: > > BL> On Wed, 6 Mar 2002 17:57:07 -0500, Uri Guttman wrote: > >> how often will you need to interpolate a hash? > > BL> A whole hash: quite rarely. A hash item: a LOT. Don

Re: rethinking printf

2002-03-07 Thread Dmitry Kohmanyuk Дмитрий Кохманюк
On Wed, Mar 06, 2002 at 11:24:57PM -0500, Uri Guttman wrote: > that is another point. not allowing a complete hash to interpolate. but > what defines that? what if you wanted %s{bar} and that was a format and > not a hash and in a double quoted string? my proposal handles that well > with no major

Re: rethinking printf

2002-03-07 Thread Rich Morin
At 11:24 PM -0500 3/6/02, Uri Guttman wrote: > qn would be just like qq but not allow any >direct hash interpolations (%foo or %foo{bar}). you can always get those >with $() if needed. this solves the common case with a minimal of noise >and the uncommon case has a simple out of using $(). no

Re: rethinking printf

2002-03-06 Thread Uri Guttman
> "BD" == Brent Dax <[EMAIL PROTECTED]> writes: BD> Uri Guttman: BD> # printf "%d hash is $(%foo.string)", $bar ; BD> # BD> # no ambiguity and no confusion. how often will you need to BD> # interpolate a BD> # hash? BD> As others have pointed out, %foo{BAR} has to work.

Re: rethinking printf

2002-03-06 Thread Uri Guttman
> "BL" == Bart Lateur <[EMAIL PROTECTED]> writes: BL> On Wed, 6 Mar 2002 17:57:07 -0500, Uri Guttman wrote: >> how often will you need to interpolate a hash? BL> A whole hash: quite rarely. A hash item: a LOT. Don't forget that BL> $foo{BAR} will now become %foo{BAR} good point. $()

RE: rethinking printf

2002-03-06 Thread Brent Dax
Uri Guttman: # printf "%d hash is $(%foo.string)", $bar ; # # no ambiguity and no confusion. how often will you need to # interpolate a # hash? As others have pointed out, %foo{BAR} has to work. But I have another question for you: what's wrong with sprintf '%d hash is %s', $bar,

Re: rethinking printf

2002-03-06 Thread Austin Hastings
--- Bart Lateur <[EMAIL PROTECTED]> wrote: > On Wed, 6 Mar 2002 17:57:07 -0500, Uri Guttman wrote: > > >how often will you need to interpolate a hash? > > A whole hash: quite rarely. A hash item: a LOT. Don't forget that > $foo{BAR} will now become %foo{BAR} Of course, it could also become %s.

Re: rethinking printf

2002-03-06 Thread Bart Lateur
On Wed, 6 Mar 2002 17:57:07 -0500, Uri Guttman wrote: >how often will you need to interpolate a hash? A whole hash: quite rarely. A hash item: a LOT. Don't forget that $foo{BAR} will now become %foo{BAR} -- Bart.

RE: rethinking printf

2002-03-06 Thread David Whipp
> printf "%d hash is $(%foo.string)", $bar ; > no ambiguity and no confusion. This would be nice, if scalar things use '$'. But: perl5: printf "%d is $foo{bar}", $baz; perl6: printf "%d is $(%foo{bar})", $baz; Not so nice. Dave.

Re: rethinking printf

2002-03-06 Thread Uri Guttman
> "BC" == Bernie Cosell <[EMAIL PROTECTED]> writes: BC> I wonder if the solution is to look at it the other way: that you BC> have to do something to get interpolation to happen. If we look BC> at it from the old adage of making the more common things simpler, BC> at least in my co