Created
February 28, 2017 22:04
-
-
Save VaughnGH/812fd4fef21b14e0a077fcd5c368bf74 to your computer and use it in GitHub Desktop.
This file contains 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
Every third, `et': | |
(defun et(in) | |
(COND | |
( (EQUAL NIL in) NIL) | |
( (< (LIST-LENGTH in) 3) NIL ) | |
( T (CONS (caddr in) (et (cdddr in))) ) | |
) | |
) | |
Break 13 [17]> (et `(1 2 3 4 )) | |
(3) | |
Break 13 [17]> (et `(1 2)) | |
NIL | |
Break 13 [17]> (et `(1 2 3 4 5 6 7 8 9 0)) | |
(3 6 9) | |
Break 13 [17]> (et `(1 2 3 4 5 6 7 8 9 0 2)) | |
(3 6 9) | |
Break 13 [17]> (et `(1 2 3)) | |
(3) | |
/////////////////////// PRACTICE ///////////////////////// | |
def et(in): | |
return (CONS caddr(in) et(cdddr(in))) | |
(defun et(in)(COND ((EQUAL NIL in) NIL) (T (CONS (caddr in) (et (cdddr in)) ) ) )) | |
(defun et(in) | |
(COND | |
( ((< (LIST-LENGTH in) 3) NIL) | |
(T | |
(CONS (caddr in) (et (cdddr in))) | |
) | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment