At 9:13 AM +0200 7/2/03, K Stol wrote:
In Perl this is possible (because of the syntax of Perl). But what about languages in which it cannot be expressed?
I know, Parrot is mainly for Perl, but not *only* for Perl. Wouldn't it be nice to have Parrot supporting this?

Yup, it would. Parrot's assuming pass-by-reference for reference types (Strings and PMCs) and pass-by-value for value types (ints and nums). I'm tempted to leave it like that so there's a level of constancy there, and let the languages that want to take parameters in by value rather than reference make a copy of what's passed in.


Real reference types, the way objects are traditionally handled, won't change in this sort of scheme (as we'd just copy the reference) but that's normally the way things are supposed to happen.

This, of course, brings up the question of who gets to decide whether things are passed by value or reference, the caller or callee, so I'm up for discussion on that.

  ----- Original Message -----
  From: Gordon Henriksen
  To: K Stol
  Cc: [EMAIL PROTECTED]
  Sent: Wednesday, July 02, 2003 6:12 AM
  Subject: Re: Tentative [PATCH]: valclone


Shouldn't Perl make this determination at compile time based upon the subroutine's signature? Doesn't seem to me that it is in any way a decision for the assembler.


--
                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to