Created
June 28, 2019 16:52
-
-
Save defunkydrummer/12f22cec20bb7a94ab7f7cb80d06e7b6 to your computer and use it in GitHub Desktop.
Go Shitposting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; (c) 2019 Defunkydrummer | |
;; MIT License | |
(defun indent (str &key with-indent) | |
"Indent a string" | |
(format t | |
(format nil "~~~dT ~~a" (1+ with-indent)) | |
str)) | |
(defun |brutally practical line| (l &optional (indent 0)) | |
"Rob Pike is love, Rob Pike is life." | |
(indent | |
(format nil "~a,err = \"~a\"; if err!=nil return nil, err; else~%" l l) | |
:with-indent indent)) ;lol at lisp-2 haters | |
(defun shitposting-cube (m) | |
"Defunkydrummer's new Go shitposting cube." | |
(let ((message (string-upcase | |
(substitute #\_ #\Space m)))) | |
(loop | |
with length = (length message) | |
for indent from 0 to length | |
for letter across message | |
do (|brutally practical line| letter indent) | |
finally | |
;; name the 'concatenate' function properly | |
(indent | |
(format nil "return concatenate_~r_utf8_values(~{~a~^,~})" | |
length | |
(coerce message 'list)) | |
:with-indent (1+ length))))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Go "shitposting" in Common Lisp
Just having some fun; the fun value of this will be obvious to any Golang developer.
and BTW it uses some nice features in CL like
Usage:
(shitposting-cube "I love Rob Pike.")
Sample output:
Or...
(shitposting-cube "NO GENERICS, NO METAPROGRAMMING, NO HINDLER-MILNER")
Out: