Advertisement
konalisp

Timeside concept

Jul 12th, 2013
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. //This is Timeside, the language that puts time on your side.
  2. //everything requires a label. They don't need to be numbers, they can be anything.
  3. //timelines are threaded
  4.  
  5. timeline U1 {
  6. 0-1: start; //can start or stop time. When time starts the program acts procedurally.
  7. 0-2: defn hello () {
  8. 0-3: print "world";
  9. }
  10. 0-4: stop; //stop time
  11. 0-5: print "hello ";
  12. 0-6: do(reorder(0-5 0-3)); //change control flow and "do" calls the labels
  13. }
  14.  
  15. timeline U2 {
  16. 1-1: start;
  17. 1-2: forward(6); //waits six statements
  18. 1-3: call(U1); //ends up at label "0-6" due to waiting
  19. }
  20.  
  21. bang(U2); //call the starting timeline
  22.  
  23. //new program:
  24.  
  25. timeline U1 {
  26. 1-1: stop; //time is automaticall stopped anyway, this is for readability.
  27. 1-2: y = add(temp(x) temp(x)); //"temp" is a disposable veriable similar to function arguments. The integer "y" is now "x + x".
  28. 1-3: maketemp(x 2); //makes both instances of "x" 2.
  29. 1-4: reorder(1-3 1-2);
  30. 1-5: start;
  31. 1-6: print y;
  32. } bang(U1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement