Implicit Evaluation with PHP Archives: Scheme
·
22 February 2007
Generating SQL Insert Queries
Its possible to generate a well formed SQL query with one line of PHP by capitalizing on lambda-style functional support.
continue reading... » 2 Comments
30 January 2007
PHP as a Lambda Language
PHP is an imperative language which supports object-oriented programming. However, it supports a number of paradigms closer to what you would expect Lisp or Scheme to allow. I’ve discussed parts of this before, but its time to put together a definitive primer. You’ll learn ways to create entire functions at run time, as well as applying them to entire arrays in a single pass. PHP will seem more LISP-like than it ever has before.
continue reading... » 7 Comments
27 September 2006
Tail Recursion in PHP
There are two types of recursion in the world: tail recursive and non-tail recursive. Non-tail recursive is the more obvious of the two and is used frequently. For instance, when dealing with any kind of hierarchical data (that which is expressed in a tree data structure) a recursive call is likely used to construct the […]
continue reading... » One Comment
8 March 2006
PScheme
It’s a big day in the development of PScheme. As of 5:07 PM on March 07 2006, tail recursion was properly implemented. It wasn’t until 5:40 that closures were handled correctly, which meant the arglist in tailrec procedures had to be conventionally backwards, but now that works too.
So the todo list still has some big […]
continue reading... » 0 Comments
26 January 2006
Re: Commentary on “Lisp is Sin”
A nice look at Lisp v C#. Yup, you can do it in C# just like you can do it in Lisp, but look at all the ugly syntax additions it takes to do it.
Lisp doesn’t let you do something no other language lets you do, but it keeps your code clean while doing it.
Read […]
continue reading... » 0 Comments
18 January 2006
PScheme
Yesterday, I mentioned the beginning of CS491, “Advanced Programming with Scheme.” Briefly, the class covers the more advanced side of Scheme and culminates in either a Scheme interpretter or compiler. The first part of the task, due within about the first three weeks, was to build a scanner and parser. So I did. Only instead […]
continue reading... » 0 Comments
17 January 2006
Scheme
Update
Alert reader Joshua C. wrote to correct my usage of the terms apply and map. Seems I had them backwards, but they’re fixed now.
I was thinking about Scheme and tried to create some of the more interesting functions in PHP. map came easily:
function map ($fnName, $list) {
$result = NULL;
foreach ($list as $key => $value) {
$result[$key] […]
continue reading... » 0 Comments
3 January 2006
steike.com Php Closures
I thought this was interesting…Read more at steike.com/PhpClosures . Basically, the author is trying to use functions in PHP as a first class entity but PHP’s function scoping doesn’t really allow it, because PHP functions aren’t quite first class.
I suspect this […]

