I hereby claim:
- I am bollenberger on github.
- I am briano (https://keybase.io/briano) on keybase.
- I have a public key ASBgt5Lps2ozqBPCZVIYcFgjOgIrNxglypd03D8suEcIhQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
<?php | |
// This will crash the PHP interpreter if run directly, but | |
// compiling it with our compiler will allow it to loop indefinitely. | |
function f() { | |
echo 'hello'; | |
return f(); | |
} |
<?php | |
// Similarly to our Scheme example, we escape from the | |
// function by calling the continuation with a return value. | |
echo callcc(function ($c) { | |
$c(6); | |
return 5; | |
}); |
(call/cc (lambda (c) | |
(c 6) | |
5)) |
(call/cc (lambda (c) (c 5)) ; Returns 5 |
(define (make-adder a) | |
(lambda (b) (+ a b))) | |
(define plus-five (make-adder 5)) | |
(plus-five 4) ; Returns 9 |
<?php | |
function make_adder($a) { | |
return function ($b) use ($a) { | |
return $a + $b; | |
}; | |
} | |
$plus_five = make_adder(5); |