On 17/11/15 20:38, Marc Bennewitz wrote:
> FYI there was a very small discussion about it ~ 1 year ago
> https://www.mail-archive.com/internals@lists.php.net/msg71521.html
And https://www.mail-archive.com/internals%40lists.php.net/msg61320.html
covered making properties read_only ...
--
Lester C
FYI there was a very small discussion about it ~ 1 year ago
https://www.mail-archive.com/internals@lists.php.net/msg71521.html
On 11/16/2015 10:15 AM, Chris Riley wrote:
Hi,
There has been a lot of interest recently (eg psr-7) in immutable data. I'm
considering putting an RFC together to add la
Andrea Faulds wrote on 17/11/2015 15:37:
Does it? You can write a five-line constructor which does what you need:
private function __construct(array $properties) {
foreach ($properties as $name => $value) {
$this->{$name} = $value;
}
}
You can do changes like
Mathieu Rochette wrote on 17/11/2015 13:40:
Indeed, maybe there is a use for a new language construct to help
reduce the boilerplate, but it could be done afterward, the
"everything in the constructor" works fine. If there is too much in
the construct it might be a sign that the class is doing
Hi,
Rowan Collins wrote:
Hi Andrea,
Andrea Faulds wrote on 17/11/2015 01:47:
Larry Garfield wrote:
The "everything in the constructor" is the problem. That results in,
essentially, an obscenely long function call that just happens to be
named __construct(). If I wanted something that obscur
On 17/11/2015 13:26, Lester Caine wrote:
On 17/11/15 11:04, Rowan Collins wrote:
If you look at the PSR-7 implementation I linked to earlier [1], there's
no such boilerplate, just a single call to "clone $this", and PHP does
it all for you. But that doesn't work with a simplistic definition of
On 17/11/15 11:04, Rowan Collins wrote:
> If you look at the PSR-7 implementation I linked to earlier [1], there's
> no such boilerplate, just a single call to "clone $this", and PHP does
> it all for you. But that doesn't work with a simplistic definition of
> immutable like "mutable in constructo
On 17 November 2015 at 11:04, Rowan Collins wrote:
> Hi Andrea,
>
> Andrea Faulds wrote on 17/11/2015 01:47:
>
>> Larry Garfield wrote:
>>
>>> The "everything in the constructor" is the problem. That results in,
>>> essentially, an obscenely long function call that just happens to be
>>> named _
Hi Andrea,
Andrea Faulds wrote on 17/11/2015 01:47:
Larry Garfield wrote:
The "everything in the constructor" is the problem. That results in,
essentially, an obscenely long function call that just happens to be
named __construct(). If I wanted something that obscure and hard to
work with I'd
Hello, internals!
We discussed this topic early, see this thread:
http://www.serverphorums.com/read.php?7,1123371,1124223 for any additional
thoughts and ideas. I want to attach a link to the Java draft of partial
immutability of objects:
http://cr.openjdk.java.net/~jrose/values/values-0.html, it'
On Tue, 17 Nov 2015, 02:07 Andrea Faulds wrote:
Hi,
Chris Riley wrote:
>
> There has been a lot of interest recently (eg psr-7) in immutable data.
I'm
> considering putting an RFC together to add language support for
immutables:
>
I wonder if immutable classes are really the right way to go. Im
Hi,
Chris Riley wrote:
There has been a lot of interest recently (eg psr-7) in immutable data. I'm
considering putting an RFC together to add language support for immutables:
I wonder if immutable classes are really the right way to go. Immutable
reference types with manual copying are some
Chris,
On Mon, Nov 16, 2015 at 4:15 AM, Chris Riley wrote:
> Hi,
>
> There has been a lot of interest recently (eg psr-7) in immutable data. I'm
> considering putting an RFC together to add language support for immutables:
>
> immutable class Foo {
> public $bar;
> public function __construct($ba
Hi Larry,
Larry Garfield wrote:
The "everything in the constructor" is the problem. That results in,
essentially, an obscenely long function call that just happens to be
named __construct(). If I wanted something that obscure and hard to
work with I'd just use anonymous arrays. :-)
Huh?
"wi
On 11/16/2015 04:15 AM, Chris Riley wrote:
Any thoughts?
Would love to have it for implementing value objects.
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
On 11/16/15 5:11 PM, Mathieu Rochette wrote:
On 11/16/2015 11:11 PM, Larry Garfield wrote:
On 11/16/15 3:15 AM, Chris Riley wrote:
Immutable on a property makes the property immutable once it takes on a
none null value. Attempts to modify the property after this results
in a
fatal error.
A
On Mon, Nov 16, 2015 at 2:15 AM, Chris Riley wrote:
> Hi,
>
> There has been a lot of interest recently (eg psr-7) in immutable data. I'm
> considering putting an RFC together to add language support for immutables:
>
> immutable class Foo {
> public $bar;
> public function __construct($bar) {
>
On 11/16/2015 11:11 PM, Larry Garfield wrote:
On 11/16/15 3:15 AM, Chris Riley wrote:
Hi,
There has been a lot of interest recently (eg psr-7) in immutable
data. I'm
considering putting an RFC together to add language support for
immutables:
immutable class Foo {
public $bar;
public funct
On 11/16/15 3:15 AM, Chris Riley wrote:
Hi,
There has been a lot of interest recently (eg psr-7) in immutable data. I'm
considering putting an RFC together to add language support for immutables:
immutable class Foo {
public $bar;
public function __construct($bar) {
$this->bar = $bar;
}
}
Immu
Mathieu Rochette wrote on 16/11/2015 10:00:
Would it be allowed to assign non immutable types to properties of an
immutable class ?
I think this is the trickiest part of trying to enforce immutability:
nesting. Consider the following:
// Basic properties
$my_immutable_object->foo = 42;
$my_i
2015-11-16 10:40 GMT+01:00 Chris Riley :
>
>
> On 16 November 2015 at 09:33, Lorenzo Fontana
> wrote:
>
>> I really like the concept of immutability, but I think that it should be
>> applicable at instance level rather than declaration.
>>
>> I would also prefer another keyword than immutable.
>
hi,
On 16/11/2015 10:33, Lorenzo Fontana wrote:
I really like the concept of immutability, but I think that it should be
applicable at instance level rather than declaration.
I'm not sure about that, most PHP code assume mutable objects, I doubt
much existing classes would be usable as immutab
On 16 November 2015 at 09:33, Lorenzo Fontana
wrote:
> I really like the concept of immutability, but I think that it should be
> applicable at instance level rather than declaration.
>
> I would also prefer another keyword than immutable.
>
> Final does not make the properties immutable, it mak
I really like the concept of immutability, but I think that it should be
applicable at instance level rather than declaration.
I would also prefer another keyword than immutable.
Final does not make the properties immutable, it makes the class not
extensible.
On Nov 16, 2015 10:24, "Daniel Perss
On 16 November 2015 at 09:24, Daniel Persson wrote:
> Any differance from the final keyword?
>
> http://php.net/manual/en/language.oop5.final.php
>
> On Mon, Nov 16, 2015 at 10:15 AM, Chris Riley wrote:
>
>> Hi,
>>
>> There has been a lot of interest recently (eg psr-7) in immutable data.
>> I'm
Any differance from the final keyword?
http://php.net/manual/en/language.oop5.final.php
On Mon, Nov 16, 2015 at 10:15 AM, Chris Riley wrote:
> Hi,
>
> There has been a lot of interest recently (eg psr-7) in immutable data. I'm
> considering putting an RFC together to add language support for im
26 matches
Mail list logo