Minor progress on Lisp functions
This commit is contained in:
parent
37ba03f05e
commit
c3b327f760
8 changed files with 116 additions and 3 deletions
|
|
@ -1 +0,0 @@
|
|||
(DEFUN COUNT (L) (COND ((EQ '() L) 0) (T (PLUS 1 (COUNT (CDR L))))))
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
gcd[x;y] = [x>y -> gcd[y;x];
|
||||
rem[y;x] = 0 -> x;
|
||||
T -> gcd[rem[y;x];x]]
|
||||
T -> gcd[rem[y;x];x]]
|
||||
|
||||
;; gcd[x;y] = [x>y -> gcd[y;x]; rem[y;x] = 0 -> x; T -> gcd[rem[y;x];x]]
|
||||
1
resources/length.lsp
Normal file
1
resources/length.lsp
Normal file
|
|
@ -0,0 +1 @@
|
|||
(DEFUN LENGTH (L) (COND ((EQ NIL L) 0) (T (ADD1 (LENGTH (CDR L))))))
|
||||
|
|
@ -7,6 +7,7 @@
|
|||
;; Binding all system functions to NIL so that you can see on the OBLIST that
|
||||
;; they exist.
|
||||
(ADD1 . NIL)
|
||||
(AND . NIL)
|
||||
(APPEND . NIL)
|
||||
(APPLY . NIL)
|
||||
(ATOM . NIL)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue