Buddha Buck writes:
: At 11:26 AM 8/23/00 -0700, Larry Wall wrote:
: 
: >I expect that we'll get more compile-time benefit from
: >
: >     my HASH sub foo {
: >         ...
: >     }
: >
: >     %bar = foo();
: 
: So how would you fill in the type in:
: 
: my TYPE sub foo {
:    ...
:    if (wanthash())   { return %bar;  }
:    if (wantarray())  { return @baz;  )
:    if (wantscalar()) { return $quux; };
: }
: 
: $scalar = foo();
: @array  = foo();
: %hash   = foo();

I don't yet know whether built-in types will derive from UNIVERSAL.  But
certainly 

    my sub foo {

will work at least as well as it does now.  :-)

Larry

Reply via email to