Re: Code References
| From: | Wez Furlong | Date: | Mon, 19 May 2003 15:06:19 +0000 |
| Subject: | Re: Code References | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-1708@lists.php.net to get a copy of this message | ||
I'm not against a fast way of performing function callbacks, but the
example that you chose wasn't an obvious thing for the human mind to parse.
Why not compromize and aim for the callable type that Andrei was talking
about, and have create_function() return one of those?
--Wez.
On Mon, 19 May 2003, Sterling Hughes wrote:
> On Mon, 2003-05-19 at 10:55, Wez Furlong wrote:
> > use perl;
>
> Python, Ruby, LISP, Java, C, whatever, all support this in some form or
> another (whether it be function pointers or code references.)
>
> >
> > This isn't exactly readable...
> >
>
> Its more readable to me. At least the concept of code references is.
> When you want to have a lot of callbacks with relatively low overhead,
> code references are the way to go (we could also have sort and friends
> cache the initial lookup, instead of call_user_func() on the function
> name over and over and over and over again, but code references are
> cleaner imho).
>
> As for anonymous functions, well, compared to create_function(), it is
> faster, neater, and allows for more possibilities.
>
> -Sterling
>
> --
> Good judgement comes from experience, and experience comes from
> bad judgement.
> - Fred Brooks
>
>
>