Re: [LONG, off-topic]] Interactive Programming (fwd)
LISP programmers are much more into writing programs which build and execute routines on the fly.
As are some perl programmers. As both a perl programmer and a lisp programer I have never had the need to use self modifing code. In fact I would consider haveing to use s-m code as a sine that I have made a mistate in my desinge.
PERL is a pretty high-level language... how do you add sub's after running the code? -Brandon Crosby
Brandon Crosby <bcrosby@mncs.k12.mn.us> writes:
PERL is a pretty high-level language... how do you add sub's after running the code?
You eval them. Perl has a construct eval( "string" ) where string can be arbitary perl code which is evaluated into the current context. That can include function definitions even I think. Adam -- Now officially an EAR violation... Have *you* exported RSA today? --> http://www.dcs.ex.ac.uk/~aba/rsa/ print pack"C*",split/\D+/,`echo "16iII*o\U@{$/=$z;[(pop,pop,unpack"H*",<> )]}\EsMsKsN0[lN*1lK[d2%Sa2/d0<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<J]dsJxp"|dc`
-----BEGIN PGP SIGNED MESSAGE----- On Mon, 20 Oct 1997, Brandon Crosby wrote:
As are some perl programmers. As both a perl programmer and a lisp programer I have never had the need to use self modifing code.
PERL is a pretty high-level language... how do you add sub's after running the code?
$evalme = 'sub { print "This is modifed code.\n" }'; eval $evalme; There are other ways. - -- Please excuse my spelling as I suffer from agraphia see the url in my header. Never trust a country with more peaple then sheep. ex-net.scum and proud You Say To People "Throw Off Your Chains" And They Make New Chains For Themselves? --Terry Pratchett -----BEGIN PGP SIGNATURE----- Version: 2.6.3i Charset: noconv iQCVAwUBNEu6MqQK0ynCmdStAQHdXwQA4ONzjWUotM3COSFwMGQBIIMoPhg5XJkT FRJRzv63Oba1rR6imBJhW0SFeCFKEpsHrg3JX/Mswo4QKCw7EhOX1Fb22LlFEZ/c ldrM1aV+Lbu469dIG219oUyIeEeBNEGASpOgMR69aToWOT5l3qk4TwYr6U+irTTd o0yebLk/n1E= =Yc1p -----END PGP SIGNATURE-----
participants (3)
-
Adam Back
-
Brandon Crosby
-
David Formosa