Rob Kinyon wrote:
interesting point. If I had the Want module, I could easily return nothings if you have a specified number expected (1 in this case), or empty list if you expect infinite - since ($y) = $rs->method is different contextually than @y = $rs->method - which would make that not sucky.On Thu, Mar 5, 2009 at 12:07, David Ihnen <[email protected]> wrote: Yes, it is. Well, in this case in order to cleanly express 'Nothing', which has different meanings in different contexts, I need to be able to detect that context so that I can be different for those contexts. Within the limits of this particular design pattern, I think it is justifiable. So though it is a bit sucky and constrains the implimentation patterns (my $y = $rs->method SHOULD be equal to my ($y) = $rs->method), but in my case the former is what you want) without the Want module... I think that the pattern has good benefits in being able to cut down on the if-then hooey. How I hate if-then/tertiaries/logical operators/other repetitive code just to see if there's something there to operate on.It's something you should have in that section of your toolbox that has the "Write 500 words as to why you should be allowed to use me" essay requirement. At least with AUTOLOAD handling miscellaneous calls, I don't have to create special nothing hard-types one-to-parent-class as I would in Java/C++ that behave appropriately. A nothing row that returns a nothing date-object, etc. David |
_______________________________________________ List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/ Searchable Archive: http://www.grokbase.com/group/[email protected]
