Skip to content

Instantly share code, notes, and snippets.

@daniel-cussen
Created February 23, 2011 17:52
Show Gist options
  • Select an option

  • Save daniel-cussen/840810 to your computer and use it in GitHub Desktop.

Select an option

Save daniel-cussen/840810 to your computer and use it in GitHub Desktop.
Other functions (I think for "writing" to the memory)
(defun assoc. (atom a x)
(cond ((eq atom (car (g-nth. x a '())))
(cdr (g-nth. x a '())))
('t (assoc. atom a (minus1. x)))))
(defun append. (glf1 glf2 x)
(cond ((eqnum. x (length. glf2 '()))
glf1)
('t (append. (g-add. (g-nth. x glf2 '()) glf1 '() (length. glf1 '())) glf2 (plus1. x)))))
(defun pair. (glf1 glf2 glf3 x)
(cond ((eqnum. x (length. glf2 '()))
glf1)
('t (pair. (g-add. (cons (g-nth. x glf2 '()) (g-nth. x glf3 '())) glf1 '() (length. glf1 '()))
glf2 glf3 (plus1. x)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment