I am writing a function that is supposed to take in two values. The first value is supposed to create a list up to five numbers, based on the value entered. The second value is supposed to take the list and rotate it n
times, based on the number entered.
Example of program interaction.
> (my_rotate_n 1,2)
> (3 4 5 1 2)
This is the function I currently have.
(defun my_rotate_n (y) (x)
(append (loop for i from (+ 1 y) to (+ 4 y) collect i)
(> x 0) (my_rotate_n (rotate-right y)(- x 1)))(list y))
When I test the function for an output I get the error: comma is illegal outside of backquotes
Any suggestions?
Comma:
To separate tokens, use Whitespace Characters.
IOW, instead of
(my_rotate_n 1,2)
you should write(my_rotate_n 1 2)
.(This will not make your
my_rotate_n
work, of course, just avoid that particular error. You should invest some of your time in studying Lisp syntax.)