|Contents | Language Implementations | Perl6|
Represents a semantic context.
Context object supports the following operations:
It might be useful to allow multidimensional tuples by making the definition recursive,
allowing the type to be an array of
Contexts rather than typenames.
It would also be good to get rid of the third by handling overloading.
An item evaluate in
PerlArray context must return an array -- doing otherwise leads to a propagation of ugly special cases,
and breaks flattening horribly.
*prefix operator. Flattening contexts are also created implicitly in a number of places, such as when passing parameters to a sub with no parameter list, and when assigning to an array.
^on an adjacent operator. Currently unused, as it's easier to just brute-force hyper-operation during code generation.
undef, for lists/tuples, the number of elements in the tuple.
$ctxare "the same".
P6C::Context also defines the following variables:
%P6C::Context::CONTEXTmaps operator names to
Contexts or, in a few messy cases, code refs. Infix and suffix operators are named "infix X" and "suffix X" where
Xis the operator symbol. The messy cases include things like
if, which don't play well with our current notion of context. I'm not sure
ifcan ever really be handled in a standard way, since it takes an arbitrary number of parameters of particular types.