Skip to content

Instantly share code, notes, and snippets.

@iamandrewluca
Last active October 1, 2019 06:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamandrewluca/4c9a252034c48dbc4e7f62ea65a907f1 to your computer and use it in GitHub Desktop.
Save iamandrewluca/4c9a252034c48dbc4e7f62ea65a907f1 to your computer and use it in GitHub Desktop.
Functional Programming (V4)
;;;; Din o lista L de atomi afisati toate numerele mai mari ca 11
(DEFUN biggerThan11 (L &OPTIONAL REZ)
(COND
((NULL L) REZ)
((AND (NUMBERP (CAR L)) (> (CAR L) 11))
(biggerThan11
(CDR L)
(CONS (CAR L) REZ)
)
)
(T (biggerThan11 (CDR L) REZ))
)
)
(SETQ L `(A 4 C 1 D 3 23 15 0 Z 99 11 10 12))
(WRITE (biggerThan11 L)) ; (12 99 15 23)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment