What it is, fundamentally, is information that propagates into functions, which can affect the behavior of the function if the code chooses to examine and act on it.
In Perl 6 we're moving away from that notion, because multi dispatch doesn't allow that concept to work very well (and which is why I proposed to get rid of want(), which tells you that context).
Consider for example
multi sub a(Str $x) { ... } multi sub a(Bool $x) { ... } a(b()); # is b() here in Bool or in Str context?
Instead contexts are common type coercions to which all (or nearly all) objects know how to respond. So when in Perl 5 a function would ask for its context, in Perl 6 it returns an object instead which behaves appropriately in all contexts.
In reply to Re: Contexts and Perl 6
by moritz
in thread Contexts and Perl 6
by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |