Damian Conway wrote:
I don't see how ::= (compile-time-bind) can be used as the initialize-if-non-existent operator.

I mean, it happens in the wrong phase (compile-time, not run-time) and it does the wrong thing (binding, not assignment).

The only case I can think of where is might be useful is with a optional parameter with an "is rw" trait, so you could provide an default binding. Possible example:

sub myprint(+$file is IO:File is rw ::= IO:STDOUT, [EMAIL PROTECTED]) {...}

open f ">/a/d/v/f/r";
myprint file => f, "Hello World!\n"; # goes to f
myprint "Differnet World!\n";        # goes to IO:STDOUT

although maybe what I really want is := instead.

--
Mark Biggar
[EMAIL PROTECTED]
[EMAIL PROTECTED]




Reply via email to