fork download
  1. declare
  2. fun lazy {Times N H}
  3. case H of nil then
  4. nil
  5. [] Head|Tail then
  6. Head*N | {Times N Tail}
  7. end
  8. end
  9. fun lazy {Merge Xs Ys}
  10. case Xs of nil then
  11. Ys
  12. [] X|Xr then
  13. case Ys of nil then
  14. nil
  15. [] Y|Yr then
  16. if X < Y then
  17. X|{Merge Xr Ys}
  18. elseif X > Y then
  19. Y|{Merge Xs Yr}
  20. else
  21. X|{Merge Xr Yr}
  22. end
  23. end
  24. end
  25. end
  26. proc {Touch N H}
  27. case H of nil then
  28. {System.showInfo "koniec"}
  29. [] Head|Tail then
  30. if N > 0 then
  31. {System.showInfo Head}
  32. {Touch N-1 Tail}
  33. end
  34. end
  35. end
  36. fun {Hamming H N}
  37. if N > 0 then
  38. H | {Hamming {Merge {Merge {Times 2 H} {Times 3 H}} {Times 5 H}} N-1}
  39. else
  40. nil
  41. end
  42. end
  43. in
  44. {Touch 10 {Hamming [1] 100}}
  45. end
  46.  
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_end, expecting T_ENDOFFILE
%**
%** in file "./prog.oz", line 45, column 0
%** ------------------ rejected (1 error)
stdout
Standard output is empty