On Nov 24, 2004, at 5:06 AM, Tim Bunce wrote:
       push @status_options, 'hidden' if $boolean;
       but that is much wordier than:

         push @status_options, 'hidden' if
           GCt::glyph_attribute-?->retrieve(
               glyph_type => $glyph_type,
               attr_name  => 'face_hideable'
               )
               -?->attr_value;

This seems just fine to me:

           push @status_options, 'hidden' if eval {
             GCt::glyph_attribute->retrieve(
                 glyph_type => $glyph_type,
                 attr_name  => 'face_hideable'
                 )
                 ->attr_value };

Actually, assuming that the attr_value is itself the string 'hidden' (which maybe it is, maybe it isn't), then you could just us the return value of the eval statement (which should be the last value, just like a subroutine).


        push @status_options, eval {
                GCt::glyph_attribute->retrieve(
                        glyph_type => $glyph_type,
                        attr_name  => 'face_hideable'
                        )
                        ->attr_value };

Steve


Tim.

_______________________________________________
sw-design mailing list
[EMAIL PROTECTED]
http://metaperl.com/cgi-bin/mailman/listinfo/sw-design



_______________________________________________
sw-design mailing list
[EMAIL PROTECTED]
http://metaperl.com/cgi-bin/mailman/listinfo/sw-design

Reply via email to