in reply to Re^2: Avoiding reference of sub optimization
in thread Avoiding reference of sub optimization

Doctor, it hurts when I do this.

I vote against Perl hiding the fact that two code references are identical and increasing memory usage to do so in order to enable a dubious use of "code reference as object".

- tye        

  • Comment on Re^3: Avoiding reference of sub optimization (notabug)

Replies are listed 'Best First'.
Re^4: Avoiding reference of sub optimization (notabug)
by LanX (Saint) on Mar 21, 2011 at 14:52 UTC
    I think everything outside your normal paths is per personal definition dubious.

    Cheers Rolf

    UPDATE: There is along list of "dubious" languages allowing the use of functions as objects. :)

      Perhaps you define "dubious" as "anything outside one's normal paths" (or my paths, if I take you literally), but I don't. You'll note that your proposed usage doesn't actually work. It failing to work is not caused because I haven't personally tried that failing experiment.

      In order for your usage to work, you'd have to break less dubious usages that are already working (as well as making Perl less efficient).

      Note that you can also make $object->() work via overloading of a less-dubious object.

      - tye