[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: boolean operators
- From: David Given <dg@...>
- Date: Thu, 28 Sep 2006 22:46:58 +0000
Nick Gammon wrote:
[...]
> Thanks to this tip, you can coerce strings into numbers right now,
> rather clumsily:
>
> arg = "5"
> print (- -arg) --> 5
I may be missing something intrinsic, but:
arg = "5"
print (arg+0)
Likewise, some compiler sugar to convert to treat '+a' as '0+a' would be
easy, not involve any additional opcodes, and would optimise away to
nothing in most cases.
--
David Given
dg@cowlark.com
- References:
- Re: boolean operators, David Jones
- Re: boolean operators, Rici Lake
- Re: boolean operators, Glenn Maynard
- Re: boolean operators, Greg Falcon
- Re: boolean operators, Glenn Maynard
- Re: boolean operators, Rici Lake
- Re: boolean operators, Glenn Maynard
- Re: boolean operators, Rici Lake
- Re: boolean operators, Glenn Maynard
- Re: boolean operators, Rici Lake
- Re: boolean operators, Glenn Maynard
- Re: boolean operators, David Jones
- Re: boolean operators, Nick Gammon