Just a quick note to say that I finally figured out a resolution to my problem. Instead of making the function parameter a globally scoped variable, I made it local to the function passed to the Solve functions. From the translation of Listo, I get:

  fun {Listo L}
     choice
        L = nil
     [] H T in
        L = H|T
        H|{Listo T}
     end
  end

Which is sort of where I started out from. But the important change was to scope the L parameter local to the function sent to Solve:

  {Browse {SolveN 5 fun {$} X in {Listo a|b|c|X} end}}

Anyhow, getting over this hump made the translation of Chapter 3 and 4 of The Reasoned Schemer fairly easy. The first four chapters are now posted at:

http://www.codepoetics.com/wiki/index.php?title=Topics:TRS_in_other_languages:Oz

Any critiques and criticisms about the style of my Oz code are welcome.

Thanks,
Chris Rathman


Chris Rathman wrote:
  %% same here
  fun {ListC L}
     choice
        L = nil
     [] H T in
        L = H|{ListC T}      %% if L unbound, then gets bound here
     end
  end



_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to