fork download
  1. functor
  2. import
  3. Application
  4. System
  5. local
  6. fun lazy {Times N H}
  7. case H of nil then
  8. nil
  9. [] Head|Tail then
  10. Head*N | {Times N Tail}
  11. end
  12. end
  13. fun lazy {Merge Xs Ys}
  14. case Xs of nil then
  15. Ys
  16. [] X|Xr then
  17. case Ys of nil then
  18. nil
  19. [] Y|Yr then
  20. if X < Y then
  21. X|{Merge Xr Ys}
  22. elseif X > Y then
  23. Y|{Merge Xs Yr}
  24. else
  25. X|{Merge Xr Yr}
  26. end
  27. end
  28. end
  29. end
  30. proc {Touch N H}
  31. case H of nil then
  32. {System.showInfo "koniec"}
  33. [] Head|Tail then
  34. if N > 0 then
  35. {System.showInfo Head}
  36. {Touch N-1 Tail}
  37. end
  38. end
  39. end
  40. fun {Hamming H N}
  41. if N > 0 then
  42. H | {Hamming {Merge {Merge {Times 2 H} {Times 3 H}} {Times 5 H}} N-1}
  43. else
  44. nil
  45. end
  46. end
  47. in
  48. {Touch 10 {Hamming [1] 100}}
  49. end
  50.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Mozart Compiler 1.4.0 (20080704) playing Oz 3

%%% feeding file prog.oz

%*************************** parse error ************************
%**
%** syntax error, unexpected T_local, expecting T_end
%**
%** in file "./prog.oz", line 5, column 0
%** ------------------ rejected (1 error)
stdout
Standard output is empty