thomasfn

Some kinda weird threaded scripting language

Aug 2nd, 2012
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. define process main:
  2. let the type fruit hold:
  3. a string name
  4. a decimal weight
  5. a process output:
  6. output "Name: ", name, newline, "Weight: " then weight
  7. let orange be a fruit:
  8. name is "Orange"
  9. weight is 0.1
  10. let apple be a fruit:
  11. name is "Apple"
  12. weight is 0.15
  13. output orange
  14. meanwhile output apple
  15.  
  16. define process main:
  17. define shortcut "<=" to be "is less than or equal to"
  18. define process fib:
  19. let n be parameter 1
  20. if n <= 2 then:
  21. return 1
  22. otherwise:
  23. run fib with n-1 and n-2 and return it
  24. run fib with 10 and output it
Advertisement
Add Comment
Please, Sign In to add comment