Source Code

The Ceylon language module containing the core types referred to in the language specification.

By: Gavin King, Tom Bentley, Tako Schotanus, Stephane Epardaud, Enrique Zamudio
Packages
ceylon.language

The Ceylon language package.

ceylon.language.metamodel

The Ceylon language package.

By: Gavin King, Tom Bentley, Tako Schotanus, Stephane Epardaud, Enrique Zamudio
Attributes
bottomSource Code
shared Bottom bottom

A value that is assignable to any type, but that results in an exception when evaluated. This is most useful for generating members in an IDE.

equalSource Code
shared equal equal

The value is exactly equal to the given value.

By: Gavin
exhaustedSource Code
shared exhausted exhausted

A value that indicates that an Iterator is exhausted and has no more values to return.

See also: Iterator<Element>
falseSource Code
shared false false

A value representing falsity in Boolean logic.

By: Gavin
infinitySource Code
shared Float infinity

An instance of Float representing positive infinity ∞.

languageSource Code
shared language language

Contains information about the language

By: The Ceylon Team
largerSource Code
shared larger larger

The value is larger than the given value.

By: Gavin
nullSource Code
shared null null

The null value.

By: Gavin
processSource Code
shared process process

Represents the current process (instance of the virtual machine).

By: Gavin, Tako
smallerSource Code
shared smaller smaller

The value is smaller than the given value.

By: Gavin
trueSource Code
shared true true

A value representing truth in Boolean logic.

By: Gavin
Methods
abstractSource Code
shared Nothing abstract()

Annotation to mark a class as abstract. abstract classes may not be directly instantiated.

actualSource Code
shared Nothing actual()

Annotation to mark a type or member as overriding an other type/member.

anySource Code
shared Boolean any(Boolean... values)

true if any of the given values is true, otherwise false

See also:
arraySource Code
shared Array<Element> array<Element>(Element... elements)

Create an array containing the given elements. If no elements are provided, create an empty array of the given element type.

arrayOfNoneSource Code
shared Array<Element>&None<Element> arrayOfNone<Element>()

Create an empty array of the given element type.

arrayOfSizeSource Code
shared Array<Element> arrayOfSize<Element>(Integer size, Element element)

Create an array of the specified size, populating every index with the given element. If the specified size is smaller than 1, return an empty array of the given element type.

Parameters:
  • size

    The size of the resulting array. If the size is non-positive, an empty array will be created.

  • element

    The element value with which to populate the array. All elements of the resulting array will have the same value.

arrayOfSomeSource Code
shared Array<Element>&Some<Element> arrayOfSome<Element>(Sequence<Element> elements)

Create a nonempty array with the elements of the given sequence.

Parameters:
  • elements

    A nonempty sequence containing the elements.

binSource Code
shared Integer bin(String number)

Annotation to specify a binary literal.

bySource Code
shared Nothing by(String... authors)

Annotation to specify API authors.

byDecreasingSource Code
shared Comparison? byDecreasing<Element, Value>(Value? comparable(Element e))(Element x, Element y)

A comparator which orders elements in decreasing order according to the Comparable returned by the given comparable() function.

See also: byIncreasing
byIncreasingSource Code
shared Comparison? byIncreasing<Element, Value>(Value? comparable(Element e))(Element x, Element y)

A comparator which orders elements in increasing order according to the Comparable returned by the given comparable() function.

See also: byDecreasing
byItemSource Code
shared Comparison? byItem<Item>(Comparison? comparing(Item x, Item y))(Entry<Key,Item> x, Entry<Key,Item> y)

A comparator for Entrys which compares their items according to the given comparing() function.

See also: byKey
byKeySource Code
shared Comparison? byKey<Key>(Comparison? comparing(Key x, Key y))(Entry<Key,Item> x, Entry<Key,Item> y)

A comparator for Entrys which compares their keys according to the given comparing() function.

See also: byItem
classNameSource Code
shared String className(Object obj)

Return the name of the concrete class of the given object.

coalesceSource Code
shared Iterable<Element> coalesce<Element>(Element... values)

Return a sequence containing the given values which are not null. If there are no values which are not null, return an empty sequence.

combineSource Code
shared Iterable<Element> combine<Result, Element, OtherElement>(Result combination(Element element, OtherElement otherElement), Iterable<Element> elements, Iterable<Element> otherElements)

Applies a function to each element of two Iterables and returns an Iterable with the results.

By: Gavin, Enrique Zamudio
copyArraySource Code
shared Void copyArray<Element>(Array<Element> source, Array<Element> target, Integer from, Integer to, Integer length)

Efficiently copy the elements of one array to another array.

Parameters:
  • source

    The source array containing the elements to be copied.

  • target

    The target array into which to copy the elements.

  • from

    The index of the first element to copy in the source array.

  • to

    The index in the target array into which to copy the first element.

  • length

    The number of elements to copy.

countSource Code
shared Integer count(Boolean... values)

A count of the number of true items in the given values.

defaultSource Code
shared Nothing default()

Annotation to mark a type or member whose implementation may be overridden by subtypes. Non-default declarations may not be overridden.

deprecatedSource Code
shared Nothing deprecated(String? reason)

Annotation to mark types or members which should not be used anymore.

docSource Code
shared Nothing doc(String description)

Annotation to specify API documentation on a type or member.

elementsSource Code
shared Iterable<Element> elements<Element>(Element... elements)

The given elements (usually a comprehension), as an Iterable.

emptyOrSingletonSource Code
shared Element[] emptyOrSingleton<Element>(Element? element)

A Singleton if the given element is non-null, otherwise Empty.

See also: Singleton<Element>, Empty
entriesSource Code
shared Iterable<Element> entries<Element>(Element... elements)

Produces a sequence of each index to element Entry for the given sequence of values.

equalToSource Code
shared Boolean equalTo<Element>(Element val)(Element element)

Returns a partial function that will compare an element to any other element and returns true if they're equal. This is useful in conjunction with methods that receive a predicate function.

everySource Code
shared Boolean every(Boolean... values)

true if every one of the given values is true, otherwise false.

See also:
exportSource Code
shared Nothing export()
firstSource Code
shared Element? first<Element>(Element... elements)

The first of the given elements (usually a comprehension), if any.

forItemSource Code
shared Result forItem<Item, Result>(Result resulting(Item item))(Entry<Key,Item> entry)

A function that returns the result of the given resulting() function on the item of a given Entry.

See also: forKey
forKeySource Code
shared Result forKey<Key, Result>(Result resulting(Key key))(Entry<Key,Item> entry)

A function that returns the result of the given resulting() function on the key of a given Entry.

See also: forItem
formalSource Code
shared Nothing formal()

Annotation to mark a type or member whose implementation must be provided by subtypes.

greaterThanSource Code
shared Boolean greaterThan<Element>(Element val)(Element element)

Returns a partial function that will compare an element to any other element and returns true if the compared element is greater than its element. This is useful in conjunction with methods that receive a predicate function.

hexSource Code
shared Integer hex(String number)

Annotation to specify a hexadecimal literal.

identicalSource Code
shared Boolean identical(Identifiable x, Identifiable y)

Determine if the arguments are identical. Equivalent to x===y.

See also: identityHash
identityHashSource Code
shared Integer identityHash(Identifiable x)

Return the system-defined identity hash value of the given value. This hash value is consistent with identity equality.

See also: identical
joinSource Code
shared Element[] join<Element>(Iterable<Element>... iterables)

Given a list of iterable objects, return a new sequence of all elements of the all given objects. If there are no arguments, or if none of the arguments contains any elements, return the empty sequence.

See also: SequenceBuilder<Element>
largestSource Code
shared Element largest<Element>(Element x, Element y)

Given two Comparable values, return largest of the two.

See also: Comparable<Other>, smallest, max
lessThanSource Code
shared Boolean lessThan<Element>(Element val)(Element element)

Returns a partial function that will compare an element to any other element and returns true if the compared element is less than its element. This is useful in conjunction with methods that receive a predicate function.

licenseSource Code
shared Nothing license(String url)

Annotation to specify the URL of the license of a module or package.

maxSource Code
shared Null|Value max<Value, Null>(Iterable<Element>&ContainerWithFirstElement<Element,Null> values)

Given a nonempty sequence of Comparable values, return the largest value in the sequence.

See also: Comparable<Other>, min, largest
minSource Code
shared Null|Value min<Value, Null>(Iterable<Element>&ContainerWithFirstElement<Element,Null> values)

Given a nonempty sequence of Comparable values, return the smallest value in the sequence.

See also: Comparable<Other>, max, smallest
optionalSource Code
shared Nothing optional()
parseFloatSource Code
shared Float? parseFloat(String string)

The Float value of the given string representation of a decimal number or null if the string does not represent a decimal number.

The syntax accepted by this method is the same as the syntax for a Float literal in the Ceylon language except that it may optionally begin with a sign character (+ or -).

parseIntegerSource Code
shared Integer? parseInteger(String string)

The Integer value of the given string representation of an integer, or null if the string does not represent an integer or if the mathematical integer it represents is too large in magnitude to be represented by an Integer.

The syntax accepted by this method is the same as the syntax for an Integer literal in the Ceylon language except that it may optionally begin with a sign character (+ or -).

printSource Code
shared Void print(Void line)

Print a line to the standard output of the virtual machine process, printing the given value's string, or «null» if the value is null.

This method is a shortcut for:

process.writeLine(line?.string else "«null»")

and is intended mainly for debugging purposes.

By: Gavin
See also:
seeSource Code
shared Nothing see(Void... programElements)

Annotation to specify API references to other related API members.

sharedSource Code
shared Nothing shared()

Annotation to mark a type or member as shared. Annotating them with shared makes them visible outside the current unit of code.

smallestSource Code
shared Element smallest<Element>(Element x, Element y)

Given two Comparable values, return smallest of the two.

See also: Comparable<Other>, largest, min
sortSource Code
shared Element[] sort<Element>(Element... elements)

Sort a given elements, returning a new sequence.

See also: Comparable<Other>
stringSource Code
shared String string(Character... characters)

Create a new string containing the given characters.

sumSource Code
shared Value sum<Value>(Sequence<Element> values)

Given a nonempty sequence of Summable values, return the sum of the values.

See also: Summable<Other>
taggedSource Code
shared Nothing tagged(String... tags)

Annotation to categorize the API by tag.

throwsSource Code
shared Nothing throws(Void type, String? when)

Annotation to mark methods as throwing an exception.

variableSource Code
shared Nothing variable()

Annotation to mark an attribute as variable. variable attributes must be assigned with := and can be reassigned over time.

zipSource Code
shared Entry<Key,Item>[] zip<Key, Item>(Iterable<Element> keys, Iterable<Element> items)

Given two sequences, form a new sequence consisting of all entries where, for any given index in the resulting sequence, the key of the entry is the element occurring at the same index in the first sequence, and the item is the element occurring at the same index in the second sequence. The length of the resulting sequence is the length of the shorter of the two given sequences.

Thus:

zip(xs,ys)[i]==xs[i]->ys[i]

for every 0<=i<min({xs.size,ys.size}).

Interfaces
BinarySource Code
shared Binary<Other>

Abstraction of numeric types that consist in a sequence of bits, like Integer.

CallableSource Code
shared Callable<Return,CallableArgument>

A reference to a method or function.

CastableSource Code
shared Castable<Types>

Abstract supertype for types which can be automatically widened to a different type in numeric operator expressions. The type argument is a union of wider types to which the subtype can be cast.

For example, Integer satisfies Castable<Integer|Float>, so Integer can be promoted to Float in an expression like -1/2.0.

CategorySource Code
shared Category

Abstract supertype of objects that contain other values, called elements, where it is possible to efficiently determine if a given value is an element. Category does not satisfy Container, because it is conceptually possible to have a Category whose emptiness cannot be computed.

The in operator may be used to determine if a value belongs to a Category:

if ("hello" in "hello world") { ... }
if (69 in 0..100) { ... }
if (key->value in { for (n in 0..100) n.string->n**2 }) { ... }

Ordinarily, x==y implies that x in cat == y in cat. But this contract is not required since it is possible to form a meaningful Category using a different equivalence relation. For example, an IdentitySet is a meaningful Category.

CloneableSource Code
shared Cloneable<Clone>

Abstract supertype of objects whose value can be cloned.

CloseableSource Code
shared Closeable

Abstract supertype of types which may appear as the expression type of a resource expression in a try statement.

CollectionSource Code
shared Collection<Element>

Represents an iterable collection of elements of finite size. Collection is the abstract supertype of List, Map, and Set.

A Collection forms a Category of its elements.

All Collections are Cloneable. If a collection is immutable, it is acceptable that clone produce a reference to the collection itself. If a collection is mutable, clone should produce an immutable collection containing references to the same elements, with the same structure as the original collection—that is, it should produce an immutable shallow copy of the collection.

ComparableSource Code
shared Comparable<Other>

The general contract for values whose magnitude can be compared. Comparable imposes a total ordering upon instances of any type that satisfies the interface. If a type T satisfies Comparable<T>, then instances of T may be compared using the comparison operators <, >, <=, >=, and<=>`.

The total order of a type must be consistent with the definition of equality for the type. That is, there are three mutually exclusive possibilities:

  • x<y,
  • x>y, or
  • x==y
ContainerSource Code
shared Container

Abstract supertype of objects which may or may not contain one of more other values, called elements. Container does not satisfy Category, because it is conceptually possible to have a container where the contains() operation is prohibitively inefficient. Container does not define a size, since it is possible to have a container of infinite or uncomputable size.

ContainerWithFirstElementSource Code
shared ContainerWithFirstElement<Element,Null>

Abstract supertype of containers which provide an operation for accessing the first element, if any. A container which may or may not be empty is a ContainerWithFirstElement<Element,Nothing>. A container which is always empty is a ContainerWithFirstElement<Bottom,Nothing>. A container which is never empty is a ContainerWithFirstElement<Element,Bottom>.

CorrespondenceSource Code
shared Correspondence<Key,Item>

Abstract supertype of objects which associate values with keys. Correspondence does not satisfy Category, since in some cases—List, for example—it is convenient to consider the subtype a Category of its values, and in other cases—Map, for example—it is convenient to treat the subtype as a Category of its entries.

The item corresponding to a given key may be obtained from a Correspondence using the item operator:

value bg = settings["backgroundColor"] else white;

The item() operation and item operator result in an optional type, to reflect the possibility that there is no item for the given key.

EmptySource Code
shared Empty

A sequence with no elements. The type of the expression {}.

ExponentiableSource Code
shared Exponentiable<This,Other>

Abstraction of numeric types that may be raised to a power. Note that the type of the exponent may be different to the numeric type which can be exponentiated.

FixedSizedSource Code
shared FixedSized<Element>

Represents a fixed-size collection which may or may not be empty.

IdentifiableSource Code

The abstract supertype of all types with a well-defined notion of identity. Values of type Identifiable may be compared using the === operator to determine if they are references to the same object instance. For the sake of convenience, this interface defines a default implementation of value equality equivalent to identity. Of course, subtypes are encouraged to refine this implementation.

IntegralSource Code
shared Integral<Other>

Abstraction of integral numeric types. That is, types with no fractional part, including Integer. The division operation for integral numeric types results in a remainder. Therefore, integral numeric types have an operation to determine the remainder of any division operation.

InvertableSource Code
shared Invertable<Inverse>

Abstraction of types which support a unary additive inversion operation. For a numeric type, this should return the negative of the argument value. Note that the type parameter of this interface is not restricted to be a self type, in order to accommodate the possibility of types whose additive inverse can only be expressed in terms of a wider type.

IterableSource Code
shared Iterable<Element>

Abstract supertype of containers whose elements may be iterated. An iterable container need not be finite, but its elements must at least be countable. There may not be a well-defined iteration order, and so the order of iterated elements may not be stable.

An instance of Iterable may be iterated using a for loop:

for (c in "hello world") { ... }

Iterable and its subtypes define various operations that return other iterable objects. Such operations come in two flavors:

  • Lazy operations return a “view” of the receiving iterable object. If the underlying iterable object is mutable, then changes to the underlying object will be reflected in the resulting view. Lazy operations are usually efficient, avoiding memory allocation or iteration of the receiving iterable object.

  • Eager operations return an immutable object. If the receiving iterable object is mutable, changes to this object will not be reflected in the resulting immutable object. Eager operations are often expensive, involving memory allocation and iteration of the receiving iterable object.

Lazy operations are preferred, because they can be efficiently chained. For example:

string.filter((Character c) c.letter).map((Character c) c.uppercased)

is much less expensive than:

string.select((Character c) c.letter).collect((Character c) c.uppercased)

Furthermore, it is always easy to produce a new immutable iterable object given the view produced by a lazy operation. For example:

{ string.filter((Character c) c.letter).map((Character c) c.uppercased)... }

Lazy operations normally return an instance of Iterable or Map.

However, there are certain scenarios where an eager operation is more useful, more convenient, or no more expensive than a lazy operation, including:

  • sorting operations, which are eager by nature,
  • operations which preserve emptiness/nonemptiness of the receiving iterable object.

Eager operations normally return a sequence.

IteratorSource Code
shared Iterator<Element>

Produces elements of an Iterable object. Classes that implement this interface should be immutable.

ListSource Code
shared List<Element>

Represents a collection in which every element has a unique non-negative integer index.

A List is a Collection of its elements, and a Correspondence from indices to elements.

Direct access to a list element by index produces a value of optional type. The following idiom may be used instead of upfront bounds-checking, as long as the list element type is a non-null type:

value char = "hello world"[index];
if (exists char) { /*do something*/ }
else { /*out of bounds*/ }

To iterate the indexes of a List, use the following idiom:

for (i->char in "hello world".indexed) { ... }
MapSource Code
shared Map<Key,Item>

Represents a collection which maps keys to items, where a key can map to at most one item. Each such mapping may be represented by an Entry.

A Map is a Collection of its Entrys, and a Correspondence from keys to items.

The prescence of an entry in a map may be tested using the in operator:

if ("lang"->"en_AU" in settings) { ... }

The entries of the map may be iterated using for:

for (key->item in settings) { ... }

The item for a key may be obtained using the item operator:

String lang = settings["lang"] else "en_US";
NoneSource Code
shared None<Element>

A fixed-size collection with no elements.

NumberSource Code
shared Number

Abstraction of numbers. Numeric operations are provided by the subtype Numeric. This type defines operations which can be expressed without reference to the self type Other of Numeric.

NumericSource Code
shared Numeric<Other>

Abstraction of numeric types supporting addition, subtraction, multiplication, and division, including Integer and Float. Additionally, a numeric type is expected to define a total order via an implementation of Comparable.

OrdinalSource Code
shared Ordinal<Other>

Abstraction of ordinal types, that is, types with successor and predecessor operations, including Integer and other Integral numeric types. Character is also considered an ordinal type. Ordinal types may be used to generate a Range.

RangedSource Code
shared Ranged<Index,Span>

Abstract supertype of ranged objects which map a range of Comparable keys to ranges of values. The type parameter Span abstracts the type of the resulting range.

A span may be obtained from an instance of Ranged using the span operator:

print("hello world"[0..5])
ScalarSource Code
shared Scalar<Other>

Abstraction of numeric types representing scalar values, including Integer and Float.

SequenceSource Code
shared Sequence<Element>

A nonempty, immutable sequence of values. A sequence of values may be formed using braces:

value worlds = { "hello", "world" };
value cubes = { for (n in 0..100) n**3 };

The union type Empty|Sequence<Element>, abbreviated Element[], represents a possibly-empty sequence. The if (nonempty ...) construct may be used to obtain an instance of Sequence from a possibly-empty sequence:

Integer[] nums = ... ;
if (nonmpty nums) {
    Integer first = nums.first;
    Integer max = max(nums);
    Sequence<Integer> squares = nums.collect((Integer i) i**2));
    Sequence<Integer> sorted = nums.sort(byIncreasing((Integer i) i));
}

Operations like first, max(), collect(), and sort(), which polymorphically produce a nonempty or non-null output when given a nonempty input are called emptiness-preserving.

SetSource Code
shared Set<Element>

A collection of unique elements.

A Set is a Collection of its elements.

Sets may be the subject of the binary union, intersection, exclusive union, and complement operators |, &, ^, and ~.

SizedSource Code
shared Sized

Abstract supertype of Containers with a finite number of elements, where the number of elements can be efficiently determined.

SomeSource Code
shared Some<Element>

A fixed-sized, non-empty collection.

SummableSource Code
shared Summable<Other>

Abstraction of types which support a binary addition operator. For numeric types, this is just familiar numeric addition. For strings, it is string concatenation. In general, the addition operation should be a binary associative operation.

Classes
ArraySource Code
shared abstract Array<Element>

A fixed-size array of elements. An array may have zero size (an empty array). Arrays are mutable. Any element of an array may be set to a new value.

This class is provided primarily to support interoperation with Java, and for some performance-critical low-level programming tasks.

BooleanSource Code
shared abstract Boolean

A type capable of representing the values true and false of Boolean logic.

ChainedIteratorSource Code
shared ChainedIterator<Element,Other>

An Iterator that returns the elements of two Iterables, as if they were chained together.

CharacterSource Code
shared abstract Character

A 32-bit Unicode character.

ComparisonSource Code
shared abstract Comparison

The result of a comparison between two Comparable objects.

EntrySource Code
shared Entry<Key,Item>

A pair containing a key and an associated value called the item. Used primarily to represent the elements of a Map.

FinishedSource Code
shared abstract Finished

The type of the value that indicates that an Iterator is exhausted and has no more values to return.

FloatSource Code
shared abstract Float

A 64-bit floating point number. A Float is capable of approximately representing numeric values between 2-1022 and (2-2-52)×21023, along with the special values infinity and -infinity, and undefined values (Not a Number). Zero is represented by distinct instances +0, -0, but these instances are equal. An undefined value is not equal to any other value, not even to itself.

IdentifiableObjectSource Code
shared abstract IdentifiableObject

The default superclass when no superclass is explicitly specified using extends. For the sake of convenience, this class inherits a default definition of value equality from Identifiable.

IntegerSource Code
shared abstract Integer

A 64-bit integer (or the closest approximation to a 64-bit integer provided by the underlying platform).

LazyListSource Code
shared LazyList<Element>

An implementation of List that wraps an Iterable of elements. All operations on this List are performed on the Iterable.

LazyMapSource Code
shared LazyMap<Key,Item>

A Map implementation that wraps an Iterable of entries. All operations, such as lookups, size, etc. are performed on the Iterable.

LazySetSource Code
shared LazySet<Element>

An implementation of Set that wraps an Iterable of elements. All operations on this Set are performed on the Iterable.

NothingSource Code
shared abstract Nothing

The type of the null value. Any union type of form Nothing|T is considered an optional type, whose values include null. Any type of this form may be written as T? for convenience.

ObjectSource Code
shared abstract Object

The abstract supertype of all types representing definite values. Any two Objects may be compared for value equality using the == and != operators:

true==false
1=="hello world"
"hello"+ " " + "world"=="hello world"
Singleton("hello world")=={ "hello world" }

However, since Nothing is not a subtype of Object, the value null cannot be compared to any other value using ==. Thus, value equality is not defined for optional types. This neatly voids the problem of deciding the value of the expression null==null, which is simply illegal.

RangeSource Code
shared Range<Element>

Represents the range of totally ordered, ordinal values generated by two endpoints of type Ordinal and Comparable. If the first value is smaller than the last value, the range is increasing. If the first value is larger than the last value, the range is decreasing. If the two values are equal, the range contains exactly one element. The range is always nonempty, containing at least one value.

A range may be produced using the .. operator:

for (i in min..max) { ... }
if (char in `A`..`Z`) { ... }
SequenceAppenderSource Code
shared SequenceAppender<Element>

This class is used for constructing a new nonempty sequence by incrementally appending elements to an existing nonempty sequence. The existing sequence is not modified, since Sequences are immutable. This class is mutable but threadsafe.

SequenceBuilderSource Code
shared SequenceBuilder<Element>

Since sequences are immutable, this class is used for constructing a new sequence by incrementally appending elements to the empty sequence. This class is mutable but threadsafe.

SingletonSource Code
shared Singleton<Element>

A sequence with exactly one element.

StringSource Code
shared abstract String

A string of characters. Each character in the string is a 32-bit Unicode character. The internal UTF-16 encoding is hidden from clients.

A string is a Category of its Characters, and of its substrings:

`w` in greeting 
"hello" in greeting

Strings are summable:

String greeting = "hello" + " " + "world";

They are efficiently iterable:

for (char in "hello world") { ... }

They are Lists of Characters:

value char = "hello world"[5];

They are ranged:

String who = "hello world"[6...];

Note that since string[index] evaluates to the optional type Character?, it is often more convenient to write string[index..index], which evaluates to a String containing a single character, or to the empty string “” if index refers to a position outside the string.

The string() function makes it possible to use comprehensions to transform strings:

string(for (s in "hello world") if (s.letter) s.uppercased)

Since a String has an underlying UTF-16 encoding, certain operations are expensive, requiring iteration of the characters of the string. In particular, size requires iteration of the whole string, and item(), span(), and segment() require iteration from the beginning of the string to the given index.

StringBuilderSource Code

Since strings are immutable, this class is used for constructing a string by incrementally appending characters to the empty string. This class is mutable but threadsafe.

VoidSource Code
shared abstract Void

The abstract supertype of all types. A value of type Void may be a definite value of type Object, or it may be the null value. A method declared void is considered to have the return type Void.

Note that the type Bottom, representing the intersection of all types, is a subtype of all types.

equalSource Code
shared equal

The value is exactly equal to the given value.

exhaustedSource Code
shared exhausted

A value that indicates that an Iterator is exhausted and has no more values to return.

falseSource Code
shared false

A value representing falsity in Boolean logic.

languageSource Code
shared language

Contains information about the language

largerSource Code
shared larger

The value is larger than the given value.

nullSource Code
shared null

The null value.

processSource Code
shared process

Represents the current process (instance of the virtual machine).

smallerSource Code
shared smaller

The value is smaller than the given value.

trueSource Code
shared true

A value representing truth in Boolean logic.

Exceptions
ExceptionSource Code
shared Exception

The supertype of all exceptions. A subclass represents a more specific kind of problem, and may define additional attributes which propagate information about problems of that kind.

NegativeNumberExceptionSource Code

Thrown when a negative number is not allowed.

OverflowExceptionSource Code

Thrown when a mathematical operation caused a number to overflow from its bounds.

RecursiveInitializationExceptionSource Code

Thrown when name could not be initialized due to recursive access during initialization.