Implicit Evaluation with PHP

Implicit Evaluation with PHP Archives: January 2006

·

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

23 January 2006

Form Validation Library

A JavaScript form validation library. It’s not as developer-friendly as ASP.net’s, but for a language like PHP that doesn’t have anything, it’s a nice comprimise.
Read more at chrysalis.sourceforge.net

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

9 January 2006

Optimized Firefox 1.5 with Mac OS X form widgets: BeatnikPad Journal

Seems there’s finally an OSX build of Firefox with native Aqua widgets. Rest assured I’ll be trying it tonight.
Read more at www.beatnikpad.com/arch…

continue reading... » 0 Comments

6 January 2006

I used eval() today

Just as self-diagnosis is frowned upon in the medical world, I hesitate to say that my use of eval() was approriate. I’ve been working on a library to transcode HTML into another format, and it became neccessary to support PHP in addition to static HTML. I couldn’t dump to the shell and execute the file […]

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 […]

continue reading... » 0 Comments

2 January 2006

Evaluating Variables in PHP

This article covers traditional PHP evaluation. There is also an article on implicit PHP evaluation (dynamic evaluation without using eval) if you’d prefer.
I normally discuss the more advanced side of evaluation in this column, but while checking the referral logs today, I found a fair number of visitors coming from Google with searchs like “evaluating […]

continue reading... » 0 Comments

2 January 2006

Limitations of Implicit Evaluation

Implicit evaluation is a very useful thing. For the sake of anyone new to it, implicit evaluation basically lets us treat a variable’s value as an identifier.
$fn = “print”;
$fn (”hello, world!”);

$color = “red”;
$$color = “#ff0000″;
echo $red;
In many ways, it is equivelent to having C/C++’s DEFINE directive as a part of the interpretter rather than pre-processor. […]

continue reading... » 0 Comments

·