On Tue, Nov 12, 2002 at 09:03:22PM +0000, Piers Cawley wrote:
: Hang on, couldn't you rewrite things to not use the cache?
: 
:     class is $class {
:       sub value { &func(*@args) }
:       method operator:+ ($self is rw:) { +($self = value) }
:       method operator:~ ($self is rw:) { ~($self = value) }
:       method operator:? ($self is rw:) { ?($self = value) }
:     }.new
: 
: I don't know if I hope that works or hope it fails miserably. 
: 
: Also note that, if you were feeling sufficiently lazy with numbers,
: you could define the set of binary operators for your deferred
: numbers:
: 
:   method operator:+ ($self: Num $other) is lazy { +($self) + $other }
:   method operator:* ($self: Num $other) is lazy { +($self) * $other }
:   method operator:/ ($self: Num $other) is lazy { +($self) / $other }
:   method operator:- ($self: Num $other) is lazy { +($self) - $other }
: 
: Or would that just be evil, Bad And Wrong?

I believe the correct term is "opaque".  And I don't mean that
in the good sense...

Larry

Reply via email to