On Thu, Mar 5, 2009 at 6:17 PM, Rob Kinyon <[email protected]> wrote:
> On Thu, Mar 5, 2009 at 12:07, David Ihnen <[email protected]> wrote:
>> Nothing is actually a plugin that impliments the 'Nothing' design pattern -
>> that is - instead of returning null when referencing a row in an empty
>> resultset (particularly ->single and ->first, which I use many times when
>> NOT looping over results, hence resulting in undef dereference errors on
>> empty) it instead returns a magical 'Nothing' object which has
>> characteristics like - (->is_nothing === 1, ->id === 0, @list = $rs->method
>> === (), $row = $rs->method === bless({}, Nothing).  The result - no need to
>> if-then on empty resultsets when grabbing data.
>
> So, the following are different:
>    my $x = $rs->method;
>    my ($y) = $rs->method;
>
> That's sucky.

Not that I have any opinion - but the 'search' method has this same feature.

-- 
Zbigniew Lukasiak
http://brudnopis.blogspot.com/
http://perlalchemy.blogspot.com/

_______________________________________________
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]

Reply via email to