> If the C<?> modifier is used for a particular parameter, that parameter
> is lazily evaluated. This means that it is only evaluated when the
> corresponding named parameter (see below) -- or the corresponding element
> of @_ -- is accessed in some way. Passing the parameter to another
> subroutine or returning it as an lvalue does not count as an access.

Can this be used to implement a Jensen device:

  sub work($i,?$j) {
    for $i ( 1..10 ) {
        print "$i: $j\n";
    }
  }

  my $foo;
  work($foo, $foo*$foo);                # prints 1 4 9 16 ...

-- Johan

Reply via email to