Dear internals,
I really like the way Nikita describes the implementation. It is very
consistent and easy to read. At least for me it is.
I must say I'm very excited to see this implementation coming to PHP
Kind regards,
Chris van Dam
Op 20-10-12 11:52 schreef Nikita Popov :
>On Sat, Oct 20,
, anyone disagree?
>
> > -Original Message-
> > From: Levi Morrison [mailto:morrison.l...@gmail.com]
> > Sent: Sunday, October 21, 2012 10:26 AM
> > To: Amaury Bouchard
> > Cc: Nikita Popov; Clint Priest; internals@lists.php.net
> > Subject: Re: [PHP-DEV] [
2012/10/21 Levi Morrison
> I would like to point out that in my mind `const` and `read-only` are
> not necessarily the same thing. Read-only means that from outside the
> class it cannot be modified; the internal class can change it whenever
> it wants. Const means that once the value is set it
Subject: Re: [PHP-DEV] [RFC] Accessors : read-only / write-only keywords
>
> > If for some reason you need to enforce that nobody inherits it and
> > sets the property, then declaring a setter and issuing an error or
> > exception would suffice.
>
> I meant to say de
> If for some reason you need to enforce that nobody inherits it
> and sets the property, then declaring a setter and issuing an
> error or exception would suffice.
I meant to say declaring a `private or final setter`. Noticed that
after I sent it.
--
PHP Internals - PHP Runtime Development Mai
I would like to point out that in my mind `const` and `read-only` are
not necessarily the same thing. Read-only means that from outside the
class it cannot be modified; the internal class can change it whenever
it wants. Const means that once the value is set it will NEVER change.
Big difference.
On 20-10-2012 19:20, Clint Priest wrote:> Hey Rasmus, please try and
keep these replies in the appropriate thread...
>
> I am in favor of eliminating the read-only/write-only keywords and
implementing no "special code" to make what was read-only/write-only
language enforced. I think the altern
On Sat, Oct 20, 2012 at 12:09 PM, Lester Caine wrote:
>
> I am in favor of eliminating the read-only/write-only keywords and
>> implementing no "special code" to make what was read-only/write-only
>> language enforced. I think the alternatives with final are just fine and
>> good enough and wil
Clint Priest wrote:
Hey Rasmus, please try and keep these replies in the appropriate thread...
And bottom post please ...
I am in favor of eliminating the read-only/write-only keywords and implementing no
"special code" to make what was read-only/write-only language enforced. I
think the al
Hey Rasmus, please try and keep these replies in the appropriate thread...
I am in favor of eliminating the read-only/write-only keywords and implementing
no "special code" to make what was read-only/write-only language enforced. I
think the alternatives with final are just fine and good enough
2012/10/20 Derick Rethans
> There is nothing wrong with being verbose. PHP has always been verbose,
> which IMO is a strong point of the language as it makes everything a lot
> easier to search for.
>
There is a confusion between being verbose and being explicit.
PHP syntax is explicit. Verbosit
Hi!
> Class A created property accessor $z that you can not set. Class B can
> extend me just fine, but they can not alter that basic rule that I laid
> out for my and all my children's property accessor $z: You can not set it.
I'm fine with the idea of methods that are not overrideable, even th
2012/10/20 Nikita Popov
> Could you maybe explain where exactly "const" would be used?
>
Well "const" and "read-only" have the exact same meaning. You can replace
one by the other. So why create a new keyword?
> Please
> don't forget that we do not use your "foo:bar" syntax, so where would
>
Nikita brought up a good point:
There aren't all that many scripts that use final methods, which could very
well be the same fate for final property accessor methods.
Due to the very possible unpopularity of whatever magic syntax/keyword we
could potentially come up with, we *could *alternatively
Nikita, there appears to be a slight misunderstanding. You're initial email
was worded in a way that I presumed you were attacking the final keyword
entirely, not just final methods. You are correct in that many PHP
frameworks don't have final *functions*.
My pushing for the read-only functionalit
On Sat, Oct 20, 2012 at 1:07 AM, Clint Priest wrote:
> I had thought of a deviation on some of the ideas presented to get rid of
> read-only/write-only while still keeping the ability to maintain their
> effect, if we so decide that the feature is wanted. Here it is:
>
> class TimePeriod {
>
On Sat, Oct 20, 2012 at 11:31 AM, Jazzer Dane wrote:
> The final keyword is used, especially in sizable OOP applications. Claiming
> it supposedly isn't used very often anymore - even if it were true - is not
> an excuse to exclude the "read-only"-esque functionality in this RFC.
Firstly, I didn't
I'll agree with you in regards to your analysis of Clint's proposed syntax.
In terms of your questioning the idea around "read-only", this is how I
think about it:
Class A created property accessor $z that you can not set. Class B can
extend me just fine, but they can not alter that basic rule th
Hi!
> get() { return $this->Hours; }
> final set NULL;
It looks like some unobvious piece of magic - what exactly "set NULL"
means? There's no obvious parsing of this thing for somebody that
doesn't already know what the magic means. I'd rather have people
implement a method throw
The usage of the syntax in C# is moderately unimportant. This is a
different language, and property accessors are part of numerous languages -
not just C#. That being said, it's not that big of a deal, as it seems that
most people are in a consensus that we do not want to to be adding any sort
of r
On Sat, 20 Oct 2012, Amaury Bouchard wrote:
> read-only => final set null;
> It begins to be verbose.
There is nothing wrong with being verbose. PHP has always been verbose,
which IMO is a strong point of the language as it makes everything a lot
easier to search for.
cheers,
Derick
--
ht
On Sat, Oct 20, 2012 at 9:29 AM, Amaury Bouchard wrote:
> read-only => final set null;
> It begins to be verbose.
>
> As I said many times, why don't you want to use the "const" keyword? It
> already exists and is pretty well understood by everybody.
Could you maybe explain where exactly "const"
read-only => final set null;
It begins to be verbose.
As I said many times, why don't you want to use the "const" keyword? It
already exists and is pretty well understood by everybody.
2012/10/20 Clint Priest
> I had thought of a deviation on some of the ideas presented to get rid of
> read
23 matches
Mail list logo