Skip to content

Latest commit

 

History

History
138 lines (76 loc) · 6.65 KB

clone-notation.md

File metadata and controls

138 lines (76 loc) · 6.65 KB

Construct Drafts | Clone Notation

[ Draft ]

Contents

Introduction

The Clone aspect might be a system aspect like the Value aspect, or the Object aspect of a symbol. This might be an alternative notation for it.

Clone notation could perhaps be an implicit notation for something that might not be used very often. It may already be adequately expressed, using other constructs from the spec. The idea might be set aside in this document in Construct Drafts, because the language may be able to live without it.

Structs

One construct in particular where a cloning depth of 2 might be common, could be the struct construct that might be found in other languages.

A struct might be a value type that might have multiple distict fields / values. The idea that the object itself + its values might be transferred as a whole in case of value assignment for instance.

Parameter Passing and the Clone Notation

By Value Parameter Passing and the Clone Notation

By Value parameters might mean to clone the values of an object up until a certain depth.

More complex objects passed by value might be cloned up until a certain cloning depth.

A single-value transfer might be the equivalent of a cloning operation with a depth of 1.

By Value Parameter Passing in a Diagram with the Clone Notation

The notation of a By Value cloning operation may look as follows:

The number 2 may stand for the cloning depth.

A single-value transfer might be the same as a cloning depth of 1, but the number 1 might not be shown then.

Value In Parameters and the Clone Notation

Value In parameters might also work for more complex objects. Those might then be cloned up until a certain depth.

Value In Parameters in a Diagram with the Clone Notation

A Value In parameter can also have an indication of a cloning depth, which may be displayed as follows:

Or for an unfilled-in Value In parameter:

The pictures above might display a cloning depth of 2, but any cloning depth might be used.

Here might be the expression of cloning depth for Value In parameters of inactive commands, which is basically the same notation as for active commands:

Value Out Parameters and the Clone Notation

A parameter might be either a copy of a single value, or a clone up to a certain depth.

Value Out Parameters in a Diagram with the Clone Notation

A Value Out parameter may also have an indication of a cloning depth, which might be displayed as follows:

Or with the target of the output filled in:

The pictures might above display a cloning depth of 2, but any cloning depth can be used.

This may be the expression of cloning depth for Value Out parameters of inactive commands, which is the same notation as for active commands:

Value Thru Parameters and the Clone Notation

A By Value parameter might be either a copy of a single value, but also a clone to a certain depth.

Value Thru Parameters in a Diagram with the Clone Notation

A Value Thru parameter might also have an indication of a cloning depth, which may be displayed as follows:

Or for an unfilled-in Value Thru parameter:

The pictures above may display a cloning depth of 2, but other cloning depths can be used.

Here might be the expression of cloning depth for Value Thru parameters of inactive commands, which is a similar notation as for active commands:

Parameters of Calls Directly Tied Together with the Clone Notation

When directly tying together value parameters, cloning depth might be intermixed:

Effectively, it might be the lowest cloning depth that would be transferred to the input parameter on the right. When the Value In and Value Out parameters have the same cloning depth, it may be drawn out as follows:

Loose Ideas about Parameter Passing and the Clone Notation

Passing input parameter by value might guarantee, that the operations inside a command might not affect the original object.

<< interpretation issues >>

For that reason, when a value parameter is cloned up until a certain depth, no references to original objects might be taken over by the clone. By Value clones might not have references to existing objects, but always contain entirely new objects or object references that are Nothing.