Created
February 23, 2011 17:52
-
-
Save daniel-cussen/840810 to your computer and use it in GitHub Desktop.
Other functions (I think for "writing" to the memory)
This file contains hidden or 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
| (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