Syntactic Confectionery Delight | |
PerlMonks |
Re: Lisp is More Evaluatableby mikfire (Deacon) |
on May 24, 2001 at 08:13 UTC ( [id://82817]=note: print w/replies, xml ) | Need Help?? |
I may be approaching this a little simplisticly, but I do not usually think of using a function reference as eval'ing ( pardon me while I make up a few words ).
The reason eval $x; doesn't "work" is that you are using a reference in scalar context, which has the well defined behaviour of stringifying the reference. I like this feature - it makes it easy to figure out how to access information deep withing a complex data structure. The $x->() format tells perl to dereference instead of stringify. This is again a standard syntax in perl. $x->{foo} access that key from a hash reference. Similarly from an array reference. Why do you expect a different syntax simply because it is a function reference? eval is there for two purposes:
I am not a perl fanatic. I fully recognize each language has its purpose. I have never used lisp in any sense other than a college class, but I thought it was pretty fun. If you understand lisp better than perl, and it does the job you need, than by all means use it. Comparing one language to another seems pretty useless to me - each language is designed to solve a unique problem space. Would you also claim that a hammer is better than a screw driver? I guess I am asking, with respect, what the point of this node was?
In Section
Meditations
|
|