Re: Supporting Binary Notation for Integers
| From: | Larry Garfield | Date: | Thu, 11 Nov 2010 02:29:49 +0000 |
| Subject: | Re: Supporting Binary Notation for Integers | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-50138@lists.php.net to get a copy of this message | ||
On Wednesday, November 10, 2010 5:46:50 pm Matthew Fonda wrote:
> On Wed, Nov 10, 2010 at 2:51 PM, Gustavo Lopes <glopes@nebm.ist.utl.pt>
wrote:
> > On Wed, 10 Nov 2010 21:31:19 -0000, Jonah H. Harris
> > <jonah.harris@gmail.com>
> >
> > wrote:
> >> Hey all,
> >>
> >> I was recently working on some code which made use of bit arrays and I
> >> came across feature request 50648: Format for binary numbers. While
> >> it's just
> >> more syntactic sugar (0b11111011010 vs 2010/0x7da/03732), it doesn't
> >> seem like too bad of an idea and it is also supported by a few other
> >> languages. If there's any interest, I'll clean up the patch and
> >> resubmit.
> >
> > I think it's a good idea.
> >
> > It won't spark interest in those that have already memorized the more
> > compact hexadecimal representation of nibbles, but otherwise it's useful
> > a simple non-BC breaking addition.
>
> Agreed. I have often thought this would be useful.
>
> Best regards,
> --Matthew
Especially given how common it is to use hex constants as bit flags, being
able to define them in binary to begin with would help readability. (Yes, I
just said "writing in binary" would "help readability." God help us all.
<g>)
+1
--Larry Garfield