Front page | perl.perl6.language |
Postings from September 2001
RE: Prototypes
Thread Previous
|
Thread Next
From:
Garrett Goebel
Date:
September 4, 2001 08:17
Subject:
RE: Prototypes
Message ID:
71BEC0D4E1DED3118F7A009027B12028010BE012@EXCH_MISSION
From: Bryan C. Warnock [mailto:bwarnock@capita.com]
>
> On Monday 03 September 2001 11:56 pm, Bryan C. Warnock wrote:
> > The third value is a "peek" value. Do the runtime
> > checking, but don't do any magic variable stuff. As a
> > matter of fact, don't run any user-code at all. Simply
> > return a true or false value if the arguments *would*
> > match. (This allows us to check incoming coderefs, to
> > see that they take the arguments that *they* expect.
> > Similar to the whole "pointer to a function that takse
> > a pointer to a function, and an int." Of course, no
> > checking the return value. But they're supposed to
> > handle your want()s.)
>
> Er, scratch this. Blows up if the sub isn't prototyped. A
> much *better* way is to make the prototype of any sub a
> property (trait) of that sub. We can always query for a
> property.
This is possible now:
$foo = sub ($) { print "hello world\n" };
print prototype $foo;
Thread Previous
|
Thread Next