Guest User

Untitled

a guest
Jan 21st, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. "innsetja.mmod" =
  2. !
  3. {{
  4. innsetja =
  5. fun(x,u)
  6. {
  7. x == [] && (return [u]);
  8. head(x) << == u || (return u:x);
  9. head(x) : innsetja(tail(x),u);
  10. };
  11. }}
  12. ;
  13.  
  14. show "innsetja.mmod";
  15.  
  16. "test1.mexe" = main in
  17. {{
  18. main =
  19. fun()
  20. {
  21. var x = [1,2,9,3],y;
  22. while(x! == [])
  23. {
  24. y = innsetja(y,head(x));
  25. x = tail(x);
  26. };
  27.  
  28. writeln(y);
  29. };
  30. }}
  31. *
  32. "innsetja.mmod"
  33. *
  34. {{
  35. <<== = fun <= (x,y);
  36. }}
  37. *
  38. BASIS
  39. ;
Add Comment
Please, Sign In to add comment