-
Notifications
You must be signed in to change notification settings - Fork 0
Scalar output
Leon Starr edited this page Sep 5, 2021
·
1 revision
Here is a class method signature that returns a single scalar value of type Duration:
Aircraft.ETA( waypoint : Waypoint ID ) :: Duration
It might be used inside another activity like so:
current wait time = my aircraft.ETA( waypoint : /is visited next/Waypoint.ID )
To output multiple scalar values you produce a single tuple relation where the name of each output parameter is an attribute in the relation.
The method below takes as input a Tail number and returns the angle and distance to the target.
Aircraft.Trackto( target : Tail Number ) :: ( angle : Degrees, distance : Meters )
The corresponding action language within the method looks like this:
// compute using in.target input parameter and
// assign results to data variables a and d
=>> ( angle: a, distance: d )
The =>> symbol defines an output within an activity.
Copyright 2020, 2021, 2022, 2023, 2025 © Leon Starr under MIT Open Source License
- Why they are problematic
- Instance attribute creation values
- Boolean values
- Special values
- Enumerated values
- Action block
- Statement
- Single line action
- Multiple dependent actions on a single line
- An action spread across multiple lines
- A conditional group of single line actions
- Comments
- Finding instances
- Attribute access
- Creation and deletion
- Subclass migration
- Creating a table from a class
- Creating a table with a definition
- Converting a table into a class
- Set operations on tables
- Set comparisons on tables
- Join
- Rename
- Extend
- Aggregation
- Rank
- Image
- Input values
- Signatures and name doubling
- Output values
- Execution order
- Sequential execution
- Conditional execution
- Signals
- Scrall has no for_each action
- Iteration