Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Re (tilly) 1: Context-Sensitive Subroutine Dispatch

by chromatic (Archbishop)
on Dec 16, 2001 at 12:13 UTC ( [id://132320]=note: print w/replies, xml ) Need Help??


in reply to Re (tilly) 1: Context-Sensitive Subroutine Dispatch
in thread Context-Sensitive Subroutine Dispatch

I see the point you are making, and agree in many cases. On the other hand, I think it's interesting to play with the idea of context-sensitive polymorphism (in a sense). It's not a language feature available outside the core and magic variables, but it's emulatable. As thpfft points out, this idea lends itself to several things. This fills a slightly different niche than Want, though they could certainly be used together. Perhaps version 0.03?

As a practical matter, I can see where it would be useful to disallow certain (expensive) functions to be called in void context, or to avoid certain operations. Maybe it's just the functional programmer in me. In most cases, it's certainly not necessary. When has that stopped us from doing something interesting?

The point about verifying parameters is well taken, and I'll definitely add that. Thanks for the comments.

  • Comment on Re: Re (tilly) 1: Context-Sensitive Subroutine Dispatch

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (6)
As of 2024-04-25 07:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found