Advertisement
Guest User

Untitled

a guest
Apr 19th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. let twice = fn(f, x) {
  2. return f(f(x));
  3. };
  4. let addTwo = fn(x) {
  5. return x + 2;
  6. };
  7. twice(addTwo, 2);
  8.  
  9. let unless = macro(condition, consequence, alternative) {
  10. quote(if (!(unquote(condition))) {
  11. unquote(consequence);
  12. } else {
  13. unquote(alternative);
  14. });
  15. };
  16. unless(10 > 5, puts("not greater"), puts("greater"));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement