Thanks. I had put together something similar to your first suggestion but tried to use PutStrLn(Show...). I'd also thought of your second suggestion about a dummy show for functions. A little further along in "The Little MLer" the ints function is replaced by other functions like primes and fibs, which also return Links: fun primes(n) = if is_prime(n+1) then Link(n+1,primes) else primes(n+1) fun fibs(n)(m) = Link(n+m,fibs(m)) which are passed to chain_item: fun chain_item(n,Link(i,f)) = if eq_int(n,1) then i else chain_item(n-1,f(i)) which can be called to request the nth (12th) prime number beginning at 1. - chain_item(12,primes(1)); GC #0.0.0.1.3.61: (1 ms) val it = 37 : int - So I guess the answer to your question about whether the function is ever called with a different value may be, yes. Michael --- On Mon, 5/18/09, Ryan Ingram <ryani.spam@gmail.com> wrote:
|