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.
Thoughts?
--
Jonah H. Harris
Blog: http://www.oracle-internals.com/
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.
--
Gustavo Lopes
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
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.comwrote:
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
On Wed, Nov 10, 2010 at 9:29 PM, Larry Garfield larry@garfieldtech.comwrote:
On Wed, Nov 10, 2010 at 2:51 PM, Gustavo Lopes glopes@nebm.ist.utl.pt
wrote: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>)
;-)
Cool. I'll put together an updated patch.
--
Jonah H. Harris
Blog: http://www.oracle-internals.com/
On Wed, Nov 10, 2010 at 10:19 PM, Jonah H. Harris jonah.harris@gmail.comwrote:
Cool. I'll put together an updated patch.
Source and documentation patches have been attached to the ticket.
--
Jonah H. Harris
Blog: http://www.oracle-internals.com/
On Wed, Nov 10, 2010 at 10:19 PM, Jonah H. Harrisjonah.harris@gmail.comwrote:
Cool. I'll put together an updated patch.
Source and documentation patches have been attached to the ticket.
Don't forget to write a (brief) RFC on http://wiki.php.net/rfc
Chris
--
Email: christopher.jones@oracle.com
Tel: +1 650 506 8630
Blog: http://blogs.oracle.com/opal/
On Thu, Nov 11, 2010 at 12:02 PM, Christopher Jones <
christopher.jones@oracle.com> wrote:
On Wed, Nov 10, 2010 at 10:19 PM, Jonah H. Harris<jonah.harris@gmail.com
wrote:
Cool. I'll put together an updated patch.
Source and documentation patches have been attached to the ticket.
Don't forget to write a (brief) RFC on http://wiki.php.net/rfc
Will do. Thanks for the info.
--
Jonah H. Harris
Blog: http://www.oracle-internals.com/
2010/11/11 Jonah H. Harris jonah.harris@gmail.com:
On Thu, Nov 11, 2010 at 12:02 PM, Christopher Jones <
christopher.jones@oracle.com> wrote:On Wed, Nov 10, 2010 at 10:19 PM, Jonah H. Harris<jonah.harris@gmail.com
wrote:
Cool. I'll put together an updated patch.
Source and documentation patches have been attached to the ticket.
Don't forget to write a (brief) RFC on http://wiki.php.net/rfc
Will do. Thanks for the info.
--
Jonah H. Harris
Blog: http://www.oracle-internals.com/
+1
It would definitely be a great addition!
Looking forward to read the rfc.
--
Patrick Allaert
http://code.google.com/p/peclapm/ - Alternative PHP Monitor
+1 here.
Just want to make sure the RFC is written and discussed before the patch is
submitted.
On Thu, Nov 11, 2010 at 11:20 AM, Patrick ALLAERT patrickallaert@php.netwrote:
2010/11/11 Jonah H. Harris jonah.harris@gmail.com:
On Thu, Nov 11, 2010 at 12:02 PM, Christopher Jones <
christopher.jones@oracle.com> wrote:On Wed, Nov 10, 2010 at 10:19 PM, Jonah H. Harris<
jonah.harris@gmail.comwrote:
Cool. I'll put together an updated patch.
Source and documentation patches have been attached to the ticket.
Don't forget to write a (brief) RFC on http://wiki.php.net/rfc
Will do. Thanks for the info.
--
Jonah H. Harris
Blog: http://www.oracle-internals.com/+1
It would definitely be a great addition!
Looking forward to read the rfc.--
Patrick Allaerthttp://code.google.com/p/peclapm/ - Alternative PHP Monitor
--
--
Thanks,
Will Fitch
Director of Operations | Quepasa.com
931.205.8242 | will.fitch@quepasacorp.com
Twitter: twitter.com/willfitch
On Thu, Nov 11, 2010 at 12:22 PM, Will Fitch will.fitch@quepasacorp.comwrote:
+1 here.
Just want to make sure the RFC is written and discussed before the patch is
submitted.
I just registered for Wiki access and am waiting for the account to be
approved. As soon as it is, I'll submit the RFC.
--
Jonah H. Harris
Blog: http://www.oracle-internals.com/
On Thu, Nov 11, 2010 at 12:22 PM, Will Fitch will.fitch@quepasacorp.comwrote:
+1 here.
Just want to make sure the RFC is written and discussed before the patch is
submitted.I just registered for Wiki access and am waiting for the account to be
approved. As soon as it is, I'll submit the RFC.
Done, you now access to the RFC namespace. Have fun :)
Regards,
Philip
I just registered for Wiki access and am waiting for the account to be
approved. As soon as it is, I'll submit the RFC.Done, you now access to the RFC namespace. Have fun :)
Awesome! Thanks.
--
Jonah H. Harris
Blog: http://www.oracle-internals.com/
On Thu, Nov 11, 2010 at 3:57 PM, Jonah H. Harris jonah.harris@gmail.comwrote:
I just registered for Wiki access and am waiting for the account to be
approved. As soon as it is, I'll submit the RFC.Done, you now access to the RFC namespace. Have fun :)
Awesome! Thanks.
RFC added. I'm not sure what the protocol for RFCs is, but I put it under
the In Discussion heading. Sorry if I was wrong.
http://wiki.php.net/rfc/binnotation4ints
http://wiki.php.net/rfc/binnotation4ints
Jonah H. Harris
Blog: http://www.oracle-internals.com/
Simple enough - I'm game with that.
+1
On Thu, Nov 11, 2010 at 4:23 PM, Jonah H. Harris jonah.harris@gmail.comwrote:
On Thu, Nov 11, 2010 at 3:57 PM, Jonah H. Harris jonah.harris@gmail.comwrote:
On Thu, Nov 11, 2010 at 3:55 PM, Philip Olson philip@roshambo.orgwrote:
I just registered for Wiki access and am waiting for the account to be
approved. As soon as it is, I'll submit the RFC.Done, you now access to the RFC namespace. Have fun :)
Awesome! Thanks.
RFC added. I'm not sure what the protocol for RFCs is, but I put it under
the In Discussion heading. Sorry if I was wrong.http://wiki.php.net/rfc/binnotation4ints
http://wiki.php.net/rfc/binnotation4ints
Jonah H. Harris
Blog: http://www.oracle-internals.com/
--
Thanks,
Will Fitch
Director of Operations | Quepasa.com
931.205.8242 | will.fitch@quepasacorp.com
Twitter: twitter.com/willfitch
2010/11/11 Jonah H. Harris jonah.harris@gmail.com:
RFC added. I'm not sure what the protocol for RFCs is, but I put it under
the In Discussion heading. Sorry if I was wrong.http://wiki.php.net/rfc/binnotation4ints
http://wiki.php.net/rfc/binnotation4ints
Jonah H. Harris
Blog: http://www.oracle-internals.com/
+1 for trunk
--
regards,
Kalle Sommer Nielsen
kalle@php.net
On Thu, Nov 11, 2010 at 3:57 PM, Jonah H. Harrisjonah.harris@gmail.comwrote:
I just registered for Wiki access and am waiting for the account to be
approved. As soon as it is, I'll submit the RFC.Done, you now access to the RFC namespace. Have fun :)
Awesome! Thanks.
RFC added. I'm not sure what the protocol for RFCs is, but I put it under
the In Discussion heading. Sorry if I was wrong.
What languages are supporting this? (Besides PHP.) I'm not adverse to
the feature but if you say other languages are doing this on the RFC
page, please provide links to the relevant documentation of those
languages. Google is not being helpful - mostly just turns up this
particular discussion thread and Wikipedia:
http://en.wikipedia.org/wiki/Binary_numeral_system
Mentions the notation briefly as being "common in programming languages"
but then fails to list relevant programming languages (Wikipedia
reference fail). I've never seen the option to do this in ANY
programming language I have ever used. But I have definitely wanted
such a feature on a few occasions.
+1 for the feature and setting a new standard with an approach that
makes sense.
--
Thomas Hruska
CubicleSoft President
Barebones CMS is a high-performance, open source content management
system for web developers operating in a team environment.
An open source CubicleSoft initiative.
Your choice of a MIT or LGPL license.
On Thu, Nov 11, 2010 at 9:55 PM, Thomas Hruska thruska@cubiclesoft.comwrote:
On Thu, Nov 11, 2010 at 3:57 PM, Jonah H. Harris<jonah.harris@gmail.com
wrote:
On Thu, Nov 11, 2010 at 3:55 PM, Philip Olsonphilip@roshambo.org
wrote:
I just registered for Wiki access and am waiting for the account to be
approved. As soon as it is, I'll submit the RFC.
Done, you now access to the RFC namespace. Have fun :)
Awesome! Thanks.
RFC added. I'm not sure what the protocol for RFCs is, but I put it under
the In Discussion heading. Sorry if I was wrong.
+1 for trunk
What languages are supporting this? (Besides PHP.) I'm not adverse to the
feature but if you say other languages are doing this on the RFC page,
please provide links to the relevant documentation of those languages.
http://docs.python.org/dev/whatsnew/2.6.html#pep-3127-integer-literal-support-and-syntax
http://rosettacode.org/wiki/Literals/Integer#Clojure
http://rosettacode.org/wiki/Literals/Integer#Common_Lisp
http://rosettacode.org/wiki/Literals/Integer#D
http://rosettacode.org/wiki/Literals/Integer#OCaml
etc.
Adam
--
Nephtali: PHP web framework that functions beautifully
http://nephtaliproject.com
On Thu, Nov 11, 2010 at 3:57 PM, Jonah H.
Harrisjonah.harris@gmail.comwrote:On Thu, Nov 11, 2010 at 3:55 PM, Philip Olsonphilip@roshambo.org
wrote:I just registered for Wiki access and am waiting for the account to be
approved. As soon as it is, I'll submit the RFC.Done, you now access to the RFC namespace. Have fun :)
Awesome! Thanks.
RFC added. I'm not sure what the protocol for RFCs is, but I put it under
the In Discussion heading. Sorry if I was wrong.What languages are supporting this? (Besides PHP.) I'm not adverse to
the feature but if you say other languages are doing this on the RFC
page, please provide links to the relevant documentation of those
languages. Google is not being helpful - mostly just turns up this
particular discussion thread and Wikipedia:http://en.wikipedia.org/wiki/Binary_numeral_system
Mentions the notation briefly as being "common in programming languages"
but then fails to list relevant programming languages (Wikipedia
reference fail). I've never seen the option to do this in ANY
programming language I have ever used. But I have definitely wanted such
a feature on a few occasions.+1 for the feature and setting a new standard with an approach that
makes sense.
Ah. Finally found something via Google. An ISO C99 extension not a
part of ANSI C++ but accepted by GCC even in C++ mode. Learned
something new today.
http://gcc.gnu.org/onlinedocs/gcc/Binary-constants.html
http://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html
Hmm...now I'm wondering which is more correct: The phrase 'binary
literal constants', 'binary constants', 'binary literals', or 'binary
notation'? (Rhetorical).
--
Thomas Hruska
CubicleSoft President
Barebones CMS is a high-performance, open source content management
system for web developers operating in a team environment.
An open source CubicleSoft initiative.
Your choice of a MIT or LGPL license.
On Thu, Nov 11, 2010 at 11:07 PM, Thomas Hruska thruska@cubiclesoft.comwrote:
What languages are supporting this? (Besides PHP.) I'm not adverse to
the feature but if you say other languages are doing this on the RFC
page, please provide links to the relevant documentation of those
languages.Ah. Finally found something via Google. An ISO C99 extension not a part
of ANSI C++ but accepted by GCC even in C++ mode. Learned something new
today.
RFC updated with links to GCC, Python, and Ruby syntax definitions.
--
Jonah H. Harris
Blog: http://www.oracle-internals.com/
On Fri, Nov 12, 2010 at 12:10 PM, Jonah H. Harris jonah.harris@gmail.comwrote:
RFC updated with links to GCC, Python, and Ruby syntax definitions.
I just noticed the patch (written against 5.3) doesn't apply cleanly to
trunk and will be updating that shortly. In that same vein, I wanted to
confirm whether the process for all "new functionality" is to provide a
patch for trunk-only, or trunk+ back-ports?
--
Jonah H. Harris
Blog: http://www.oracle-internals.com/
On Mon, Nov 15, 2010 at 12:07 PM, Jonah H. Harris jonah.harris@gmail.comwrote:
On Fri, Nov 12, 2010 at 12:10 PM, Jonah H. Harris jonah.harris@gmail.comwrote:
RFC updated with links to GCC, Python, and Ruby syntax definitions.
I just noticed the patch (written against 5.3) doesn't apply cleanly to
trunk and will be updating that shortly. In that same vein, I wanted to
confirm whether the process for all "new functionality" is to provide a
patch for trunk-only, or trunk+ back-ports?
I've posted a replacement of the 5.3 patch with one against trunk. I'm
working on a project that seems to consume all of my time, so sorry for the
delay.
--
Jonah H. Harris
Blog: http://www.oracle-internals.com/
I've posted a replacement of the 5.3 patch with one against trunk.
+1
Regards,
Mike
+1, next major version.
Just following up on this patch from Nov 2010. Has there been any movement
on this? As it's not committed, I was just wondering what the next major
version would be PHP 5.4, 6, ? As always, I'm happy to provide patch
updates/modifications on request.
Thank you for your time!
--
Jonah H. Harris
Blog: http://www.oracle-internals.com/
+1, next major version.
Just following up on this patch from Nov 2010. Has there been any movement
on this? As it's not committed, I was just wondering what the next major
version would be PHP 5.4, 6, ? As always, I'm happy to provide patch
updates/modifications on request.Thank you for your time!
--
Jonah H. Harris
Blog: http://www.oracle-internals.com/
whats the status of this?
should we create a formal vote in the wiki?
--
Ferenc Kovács
@Tyr43l - http://tyrael.hu
whats the status of this?
should we create a formal vote in the wiki?
The status of binary notation for integers? Did you miss it?
Yes, there was a vote, and yes the feature is already in alpha3 which
was released last week.
https://wiki.php.net/rfc/binnotation4ints
http://svn.php.net/viewvc?view=revision&revision=313756
-Rasmus
whats the status of this?
should we create a formal vote in the wiki?The status of binary notation for integers? Did you miss it?
Yes, there was a vote, and yes the feature is already in alpha3 which
was released last week.
yeah, I missed it in the mass vote, and the rfc still listed it under voting.
https://wiki.php.net/rfc/binnotation4ints
http://svn.php.net/viewvc?view=revision&revision=313756
https://wiki.php.net/rfc/binnotation4ints?do=diff&rev2%5B0%5D=1302087566&rev2%5B1%5D=
https://wiki.php.net/rfc?do=diff&rev2%5B0%5D=1312628925&rev2%5B1%5D=1312629022
but thanks anyway. :)
--
Ferenc Kovács
@Tyr43l - http://tyrael.hu
-1
I don't think this is necessary.
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.Thoughts?
--
Jonah H. Harris
Blog: http://www.oracle-internals.com/
-1
I don't think this is necessary.
It's certainly not necessary; it's a nice to have. Given the small amount
of code required to implement the functionality, I believe it's worthwhile
to add the notation as an option for developers to use.
--
Jonah H. Harris
Blog: http://www.oracle-internals.com/