On Tue, 13 Aug 2002, [EMAIL PROTECTED] wrote: : From: Larry Wall [EMAIL PROTECTED] : > Of course, there are issues here if the code modifies those : > variables, since the issue of whether a variable is rw is : > really distinct from whether it represents a pass by value : > or reference. Slapping a "constant" on it is a bald-faced : > attempt to get the speed of pass-by-reference with the : > guarantees of pass-by-value. Perhaps there should be a way : > to declare a parameter to be pass-by-value, producing a : > modifiable variable that does not affect the caller's value. : > But I'm not sure saving one assignment in the body is worth : > the extra mental baggage. : : I'm not sure I read that right, but it sounds like you're implying that : pass-by-values will be read-only. Is that the plan?
The default is pass-by-reference, but non-modifiable. If there's a pass-by-value, it'll have to be specially requested somehow. This is a minimal difference from Perl 5, in which everything was pass-by-reference, but modifiable. To get pass-by-value, you just do an assignment. :-) Larry