Re: subtyping parameterized types
Excerpts from John Napiorkowski's message of Thu Sep 03 21:08:44 -0400 2009: > > This surprised me, and means that Native::Trait::Array/Hash totally don't > > work > > with subtypes of parameterized types. > > As I said, this was the best idea we could come up with without any real use > cases. Seems we have one now :) Oh, the fact that the Native stuff doesn't work is a bug there, not in the TypeConstraint code. I think the TC code makes sense. (Florian disagrees, but he's a cantankerous German, and their opinions cannot be trusted.) hdp.
Re: subtyping parameterized types
Hans, sorry I duped you on this message. - Original Message > From: Hans Dieter Pearcey > To: moose > Sent: Thursday, September 3, 2009 8:52:02 PM > Subject: subtyping parameterized types > > subtype Foo, as ArrayRef[Str], where { @$_ < 5 }; > > Foo is now a parameteriz*able* type, not a parameteriz*ed* type; that is, > in theory (if the MooseX::Types decorators allow it), you can: > > has foo_classes => (isa => Foo[ClassName]); > > since ClassName is a subtype of Str. > > This surprised me, and means that Native::Trait::Array/Hash totally don't work > with subtypes of parameterized types. We had a discussion about this a while back when I was adding parameterization support to MooseX::Types. I think this was a least of evils, let's punt until we really understand what we want. I duplicated the behavior for MooseX::Types::Structured, btw, you can reparamterize a structured type as long as you don't contradict the existing type. I took a similar approach to the stuff in the repo under MooseX::Dependent. As I said, this was the best idea we could come up with without any real use cases. Seems we have one now :) > > I'm poking at this now. Any insight is welcome. > > hdp.
Re: subtyping parameterized types
Excerpts from Hans Dieter Pearcey's message of Thu Sep 03 20:52:02 -0400 2009: > subtype Foo, as ArrayRef[Str], where { @$_ < 5 }; > > Foo is now a parameteriz*able* type, not a parameteriz*ed* type; that is, > in theory (if the MooseX::Types decorators allow it), you can: > > has foo_classes => (isa => Foo[ClassName]); See topic/subtype-of-parameterizable for what I'm pretty sure is a bug relating to this. hdp.
subtyping parameterized types
subtype Foo, as ArrayRef[Str], where { @$_ < 5 }; Foo is now a parameteriz*able* type, not a parameteriz*ed* type; that is, in theory (if the MooseX::Types decorators allow it), you can: has foo_classes => (isa => Foo[ClassName]); since ClassName is a subtype of Str. This surprised me, and means that Native::Trait::Array/Hash totally don't work with subtypes of parameterized types. I'm poking at this now. Any insight is welcome. hdp.
Re: Fwd: Specifying exact type
Excerpts from Yuri Shtil's message of Thu Sep 03 19:08:17 -0400 2009: > What is wrong in excluding some of the derived classes from a subtype > definition? Like Chris said: > > One of the main points to object orientation is Subtype Polymorphism > > ... meaning derived classes can be substituted for main classes, why > > would you want to throw that away? So, it breaks a fundamental part of OO. That's what's wrong with it. > It has nothing to do with inheritance/Polymorphism. I just want to limit > what can be saved in the attribute. "Officer, I'm not driving under the influence, I just had a few beers and now I'm operating this vehicle." Subclasses that have less functionality than their superclasses are almost always a design smell. Maybe part of your superclass should actually be a role? I'm sure that if you wanted to give more specifics, people would be willing to help look for a solution to your problem that is less likely to bite you later. hdp.
Re: Fwd: Specifying exact type
Chris Prather wrote: I missed the list ... why doesn't google to reply to all anymore? *sigh* -- Forwarded message -- From: Chris Prather Date: Thu, Sep 3, 2009 at 5:10 PM Subject: Re: Specifying exact type To: Jesse Luehrs On Thu, Sep 3, 2009 at 4:41 PM, Jesse Luehrs wrote: On Thu, Sep 03, 2009 at 01:33:58PM -0700, Yuri Shtil wrote: If I say isa => 'Class', then it will include all derived classes. How do I exclude derived classes? Do I need a subtype like: subtype TopClassOnly => as 'Class' => where {blessed($_) eq 'Class'}; First of all, don't do that, and second of all, yes. -doy I think Jesse means "Why would you want to exclude derived classes? One of the main points to object orientation is Subtype Polymorphism ... meaning derived classes can be substituted for main classes, why would you want to throw that away?" and "Yes if you insist on shooting yourself in teh foot, that is the proper way to take aim." -Chris I am confused with "First of all, don't do that". What is wrong in excluding some of the derived classes from a subtype definition? It has nothing to do with inheritance/Polymorphism. I just want to limit what can be saved in the attribute. -- Yuri
Fwd: Specifying exact type
I missed the list ... why doesn't google to reply to all anymore? *sigh* -- Forwarded message -- From: Chris Prather Date: Thu, Sep 3, 2009 at 5:10 PM Subject: Re: Specifying exact type To: Jesse Luehrs On Thu, Sep 3, 2009 at 4:41 PM, Jesse Luehrs wrote: > On Thu, Sep 03, 2009 at 01:33:58PM -0700, Yuri Shtil wrote: >> If I say isa => 'Class', then it will include all derived classes. >> How do I exclude derived classes? >> >> Do I need a subtype like: >> >> subtype TopClassOnly => as 'Class' => where {blessed($_) eq 'Class'}; > > First of all, don't do that, and second of all, yes. > > -doy > I think Jesse means "Why would you want to exclude derived classes? One of the main points to object orientation is Subtype Polymorphism ... meaning derived classes can be substituted for main classes, why would you want to throw that away?" and "Yes if you insist on shooting yourself in teh foot, that is the proper way to take aim." -Chris
Re: Towards a New Moose Website
Oh well, scratch that one off the list. - Stevan On Sep 3, 2009, at 4:38 PM, Dave Rolsky wrote: On Thu, 3 Sep 2009, Stevan Little wrote: On Sep 3, 2009, at 4:25 PM, Dave Rolsky wrote: On Thu, 3 Sep 2009, Stevan Little wrote: I am not looking for sponsorship, endorsement or anything official, just like to be able to point out to people who ask (like this guy on perlmonks -> http://www.perlmonks.org/index.pl?node_id=793076) . Here is a short list of companies I already know about: Yahoo!, Symatec, IMDB, Pobox, Best Practical, Shadowcat, ValueClick, Magazines.com, Reuters, Takkle.com, BBC, Hearst Publishing, Omni Hotels, YouPorn and SocialText That's Thomson Reuters, but I don't know of any Moose-using code here. If there is, it's well-hidden. Wait, I thought you were using Fey at Reuters? Haha. Getting a new module in use here is near impossible. -dave /* http://VegGuide.org http://blog.urth.org Your guide to all that's veg House Absolute(ly Pointless) */
Re: Towards a New Moose Website
On Sep 3, 2009, at 5:04 PM, Chris Prather wrote: On Thu, Sep 3, 2009 at 3:45 PM, Stevan Little wrote: So, when next I have a dose of free time (which hopefully will be later this month) I want to revise the Moose website. As Gabor pointed out (http://szabgab.com/blog/2009/08/1251583673.html), what is there now is not very organized and difficult to wade through. As Moose gets more popular the lack of a clean and organized website is a stumbling block for people. So, I have some questions to ask of the greater Moose community to help me put together more information. 1) What companies are using Moose? Yahoo!, Symatec, IMDB, Pobox, Best Practical, Shadowcat, ValueClick, Magazines.com, Reuters, Takkle.com, BBC, Hearst Publishing, Omni Hotels, YouPorn and SocialText Hearst Publishing? Do you mean Hearst as in Patty Hearst or Harris Design (now HD) Publishing that sponsored Perl Oasis in 2009? The people who sponsored CHI :) "CHI was originally designed and developed for the Digital Media group of the Hearst Corporation, a diversified media company based in New York City. Many thanks to Hearst management for agreeing to this open source release" I am sure I screwed up the name, my spelling suck, you know that :) Infinity Interactive should be on that list (obviously). Who? I'd love tosay Tamarou and Cloudtone Studios but neither of those companies are big enough that anybody has heard of them yet. Well we can add them to the list and perhaps you will get work out of it (and forward me a commission of course). - Stevan
Re: Towards a New Moose Website
On Thu, Sep 3, 2009 at 3:45 PM, Stevan Little wrote: > So, when next I have a dose of free time (which hopefully will be later this > month) I want to revise the Moose website. As Gabor pointed out > (http://szabgab.com/blog/2009/08/1251583673.html), what is there now is not > very organized and difficult to wade through. As Moose gets more popular the > lack of a clean and organized website is a stumbling block for people. > > So, I have some questions to ask of the greater Moose community to help me > put together more information. > > 1) What companies are using Moose? > Yahoo!, Symatec, IMDB, Pobox, Best Practical, Shadowcat, ValueClick, > Magazines.com, Reuters, Takkle.com, BBC, Hearst Publishing, Omni Hotels, > YouPorn and SocialText Hearst Publishing? Do you mean Hearst as in Patty Hearst or Harris Design (now HD) Publishing that sponsored Perl Oasis in 2009? Infinity Interactive should be on that list (obviously). I'd love to say Tamarou and Cloudtone Studios but neither of those companies are big enough that anybody has heard of them yet. -Chris
Re: Specifying exact type
On Thu, Sep 03, 2009 at 01:33:58PM -0700, Yuri Shtil wrote: > If I say isa => 'Class', then it will include all derived classes. > How do I exclude derived classes? > > Do I need a subtype like: > > subtype TopClassOnly => as 'Class' => where {blessed($_) eq 'Class'}; First of all, don't do that, and second of all, yes. -doy
Specifying exact type
If I say isa => 'Class', then it will include all derived classes. How do I exclude derived classes? Do I need a subtype like: subtype TopClassOnly => as 'Class' => where {blessed($_) eq 'Class'}; -- Yuri
Re: Towards a New Moose Website
On Thu, 3 Sep 2009, Stevan Little wrote: On Sep 3, 2009, at 4:25 PM, Dave Rolsky wrote: On Thu, 3 Sep 2009, Stevan Little wrote: I am not looking for sponsorship, endorsement or anything official, just like to be able to point out to people who ask (like this guy on perlmonks -> http://www.perlmonks.org/index.pl?node_id=793076). Here is a short list of companies I already know about: Yahoo!, Symatec, IMDB, Pobox, Best Practical, Shadowcat, ValueClick, Magazines.com, Reuters, Takkle.com, BBC, Hearst Publishing, Omni Hotels, YouPorn and SocialText That's Thomson Reuters, but I don't know of any Moose-using code here. If there is, it's well-hidden. Wait, I thought you were using Fey at Reuters? Haha. Getting a new module in use here is near impossible. -dave /* http://VegGuide.org http://blog.urth.org Your guide to all that's veg House Absolute(ly Pointless) */
Re: Towards a New Moose Website
We're using moose at Napster to rewrite a bit of our backend, and I'm pushing for it elsewhere. In fact, today we just rolled out the list of dependencies and the latest moose version to our frontend so (after a year) I'm finally getting somewhere. On Thu, Sep 3, 2009 at 1:25 PM, Dave Rolsky wrote: > On Thu, 3 Sep 2009, Stevan Little wrote: > >> I am not looking for sponsorship, endorsement or anything official, just >> like to be able to point out to people who ask (like this guy on perlmonks >> -> http://www.perlmonks.org/index.pl?node_id=793076). Here is a short list >> of companies I already know about: >> >> Yahoo!, Symatec, IMDB, Pobox, Best Practical, Shadowcat, ValueClick, >> Magazines.com, Reuters, Takkle.com, BBC, Hearst Publishing, Omni Hotels, >> YouPorn and SocialText > > That's Thomson Reuters, but I don't know of any Moose-using code here. If > there is, it's well-hidden. > > I wouldn't be surprised to hear it's used at TicketMaster and Amazon too > (besides IMDB). > > > -dave > > /* > http://VegGuide.org http://blog.urth.org > Your guide to all that's veg House Absolute(ly Pointless) > */ >
Re: Towards a New Moose Website
On Sep 3, 2009, at 4:25 PM, Dave Rolsky wrote: On Thu, 3 Sep 2009, Stevan Little wrote: I am not looking for sponsorship, endorsement or anything official, just like to be able to point out to people who ask (like this guy on perlmonks -> http://www.perlmonks.org/index.pl?node_id=793076). Here is a short list of companies I already know about: Yahoo!, Symatec, IMDB, Pobox, Best Practical, Shadowcat, ValueClick, Magazines.com, Reuters, Takkle.com, BBC, Hearst Publishing, Omni Hotels, YouPorn and SocialText That's Thomson Reuters, but I don't know of any Moose-using code here. If there is, it's well-hidden. Wait, I thought you were using Fey at Reuters? I wouldn't be surprised to hear it's used at TicketMaster and Amazon too (besides IMDB). Me either, but I would prefer confirmation first. I have heard rumors it is used at Amazon and Google. - Stevan
Re: Towards a New Moose Website
On Thu, 3 Sep 2009, Stevan Little wrote: I am not looking for sponsorship, endorsement or anything official, just like to be able to point out to people who ask (like this guy on perlmonks -> http://www.perlmonks.org/index.pl?node_id=793076). Here is a short list of companies I already know about: Yahoo!, Symatec, IMDB, Pobox, Best Practical, Shadowcat, ValueClick, Magazines.com, Reuters, Takkle.com, BBC, Hearst Publishing, Omni Hotels, YouPorn and SocialText That's Thomson Reuters, but I don't know of any Moose-using code here. If there is, it's well-hidden. I wouldn't be surprised to hear it's used at TicketMaster and Amazon too (besides IMDB). -dave /* http://VegGuide.org http://blog.urth.org Your guide to all that's veg House Absolute(ly Pointless) */
Towards a New Moose Website
So, when next I have a dose of free time (which hopefully will be later this month) I want to revise the Moose website. As Gabor pointed out (http://szabgab.com/blog/2009/08/1251583673.html), what is there now is not very organized and difficult to wade through. As Moose gets more popular the lack of a clean and organized website is a stumbling block for people. So, I have some questions to ask of the greater Moose community to help me put together more information. 1) What companies are using Moose? I am not looking for sponsorship, endorsement or anything official, just like to be able to point out to people who ask (like this guy on perlmonks -> http://www.perlmonks.org/index.pl?node_id=793076). Here is a short list of companies I already know about: Yahoo!, Symatec, IMDB, Pobox, Best Practical, Shadowcat, ValueClick, Magazines.com, Reuters, Takkle.com, BBC, Hearst Publishing, Omni Hotels, YouPorn and SocialText Anything that we can add to that would be awesome (and of course if you work for one of these and would prefer to be left off the list just let me know too). As I said above, this is not an endorsement of Moose by these companies, and I will be explicit about that, but just something to show people that yes Moose is being used out in the wild. 2) Are there any blogposts or misc. rants of any kind that is *not* already covered in the docs but really don't belong in the docs that you would like to see spotlighted and/or included in the site? The short list so far is: http://chris.prather.org/perl/why-moose-is-post-modern/ http://chris.prather.org/perl/moose-dependencies-a-lurid-tale/ (which needs some updating) I am going to comb through the Ironman archives for more as well, but if there is anything you have seen recently that you think should be spotlighted, let me know. 3) Moose Presentations We have a list on the website now, but if anyone wants to add to that list and have us link to slides, we would be happy to. 4) Moose Testimonials If anyone would like to write up a short (one paragraph) testimonial about how Moose helped them, I would love to include these on the site. --- Then of course any other suggestions anyone might have, I am open to them. Thanks, - Stevan
Re: Outstanding Branches
On Tue, 2009-09-01 at 23:50 -0400, Chris Prather wrote: > Okay since I started beating people about the head and shoulders that > we're an "open" process > (http://chris.prather.org/perl/take-arms-against-a-sea-of-troubles/) > what do we need to get the current outstanding branches in Moose.git > (and one on a external Git repo mentioned in a different thread on > this list) reviewed? > > Jesse and I have made sure that our current topics that are ready for > review are up to date and "green" on > http://files.perldition.org/moose.html and > http://files.perldition.org/cmop.html ... and have been warnocked on > our posts earlier for review. So what do we need to do to get a little > review love? Perhaps send Linux-Kernel-Mailing-List-style in-line patchsets for each of the proposed branches to the mailing list? Dangle code in front of the lurkers perhaps. :) Sam