add more lisp
This commit is contained in:
parent
a0734f0a40
commit
2070545df7
|
@ -0,0 +1,38 @@
|
||||||
|
;
|
||||||
|
; Ringing the changes
|
||||||
|
; see http://www.ulisp.com/show?1G42
|
||||||
|
;
|
||||||
|
|
||||||
|
(defvar *bell-pin* 3)
|
||||||
|
|
||||||
|
(defun fnd (x lst)
|
||||||
|
(cond
|
||||||
|
((null lst) nil)
|
||||||
|
((< x (car lst)) (car lst))
|
||||||
|
(t (fnd x (cdr lst)))))
|
||||||
|
|
||||||
|
(defun sub (new old lst)
|
||||||
|
(cond
|
||||||
|
((null lst) nil)
|
||||||
|
((eq old (car lst)) (cons new (cdr lst)))
|
||||||
|
(t (cons (car lst) (sub new old (cdr lst))))))
|
||||||
|
|
||||||
|
(defun nxt (lst)
|
||||||
|
(cond
|
||||||
|
((not (apply > (cdr lst))) (cons (car lst) (nxt (cdr lst))))
|
||||||
|
((> (car lst) (cadr lst)) nil)
|
||||||
|
(t (let* ((rest (reverse (cdr lst)))
|
||||||
|
(old (fnd (car lst) rest)))
|
||||||
|
(cons old (sub (car lst) old rest))))))
|
||||||
|
|
||||||
|
(defun all (fun lst)
|
||||||
|
(when lst
|
||||||
|
(funcall fun lst)
|
||||||
|
(all fun (nxt lst))))
|
||||||
|
|
||||||
|
(defun bel (lis)
|
||||||
|
(mapc
|
||||||
|
(lambda (x) (note *bell-pin* x 4) (delay 500) (note) (delay 125))
|
||||||
|
lis)
|
||||||
|
(delay 500))
|
||||||
|
|
19
lisp/sync.sh
19
lisp/sync.sh
|
@ -1,5 +1,22 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
MEDIA="$1"
|
if [ "$(uname -s)" = "Linux" ]
|
||||||
|
then
|
||||||
|
DEFAULT_MOUNT="/media/kyle/ULISP"
|
||||||
|
else
|
||||||
|
DEFAULT_MOUNT="/Volumes/ULISP"
|
||||||
|
fi
|
||||||
|
|
||||||
|
MEDIA="${1:-${DEFAULT_MOUNT}}"
|
||||||
|
|
||||||
|
if [ ! -d "${MEDIA}" ]
|
||||||
|
then
|
||||||
|
echo "[!] ${MEDIA} isn't mounted!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "[+] transferring lisp files to ${MEDIA}..."
|
||||||
cp *.lsp "$MEDIA"
|
cp *.lsp "$MEDIA"
|
||||||
|
echo "[+] unmounting ${MEDIA}"
|
||||||
umount "$MEDIA"
|
umount "$MEDIA"
|
||||||
|
echo "[+] transfer complete"
|
||||||
|
|
Loading…
Reference in New Issue