Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^4: Refactor method calls or not?

by Aristotle (Chancellor)
on Jan 21, 2002 at 03:56 UTC ( [id://140269]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: Refactor method calls or not?
in thread Refactor method calls or not?

Ohhh duh - I should have read his code closer :-). I think tilly's code example is nearly exactly what you want. Granted, it is indeed not quite as effortless as the macro in LISP and definitely less pretty.

Makeshifts last the longest.

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Refactor method calls or not?
by hding (Chaplain) on Jan 21, 2002 at 05:22 UTC

    Indeed, Tilly's node gives essentially the same solution to the problem in Perlish form, but I didn't see it until after I put mine up. (It's also the kind of solution I think it would be easier to think of in Perl if one also knew Lisp - which Tilly does.) Hopefully there's still some value in comparing.

      You can learn an idea in any language that supports it. If it is easier to learn this kind of technique in Lisp, it is because Lisp has a high density of "expert experts". However Perlmonks is not doing too badly on that measure either.

      As for the similarity between the two solutions, they are similar and different. They are conceptually similar in that you institute the idea of code that writes your functions for you. But the ways that they allow you to dynamically generate code are completely unrelated mechanisms, and the difference has implications for memory usage, run-time performance, and flexibility. (The Lisp solution will, all else being equal, use more memory, have better run-time performance (as long as cache-misses are irrelevant), and is more flexible in what you can easily accomplish. Of course all else is not equal...)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://140269]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-23 16:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found