Re: String to Num (was Re: Numeric Literals (Summary))

2002-11-20 Thread Dave Storrs
On Wed, Nov 20, 2002 at 01:23:04PM -0800, Dave Whipp wrote: > > "Larry Wall" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > On Wed, Nov 20, 2002 at 11:57:33AM -0800, Michael Lazzaro wrote: > > : and _I'm_ trying to promote the reuse of the old "oct/hex

Re: String to Num (was Re: Numeric Literals (Summary))

2002-11-20 Thread Dave Storrs
On Wed, Nov 20, 2002 at 12:11:21PM -0800, Larry Wall wrote: > On Wed, Nov 20, 2002 at 11:57:33AM -0800, Michael Lazzaro wrote: > : and _I'm_ trying to promote the reuse of the old "oct/hex" > : functions to do a similar both-way thing, such that: > > What's a two-way function supposed to ret

Re: String to Num (was Re: Numeric Literals (Summary))

2002-11-20 Thread Dave Whipp
"Larry Wall" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > On Wed, Nov 20, 2002 at 11:57:33AM -0800, Michael Lazzaro wrote: > : and _I'm_ trying to promote the reuse of the old "oct/hex" > : functions to do a similar both-way thing, such that: > > What's

Re: String to Num (was Re: Numeric Literals (Summary))

2002-11-20 Thread Michael Lazzaro
On Wednesday, November 20, 2002, at 12:11 PM, Larry Wall wrote: On Wed, Nov 20, 2002 at 11:57:33AM -0800, Michael Lazzaro wrote: : and _I'm_ trying to promote the reuse of the old "oct/hex" : functions to do a similar both-way thing, such that: What's a two-way function supposed to return

RE: String to Num (was Re: Numeric Literals (Summary)) [x-bayes][ x-adr]

2002-11-20 Thread Garrett Goebel
From: Michael Lazzaro [mailto:[EMAIL PROTECTED]] > > and _I'm_ trying to promote the reuse of the old "oct/hex" > functions to do a similar both-way thing, such that: [...] > but people just aren't biting, so far. Don't see why > not, I think it's keen. There's the problem Larry ment

Re: String to Num (was Re: Numeric Literals (Summary))

2002-11-20 Thread Larry Wall
On Wed, Nov 20, 2002 at 11:57:33AM -0800, Michael Lazzaro wrote: : and _I'm_ trying to promote the reuse of the old "oct/hex" : functions to do a similar both-way thing, such that: What's a two-way function supposed to return if you pass it something that has both a string and a numeric valu

Re: String to Num (was Re: Numeric Literals (Summary))

2002-11-20 Thread Michael Lazzaro
On Wednesday, November 20, 2002, at 11:01 AM, Dave Storrs wrote: Actually, this would be a good reason to have a function called "literal" -- if it went both ways. So, I could do this: print literal(200+55):hex; # == print "0xff"; print literal("0xff)); # == print 255; [EMAIL PROTE

Re: String to Num (was Re: Numeric Literals (Summary))

2002-11-20 Thread Dave Storrs
Attributions getting confusing, so I have snipped and rewritten: Dave Storrs writes: > > Actually, this would be a good reason to have a function called > > "literal" -- if it went both ways. So, I could do this: > > > >print literal(200+55):hex; # == print "0xff"; > >print litera

Re: String to Num (was Re: Numeric Literals (Summary))

2002-11-20 Thread fearcadi
Dave Storrs writes: > On Fri, Nov 15, 2002 at 11:50:52PM +0200, [EMAIL PROTECTED] wrote: > > Michael Lazzaro writes: > > depending on WYW . or the casting may be let to happen in two stages > > : string -> num -> specific num type ,e.g. uint16 > > How about if we got adverbial on the probl

Re: String to Num (was Re: Numeric Literals (Summary))

2002-11-19 Thread Dave Storrs
On Fri, Nov 15, 2002 at 11:50:52PM +0200, [EMAIL PROTECTED] wrote: > Michael Lazzaro writes: > > Let's summarize some of the string-to-num issues: > > > >my int $i = literal "0xff"; # 255 > > > > > > (3) -- We want to be able to parse a string as a number using a very > > _specific

Re: String to Num (was Re: Numeric Literals (Summary))

2002-11-15 Thread fearcadi
Michael Lazzaro writes: > Let's summarize some of the string-to-num issues: > >my int $i = literal "0xff"; # 255 > > > (3) -- We want to be able to parse a string as a number using a very > _specific_ rule; for example, if a user is expected to enter a value in > a specific forma

String to Num (was Re: Numeric Literals (Summary))

2002-11-15 Thread Michael Lazzaro
Let's summarize some of the string-to-num issues: (1) -- A number is just a number, regardless of how it's put in. Therefore: my int $i = 0xff; my int $i = 255; result in the identical number, 255, being placed in $i. Once it's in there, there's no way to tell what format it originally