Search found 2 matches

by christian123
Sun Nov 20, 2011 8:11 am
Forum: Common Lisp
Topic: Functions inside loops
Replies: 2
Views: 4347

Re: Functions inside loops

Here is my code
(defun create_tree (M N D)
(if (> N M)
nil
(loop for i from 1 to D for j from 1 to D
if (< (+ i j) (+ D 1))
(create_subtree M N i j)
)
))
Sorry for the trouble. However, I found a way around it using dotimes inside of loop.
by christian123
Sat Nov 19, 2011 6:50 pm
Forum: Common Lisp
Topic: Functions inside loops
Replies: 2
Views: 4347

Functions inside loops

Hello, I am writing a code to create a tree in lisp but I am facing the following problem Here is my code (defun create_tree (M N D) (if (> N M) nil (loop for i from 1 to D for j from 1 to D if (< (+ i j) (+ D 1)) (create_tree M N i j) ) )) This gives a syntax error, however when I comment the "...