I like this! I think you are on the right track. And I agree 100% that the proper goal is to produce a better OO language than any available today. Perl has been falling behind the curve for too long now, and if we are going to revitalize the community we need to be jumping ahead rather than catching up.
The one part of the specification that worries me so far is that slot variables defined after the last :new slot variable in a class will be undefined when CONSTRUCT is called. It seems to me that "the last :new slot variable" is going to be a difficult thing to keep track of in large class definitions, where developers may be adding and removing :new from various declaration lines as development proceeds.
I suggest instead an additional attribute :after, such that slot variables with this attribute will not be defined until after CONSTRUCT is called. All other slot variables will be defined before CONSTRUCT is called, in the order defined. Specifying this explicitly rather than positionally will, I think, avoid a lot of confusion.
Well-known software developer specializing in large-scale database-driven web sites. Usually I use Perl. I speak at too many conferences. https://allaroundtheworld.fr/
Since this was posted, we've had a lot of discussion around CONSTRUCT and have since realized that as a phaser, it actually doesn't work since it needs to return a value. So we dropped it entirely. Now, we just use alternate constructors if we need to munge the arguments, or do validation in the ADJUST phaser.
Good, the implementation of CONSTRUCT as proposted on the current Wiki page bothered me a great deal. I agree that dropping it was a good choice. Can you point me to where these discussions are going on? I'd love to follow along and give my input where warranted.
Well-known software developer specializing in large-scale database-driven web sites. Usually I use Perl. I speak at too many conferences. https://allaroundtheworld.fr/
Largely they're on irc.perl.org on the #cor channel. Mostly it's pretty quiet right now because we've nailed down much of the behavior and the push to get the next version of Perl out the door is taking priority.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I like this! I think you are on the right track. And I agree 100% that the proper goal is to produce a better OO language than any available today. Perl has been falling behind the curve for too long now, and if we are going to revitalize the community we need to be jumping ahead rather than catching up.
The one part of the specification that worries me so far is that slot variables defined after the last :new slot variable in a class will be undefined when CONSTRUCT is called. It seems to me that "the last :new slot variable" is going to be a difficult thing to keep track of in large class definitions, where developers may be adding and removing :new from various declaration lines as development proceeds.
I suggest instead an additional attribute :after, such that slot variables with this attribute will not be defined until after CONSTRUCT is called. All other slot variables will be defined before CONSTRUCT is called, in the order defined. Specifying this explicitly rather than positionally will, I think, avoid a lot of confusion.
Since this was posted, we've had a lot of discussion around
CONSTRUCT
and have since realized that as a phaser, it actually doesn't work since it needs to return a value. So we dropped it entirely. Now, we just use alternate constructors if we need to munge the arguments, or do validation in theADJUST
phaser.Good, the implementation of CONSTRUCT as proposted on the current Wiki page bothered me a great deal. I agree that dropping it was a good choice. Can you point me to where these discussions are going on? I'd love to follow along and give my input where warranted.
Largely they're on irc.perl.org on the #cor channel. Mostly it's pretty quiet right now because we've nailed down much of the behavior and the push to get the next version of Perl out the door is taking priority.