[plt-scheme] Understanding lambda

From: Jos Koot (jos.koot at telefonica.net)
Date: Fri Feb 13 15:23:56 EST 2009

Equality is a very tedious thing to define. But replacing f by (lambda(x) (+(* 3 x) 5))) does produce the same results (normally (i.e. if. for example `'lamda' is not redefined)) In mathematics two functions are connsidered to be the same if they produce the same results for the same arguments (which already presuposes an equality relation). In Scheme, this concept is somewhat more complicated because it cannot always be proven whether or not two functions always produce the same results when given the same arguments. Because of the difficulty of deciding when two functuions are the same, we have for example:
(equal? (lambda (x) x) (lambda (x) x)) --> #f, whereas a mathematicean probably would ansewer `yes'.
  ----- Original Message ----- 
  From: aditya shukla 
  To: plt-scheme at list.cs.brown.edu 
  Sent: Friday, February 13, 2009 9:05 PM
  Subject: [plt-scheme] Understanding lambda

  I am trying to understand lambda and i have a question.

  Suppose (define f (lambda(x) (+(* 3 x) 5)))

  Now i have read and heard that lambda is used to define unnamed functions now , i am confused about the value of f
  ie will it be equal to the function returned by (lambda(x) (+(* 3 x) 5)) or will be equal to the value which is computed for any value of x ie if x =1 then f =8.Any help is appreciated.

  Thanks in advance



    For list-related administrative tasks:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20090213/ac834872/attachment.html>

Posted on the users mailing list.