Autrijus asked me to summarize here what I said on IRC #perl6, and ask
Larry for another "that's all correct".

I've rephrased everything as facts/assumptions.

Array context, as provided by a signature of "Array $foo", is still
a form of scalar context, even though Array.isa(List).

    Array is a class here.

    Classes when used for context expect objects.

    Objects are references.

    Array implies ref.

    The main contexts, void, scalar and list, have nothing to do with

    Scalar context can expect a certain type of value, for example, an
    Array or a Dog.

    List context can also expect a certain type of values for its

Somewhere during our conversation, I suggested renaming scalar and list
context to singular and plural context, to avoid all the confusion.

Void context still exists and is not a form of singular or plural
context. Perhaps this should be called nullar context, although void
context works equally well for me and is not confusing because we have
no Void type.

When we really want a scalar (the thing itself), we call that Any
context or Scalar context, both forms of singular context (formerly
called scalar context).

What exactly is the difference between Scalar and Any?


Reply via email to