Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Closures, lambdas and namespaces in PHP 5.3

Name: Anonymous 2008-08-23 7:38

ttp://www.php.net/archive/2008.php#id2008-08-01-1

I have a dream that one day PHP will be a respectable programming language.

I have a dream that one day we'll download popular web applications that are free software and will not be outraged at their source code.

I have a dream that one day "designers" who were writing PHP would just give up and we'll get less PHP-Nuke hacks, and more decent software.

I have a dream today.

Name: Anonymous 2008-08-25 19:21

>>19
At first this was pretty cool to play with during class.  I was able to create a function that would sum all values of a function from a to b with an optional step size.  However, trouble occurred with nested lambda statements.  It just didn't work.  Also, Sussman's interpretation of cons, car, and cdr in one of his lectures doesn't work:

(define (cons a b)
  (lambda (m)
    (cond ((= m 0) a)
      ((= m 1) b)
      (else (error "Huh?")))))

(define (car x)
  (x 0))

(define (cdr x)
  (x 1))

It just doesn't work.  Still could be a bit useful for simple things.  Just don't be expecting a fully complex lisp system in C.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List