-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thursday 22 April 2004 06:06 pm, Sasha Pachev wrote:
> Perl/PHP are able to create a function on the fly through eval. One of the
> first programs I wrote when I was learning C took a mathematical function
> definition from a user and plotted a graph of it.

Not just through eval itself, you can do many other things in Perl (the part I 
can speak about).  Perl borrowed a lot from functional languages like this, 
and it provides some very impressive tools.  For instance, when building 
Classes, I will often take advantage of the AUTOLOAD system for getter/setter 
type methods.  So instead of having to write each one, I write a generic 
routine.  When I call that method, and it isn't found, it will check the 
autoload before giving an error, my code steps in for the job.  Now to make 
it perform better, it also takes the opportunity to install this newly 
compiled method directly into the symbol table, so later uses do not take the 
autoload penatly (slight as it is).

This is just one simple example of the code defining itself, and is dang 
useful.

- -- 
- --
Jayce^
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAiIJKA10/0O8cAHgRAhEdAJwIZu5nTN1yQmk4E12QzZW672zFLgCfQebQ
VFSjuYfa8ftYOeSy4PUJ3gE=
=7hkZ
-----END PGP SIGNATURE-----

____________________
BYU Unix Users Group
http://uug.byu.edu/
___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list

Reply via email to