[bitc-dev] deeply immutable functions and Haskell's ST
Richard Uhtenwoldt
ru at river.org
Fri Aug 26 19:45:36 EDT 2005
>Mark Miller wrote:
> (define (accept-product (calc-factory :deep-frozen))
> (let ((diode 0))
> (define (diode-write (val :deep-frozen)) (setq diode val))
> (define (diode-read) (diode))
> ^ ^
Since diode's an int,
not a proc, these parens
should go away.
> (define q (calc-factory diode-write nil))
> (define bond (calc-factory nil diode-read))))
Now suppose I want to call accept-product. Please provide
a suitable actual argument to accept-product.
Moreover, I want calling accept-product to have an efffect on the
world outside the definitions of calc-factory and accept-product:
namely, it shoud return some non-null value or affect some
outside state.
More information about the bitc-dev
mailing list