Re: String to Num (was Re: Numeric Literals (Summary))
[email protected] ("Dave Whipp") Wed, 20 Nov 2002 13:23:04 -0800
| Newsgroups | perl.perl6.documentation |
|---|---|
| Organization | Fast-Chip inc. |
| Message-ID | <[email protected]> |
"Larry Wall" <[email protected]> wrote in message 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 a two-way function supposed to return if you pass it something > that has both a string and a numeric value? Convert it both directions? It returns a junction, of course ;-) Seriously though, I dislike the proposal. Of course, if we have a 'do-it-as-a-string' operator modifier (As discussed for bitops, etc), then we could have: ~hex(10) eq 'a' hex(10) eq '16' But I still tend to read that ~ as a 1's complement. Dave.