Language and Programming
Allow double as an alias for float
M ≔ Matrix2,2,datatype = double
max/min optionally return position
Objects can now inherit from other object declarations following the usual rules for single inheritance in object-oriented programming.
To inherit from an existing declared object, simply include the name of the parent object in parentheses after the object option in the declaration of the descendant object.
Example: Consider a simple definition of a Vehicle object:
You can derive a subclass of Vehicle called Car which inherits properties from Vehicle simply by including the parent object name in the object option when defining the module:
You can see that a Car is a Vehicle:
myCar ≔ ObjectCar:typemyCar, Vehicle
You can also define other objects, such as Bicycle, which inherit from Vehicle:
Notice that while a Bicycle object is a Vehicle, it is not a Car, just as you would expect:
myBike ≔ ObjectBicycle:type Bicycle, Vehicle
type Bicycle, Car
Furthermore, if you attempt to access an export such as HasAutomaticTransmission on a Bicycle object, this results in an error, since this export is only provided for a Car object:
Error, module does not export `HasAutomaticTransmission`
For more details on object inheritance, read about object creation.
Enable concatenation of a string with a constant:
Allow rand to accept floating-point intervals as input:
RealRand ≔ rand0.0 .. 1.0;
for i to 5 do RealRand end do;
The new command tablemerge allows two tables to be merged together.
T1 ≔ tablea=100,b=200:
T2≔ tablea=150, c=300:
tablemerge T1, T2
In the resulting table, the value associated to key a in T1 was overridden by the value associated to the same key in T2.
If you would prefer they be added, you can specify this by providing a custom merge function:
tablemerge T1, T2, `+`
Download Help Document