Assertion: lisp's function | /r/CapableOf | make equivalent of python's range function
Facets:
Source sentences:
text: ;; the following two functions just make equivalent of Python's range function ;; you can safely ignore them unless you are running this code (defun range-helper (x) (if (= x 0) (list x) (cons x (range-helper (- x 1))))) (defun range (x) (reverse (range-helper (- x 1)))) ;; equivalent to the python example: ;; define a variable (defvar divisibleByTwo nil) ;; loop from 0 upto and including 9 (loop for x in (range 10) ;; test for divisibility by two if (= (mod x 2) 0) ;; append to the list do (setq divisibleByTwo (append divisibleByTwo (list x))))