Appendix D:
Experimental Features

The features described in this chapter are experimental in the documented version/release of Daisy. They are implemented and documented here for evaluation purposes. In future versions of the language these features may be modified, incorporated into the language, discarded, or retain experimental status. You should not rely on these features to remain constant. That said, we would appreciate constructive criticism regarding their utility to help us guide the future evolution of Daisy.

Object-Oriented Features

Daisy includes object-oriented capabilities. Compound objects can be defined from built-in data types or other objects through the use of classes, subclassing and inheritance: Every such object has a structure composed of smaller elements.

Object Notation

To refer to an element of an object, use the dot notation:
Eobject . identifier
The object expression must evaluate to a valid object and the identifier must refer to a valid identifier declared in the class of the object. The whole expression evaluates to the value associated with the identifier in the object.

Quasi-Quotation

Forced Evaluation

$Eany
Placing a dollar sign before any expression in a quasi-quotation context forces evaluation.

New Primitives

Suspension Detection

%SpnHd?:[Vhead ! Vtail] => true if Vhead is a suspension
%SpnTl?:[Vhead ! Vtail] => true if Vtail is a suspension

Ports

%iport: X => [FA ! S]
FA: V => atomically appends V to the end of S
%oport: [V0 V1 V2 ...] => FB
FB: Y => strips and returns some elements from the input stream
%iport and %oport are imperative interfaces to streams. %iport takes a reference and returns a closure and a stream. The closure FA appends its argument to Lstream whenever it is applied. If FA is ever applied to X then the stream is terminated (note: X must be the same reference).

%oport takes a list or stream and returns a closure. The closure FB strips some number of elements from the front of the stream and returns them as a list. The number returned is based on the Y argument to FB:

%iport and %oport are used by the system to merge and split streams efficiently.