Skip to main content

Appendix B. Known deviations

This appendix lists the places where the 3.0 implementation does not do what the language, as specified in the chapters above, is meant to do. Each entry is a defect of the implementation: a conforming program does not depend on it, and a future release may change it. The identifiers are those of KNOWN_DEFECTS.md, which holds the symptom, the reproduction and the analysis of each.

The common trait of these deviations is that they fail silently: the program parses, loads, runs, and gives a wrong value. They are the reason why chapter 13 insists on validation and on asserting values.

B.1 Statements and expressions​

IdDeviationSpecified inWrite instead
CORE-D-6do … while runs its body once and ignores its condition§8.5while
CORE-D-7a compound assignment statement (n += 2;) assigns the right-hand side§8.3n = n + 2;
CORE-D-18n++; / --n; as a statement make the behaviour return null§8.6n = n + 1; (the update of a for is fine)
CORE-D-9for (init; ; update) without condition: the behaviour is silently not built§8.5give the condition, or while (true)
CORE-D-8an invalid condition in if / while is taken as true§8.4validate the unit
CORE-D-19a method call on a string literal gives null§9.5.2put the literal in a variable

B.2 Properties and behaviours​

IdDeviationSpecified inWrite instead
CORE-D-3in set(T x) { … } the value is always named value; the declared name is ignored§6.7declare it value
CORE-D-11an expression property that has been read can keep its earlier value§6.4read the underlying value in a behaviour
CORE-D-4a default value of an argument does not let a call omit it§7.2pass every argument; add a named creation scheme
CORE-D-13new C::name() with fewer arguments than the scheme declares does not resolve; a call must match in number§7.4pass the arguments
CORE-D-17super.name() gives null when the concept has several parents§5.3.2a helper behaviour called on this
CORE-D-10delete x does not remove x from the multi-valued properties that hold it§10.4remove, then delete
CORE-D-15new Child() creates a Parent when Child only inherits the creation scheme§5.1.3declare a creation scheme in the child

B.3 Matching​

IdDeviationSpecified inWrite instead
CORE-D-1the implicit matching set of a behaviour is typed by its first match§10.9.4one explicit set per concept
CORE-D-12the where of begin match is ignored§10.9.5filter in the match instructions
CORE-D-2end match … unmatched: someBehaviour() does not call that behaviour; the first behaviour of the concept runs§10.9.5unmatched: delete() and a single deletion scheme

B.4 Types, names and loading​

IdDeviationSpecified inWrite instead
CORE-D-5a concept type with an empty URI is reported as resolved§4.8—
CORE-D-16a namespace alias is not resolved in an annotation§3.3, §11.3write the full address in @URI
CORE-D-34loading units that import each other logs transient Unresolved type warnings§3.8none: ignore the transient ones
CORE-D-33the text rebuilt from the model is not always the text that was parsed§1.1—

B.5 Scripts​

IdDeviationSpecified inWrite instead
CORE-D-20after a second assignment, a script variable reads as null§12.7a new name for each value

B.6 Behaviours of the language that are not defects​

Some behaviours surprise a reader who comes from Java but are what the language specifies. They are collected here for convenience.

BehaviourSection
&& and `
/ and % give decimals, even between integers§9.5.1
a string is never converted to a number; 1 + "a" is an error§9.5.2
a parameter is read as parameters.x; a bare name gives null§7.2.1, §9.6.3
a behaviour of the same instance is called on this§7.4
a bare new of a concept that is not nested in the current one gives null§9.7
a path that does not resolve evaluates to null§9.8
a missing import gives null and no error§3.5.2
an unassigned primitive property holds null, not 0§4.2
[2,8] and other bounds are read as [0,*] with a warning§4.6
a type version @(1.2) is accepted and ignored§4.5
a concept instance exposes only its properties and behaviours to a path§9.6.2
an all-capitals word is a constant identifier, not a type name§2.4
a misspelled annotation is kept and does nothing§11.2