I'm using LISP for several months. I know that Scheme is very similar to LISP, but I cannot understand the following Scheme functions. I read somewhere on the internet that "let loop" is used to create a recursive functions, but its argument "let loop ((x x))" doesn't make sense to me. Could you please explain and convert one function from scheme to LISP? Thank you so much for your help.

lispnewbie wrote:After created in the labels funtions, loop can be called only one time as the second argument.

That is not true, you can call the function loop as many times as you want, either inside it's own body, inside the body of another function created in the macro labels or inside the body of labels itself.

lispnewbie wrote:Is it possible to call loop more than one time and inside the body? (like my "min" function).

Yes, there is no problem in calling a function recursively more than once.

lispnewbie wrote:Do you think there is a way to write "let loop" as a recursive function in common lisp?

A local function inside labels that calls itself is already a recursive function. Unless you are thinking about not creating a local function and defining remove and min as recursive functions.

Just one note, though: Common Lisp already has functions named removed and min, so you should rename those functions.

It would not work to assign the lambda directly -- as in (let ((loop (lambda ... ) -- because then 'loop' will not have been defined at the time the lambda is being created; just as "(let ((x x)) ..." would fail if 'x' has not been defined previously. By creating 'loop' before it is actually bound with the lambda, it can then be referenced within the lambda's body. The initial assignment of 'loop' (#f) does not matter because it gets re-bound to the lambda before the lambda is ever applied to the values.

Thanks, guys. i didn't wrote these scheme functions, I found them online when I searched for Lisp. The way they named args and values made me confused. Now I can understand and can convert them to a similar common lisp function.