Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Re: Re: Re: Re: Method Calls on multiple objects

by tilly (Archbishop)
on Mar 27, 2004 at 19:53 UTC ( [id://340290]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: Re: Method Calls on multiple objects
in thread Method Calls on multiple objects

Well since "naturally" is an aesthetic judgement, it is hard to provide a precise definition. Rather you can provide contrasting examples and get a sense of someone else's tastes.

But the reason for my comment is that Perl has enough ways to distribute actions over lists in a concise manner (map, foreach, etc, etc) that introducing a very specialized one doesn't meet the utility threshold to be worthwhile.

But if you disagree, try to produce an example where such a method would make sense, and I'll produce an example that doesn't use the method, and we can compare. If it really is natural for your problem domain, then it shouldn't be hard to come up with a good example...

  • Comment on Re: Re: Re: Re: Re: Method Calls on multiple objects

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Re: Method Calls on multiple objects
by flyingmoose (Priest) on Mar 27, 2004 at 22:11 UTC
    We are already on the same page, it seems. But you and dragonchild still don't quite realize who you are arguing with. I was using map, and I never agreed that we needed a specialized tool -- I do not like Limbic's implementation (sorry, Limbic). Perhaps I misinterpreted your response based on the fact that I was the parent of your post...which was definitely confusing. I was saying "yes there is a need to sometimes call methods against a list", of which the whole thread got really convoluted rather quickly when I was trying to debate a percieved statement that "I can never see a reason to call a method on every object in a list", which didn't quite make sense.

    If Chewbacca lives on Endor, I say we forget about the whole sub-thread.

      We knew who we were arguing with, but (as often happens) the argument seems to be over a misconception.

      I was objecting to creating a method to call methods against a list. There are reasons to call a method on all things in a list, I have done it for any number of reasons. A sample reason why you might is some sort of notification system. All objects that have said they are watching some event have to have a logging method called on them. But the built-ins in Perl resolve the problem adequately enough that I see no reason to build a method especially to do it.

      I didn't realize that you were arguing just for the utility of calling a method on a list of things. And so we were talking past each other.

      I'm glad to have that resolved. ;-)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-04-24 07:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found