Advertisement
Guest User

Untitled

a guest
Jan 9th, 2019
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 1.07 KB | None | 0 0
  1. ;;; with-yeet.lisp
  2.  
  3. (defvar *yeets* '((de🅱un defun)
  4.                   (c🅱r cdr)
  5.                   (c🅰r car)
  6.                   (😤 lambda)
  7.                   (🙆 let)
  8.                   (💁 labels)
  9.                   (💩 nil)
  10.                   (💩? null)
  11.                   (👌 t)
  12.                   (📦 cons)
  13.                   (🤓 cl-user)
  14.                   (🆑 cl)))
  15.  
  16. (defun yeet-transform (program)
  17.   (if (consp program)
  18.       (cons (yeet-transform (car program))
  19.             (yeet-transform (cdr program)))
  20.       (let ((match (assoc program *yeets*)))
  21.         (if (null match)
  22.             program
  23.             (second match)))))
  24.  
  25. (defmacro with-yeet ((&key skkrt) &body body)
  26.   `(progn
  27.      ,(when skkrt
  28.         '(format t "~&yeetus that 🆑~%"))
  29.      ,@(yeet-transform body)))
  30.  
  31. ;;; a sample program
  32.  
  33. (with-yeet (:skkrt t)
  34.   (de🅱un re🅱erse (🅱ist)
  35.     (💁 ((🅰 (🅱 🅰)
  36.            (if (💩? 🅱)
  37.                🅰
  38.                (🅰 (c🅱r 🅱) (📦 (c🅰r 🅱) 🅰)))))
  39.       (🅰 🅱ist 💩))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement