develooper Front page | perl.perl6.language | Postings from September 2001

Re: Prototypes

Thread Previous | Thread Next
From:
Dan Sugalski
Date:
September 3, 2001 19:49
Subject:
Re: Prototypes
Message ID:
5.1.0.14.0.20010903224531.021c15e8@tuatha.sidhe.org
At 10:32 PM 9/3/2001 -0400, Bryan C. Warnock wrote:
>On Monday 03 September 2001 10:27 pm, Dan Sugalski wrote:
> > >To me, that seems only a language decision.  This could certainly handle
> > >that.
> >
> > Ah, but calling in the first way has two PMCs in as parameters, while the
> > second has only one. Potentially at least. A world of difference there.
>
>A single PMC?  (A list of pointers to PMCs?)
>
>Or, to think of it another way, how are you going to pass two scalars, or an
>array of two scalars, to a sub with *no* prototype?

We create a list, stuff our bits into the list, and pass the list. @_ will 
point to the list.

Lists can access their contents as if they were a list of scalars even if 
they're not. (So we can avoid flattening in cases we don't need to)

					Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
dan@sidhe.org                         have teddy bears and even
                                      teddy bears get drunk


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About