[PHP-DEV] Re: Extension: arbitrary precision decimal arithmetic in PHP 7

2018-10-26 Thread Rudi Theunissen
Hi Benjamin, Brick\Math looks awesome. I really like the static initializers and descriptive method names. I recognize some of the patterns from OpenJDK's BigDecimal source. :) The major difference to me is scale vs precision, ie. number of significant digits vs number of digits behind the

Re: [PHP-DEV] Extension: arbitrary precision decimal arithmetic in PHP 7

2018-10-26 Thread Rudi Theunissen
Hi everyone, I've made some good progress on this project and I would love for someone to review it for me? I want to learn as much as I can to produce something as good as possible. if you are curious to see it in action first, there is a sandbox here: http://php-decimal.io/#sandbox Source is

Re: [PHP-DEV] Idea for better function callbacks (another syntactic sugar)

2018-10-26 Thread Kalle Sommer Nielsen
Den fre. 26. okt. 2018 kl. 18.03 skrev Levi Morrison : > In my opinion "ideal" here is that our symbol tables are merged, so > referring to "trim" in any context will resolve to at most one symbol, > *and* that we also have a short-closure syntax for times when there > isn't a *perfect* function

Re: [PHP-DEV] Idea for better function callbacks (another syntactic sugar)

2018-10-26 Thread Crocodile
Sorry for a bunch of replies that simply have lost a lot of context.. I'll try to summarize it all here: > I believe the proposal for short lambas (which should get resurrected at some > point) would handle this case well enough as well as help a dozen other > things. To wit: > >

Re: [PHP-DEV] Idea for better function callbacks (another syntactic sugar)

2018-10-26 Thread Crocodile
My proposal would not work for methods. function::CustomClass::someMethod - that doesn't look great at all, at least to me. On Fri, Oct 26, 2018 at 6:08 PM David Rodrigues wrote: > Em sex, 26 de out de 2018 às 09:30, Crocodile > escreveu: > > > Hi internals! > > > > I have this idea of

Re: [PHP-DEV] Idea for better function callbacks (another syntactic sugar)

2018-10-26 Thread Crocodile
Yeah, that was part of the idea, the other being to make these callbacks semantically different from strings. Its just weird that a string is callable, isn't it? On Fri, Oct 26, 2018 at 6:03 PM Arvids Godjuks wrote: > пт, 26 окт. 2018 г. в 18:57, Kalle Sommer Nielsen : > > > Den fre. 26. okt.

Re: [PHP-DEV] Idea for better function callbacks (another syntactic sugar)

2018-10-26 Thread Crocodile
That sounds like a plan, and if there is a reasonable support for that, then we could just have array_filter($arr, trim) - then its way better than my proposal, and should also work with class methods. On Fri, Oct 26, 2018 at 6:03 PM Levi Morrison wrote: > On Fri, Oct 26, 2018 at 9:57 AM Kalle

Re: [PHP-DEV] Idea for better function callbacks (another syntactic sugar)

2018-10-26 Thread Crocodile
I don't think it's quite the same, and although I can agree that short lambdas look better then normal in this context, I would still prefer function::trim On Fri, Oct 26, 2018 at 5:42 PM Larry Garfield wrote: > On Friday, October 26, 2018 7:29:46 AM CDT Crocodile wrote: > > Hi internals! > > >

Re: [PHP-DEV] Idea for better function callbacks (another syntactic sugar)

2018-10-26 Thread Benjamin Morel
> > In my opinion "ideal" here is that our symbol tables are merged > I would love to see this as well, as this would make the language much more consistent. Would this allow to array_filter($names, trim), though?

Re: [PHP-DEV] Idea for better function callbacks (another syntactic sugar)

2018-10-26 Thread David Rodrigues
Em sex, 26 de out de 2018 às 09:30, Crocodile escreveu: > Hi internals! > > I have this idea of improving the way to specify callbacks for good old PHP > functions. For instance, I have this piece of code: > > --- > array_filter($names, 'trim') > --- > > The callback

Re: [PHP-DEV] Idea for better function callbacks (another syntactic sugar)

2018-10-26 Thread Arvids Godjuks
пт, 26 окт. 2018 г. в 18:57, Kalle Sommer Nielsen : > Den fre. 26. okt. 2018 kl. 17.43 skrev Larry Garfield < > la...@garfieldtech.com>: > > I believe the proposal for short lambas (which should get resurrected at > some > > point) would handle this case well enough as well as help a dozen other

Re: [PHP-DEV] Idea for better function callbacks (another syntactic sugar)

2018-10-26 Thread Levi Morrison
On Fri, Oct 26, 2018 at 9:57 AM Kalle Sommer Nielsen wrote: > > Den fre. 26. okt. 2018 kl. 17.43 skrev Larry Garfield > : > > I believe the proposal for short lambas (which should get resurrected at > > some > > point) would handle this case well enough as well as help a dozen other > > things.

Re: [PHP-DEV] Idea for better function callbacks (another syntactic sugar)

2018-10-26 Thread Kalle Sommer Nielsen
Den fre. 26. okt. 2018 kl. 17.43 skrev Larry Garfield : > I believe the proposal for short lambas (which should get resurrected at some > point) would handle this case well enough as well as help a dozen other > things. To wit: > > array_filter($names, |$x| ==> trim($x)) I still fail to see why

Re: [PHP-DEV] Idea for better function callbacks (another syntactic sugar)

2018-10-26 Thread Larry Garfield
On Friday, October 26, 2018 7:29:46 AM CDT Crocodile wrote: > Hi internals! > > I have this idea of improving the way to specify callbacks for good old PHP > functions. For instance, I have this piece of code: > > --- > array_filter($names, 'trim') > --- > > The callback

[PHP-DEV] Idea for better function callbacks (another syntactic sugar)

2018-10-26 Thread Crocodile
Hi internals! I have this idea of improving the way to specify callbacks for good old PHP functions. For instance, I have this piece of code: --- array_filter($names, 'trim') --- The callback function name is specified as a string, which makes it not-so-obvious, although