Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SCHEME | lambda vs λ?

I'm taking a SCHEME course, and I was wandering if there's any difference between writing "λ" or "lambda". To clarify, is there a functional difference between these two snippets ?

Using λ

(define foo
 (λ (x)
   (...)))

Using lambda

(define bar 
 (lambda (x)
  (...)))
like image 551
Aviad Avatar asked Dec 01 '14 20:12

Aviad


People also ask

What is a lambda in scheme?

Lambda is the name of a special form that generates procedures. It takes some information about the function you want to create as arguments and it returns the procedure. It'll be easier to explain the details after you see an example.

What is begin in scheme?

Scheme begin expressions aren't just code blocks, though, because they are expressions that return a value. A begin returns the value of the last expression in the sequence. For example, the begin expression above returns the value returned by the call to bar . The bodies of procedures work like begin s as well.


1 Answers

λ is the lowercase symbol with the name lambda but most Scheme implementations doesn't have λ defined as a synonym for lambda. This the difference is that lambda is guaranteed to work while λ certainly is shorter for a teacher to write.

As an example I can mention that the wizards used λ quite often in the SICP videos even though the symbol wasn't supported. Whenever you see it you need to write lambda.

like image 101
Sylwester Avatar answered Sep 19 '22 08:09

Sylwester