How to cycle in lisp?

1

I've been learning lisp at university recently and I'm having some problems adapting to this language.
Does let in this language work as a for in java? If so can you show me an example that gives you a rough idea of how it works?

    
asked by anonymous 19.05.2017 / 13:14

1 answer

0

This link contains a wealth of information about this language. Including an explanation of interactions, in section 2.19 you can see how to create a loop that would be equivalent to for in java.

Example:

Printing numbers from 10 to 20.

(loop for a from 10 to 20
    do (print a)
)

The code above is equivalent to the following code in java:

for(int i = 10; i <= 20; i++){
    System.out.println(i);
}
    
19.05.2017 / 15:05