*. (spread attribute) operator

The spread attribute operator maps an iterable of instances through an attribute, resulting in a sequence of the attribute values.

Usage

{String+} names = {"foo", "bar", "baz"};
[Integer+] sizes = names*.size;

Description

Definition

The *. operator is defined by the comprehension:

[ for (X x in lhs) x.member ]

See the language specification for more details.

Since Ceylon 1.3.1 it is possible to spread a Java Iterable or Java array.

Polymorphism

The *. operator is not polymorphic.

Type

The result type of the lhs*.rhs operator is the sequential type of the type of the right hand operand.

See also