Skip to content

Instantly share code, notes, and snippets.

View MShrimp4's full-sized avatar

MShrimp4

View GitHub Profile
@MShrimp4
MShrimp4 / sort.c
Created November 8, 2018 01:02
simple sort
#include <stdio.h>
#include <stdbool.h>
bool swap(int * a, int * b){
int temp;
temp = *a;
*a = *b;
*b = temp;
}
@MShrimp4
MShrimp4 / autolet.clj
Created November 3, 2018 00:34
Automatic Let -Clojure macro
(defn _autolet [exp]
(cond
(empty? exp) exp
(= (ffirst exp) :=) (let [app (into (vector) (rest (first exp)))
rexp (_autolet (rest exp))]
`((let ~app ~@rexp)))
:else (cons (first exp) (_autolet (rest exp)))))
(defmacro autolet [& exp]
`(do ~@(_autolet exp)))