Advertisement
Guest User

Question for Non-Lispers

a guest
Oct 13th, 2017
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. For non-lispers (who have at least some programming experience), please read this code and answer the questions.
  2.  
  3. 1) Are you able to understand what the program is doing, step by step?
  4. 2) Do you find this syntax easier to read than lisp?
  5. 3) If this were a real programming language, would you consider learning and using it?
  6.  
  7. The following is the code in question:
  8.  
  9. let factorial
  10. function :int(int n) {
  11.         consider (1, 1) loop
  12.         function :int(int i, int p) {
  13.                 if #(i <= n) {
  14.                         :loop( #(i + 1), #(p * i) )
  15.                 } else {
  16.                         p
  17.                 }
  18.         }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement