rotatefマクロ
(setq a 1 b 2 c 3 d 4) (defun pnt () (print a) (print b) (print c) (print d) "====") >(pnt) 1 2 3 4 "====" >(rotatef a b c d) 1 >(pnt) 2 3 4 1 "====" >(rotatef a b c d) 2 >(pnt) 3 4 1 2 "===="
引数が2つなら入れ替えに使える。
shiftfっていうのもあるそうで。
(setq a 1 b 2 c 3 d 4) (defun pnt () (print a) (print b) (print c) (print d) "====") >(pnt) 1 2 3 4 "====" >(rotatef a b c d) 1 >(pnt) 2 3 4 1 "====" >(rotatef a b c d) 2 >(pnt) 3 4 1 2 "===="
引数が2つなら入れ替えに使える。
shiftfっていうのもあるそうで。