|
Problem:
You want to create a method that returns different things based on the caller. For example, you may want to return a read-only hash to some callers, and a read-write hash to others. Solution: You can't. Well, you can, but what you probably meant to do was use multimethods. Discussion: If you insist, the caller of a method can be determined by introspecting the context in which the method is called. Issue: Maybe a good example Problem, but what's the best Solution?
|