Class
19 pages.
A class is an in-memory shape — data plus the behaviour that belongs to it — and it never touches the database. That is the whole distinction from an…
One new instance of every class in the app's composition — its own and every package's — that implements the interface T. How a kit finds every…
A class can derive from another class with `class Circle : Shape`, inheriting its fields and its methods to any depth. A value of the derived type…
`==` on two `class` values asks whether they are the SAME INSTANCE, exactly as C# does: two objects built separately are two objects, however equal…
`with` makes a COPY of a class value and replaces the fields you name. Everything you do not name comes from the value you copied, and the original…
A class can declare type parameters, so one shape serves every type it is used with instead of being copied per entity. The type argument is written…
An `interface` declares what a type must do without saying how — methods and property contracts, and no state. A member may carry a default body…
A class can declare several methods with the same name, as long as they differ in their parameter types. Each call picks the one that fits its…
A `record` is a class whose values compare by their MEMBERS rather than by identity, exactly as a C# record does. The positional form `record…
A class can hold many values in one field — `string[]`, `int[]`, `List<Tag>`, `HashSet<string>`, `Dictionary<string, int>`. The element may be a…
A `struct` is a VALUE type, as in C#: assigning one, passing one, returning one or putting one in a list stores a COPY, so a change through one name…
`s is Circle` asks which type a value actually is at run time, answering by the value's own type rather than the type it is declared as. A derived…
`params` lets a method be called with any number of trailing arguments — `Total(1m, 2m, 3m)` — which arrive as one array. It must be the last…
A `readonly` field can be assigned only where it is declared or in a constructor of the class that declares it. Everywhere else — a method of the…
A `static` member belongs to the type rather than to any instance and is reached on the type name — `Money.Round(x)`, `Limits.Max`. A static method…
Behaviour attached to a class — a method with a receiver, called as value.Method(). Classes are in-memory values, so a method is the natural place…
A class member that reads and writes like a field but runs a body on access — a computed value, a validating setter, or an auto-property whose…
A class declares one constructor — its name is the class name, it takes no return type, and it runs when you write new T(args). The constructor body…
A `native class` is a provider whose behaviour is a .NET assembly its package ships. It is declared in Osy# for what the platform needs to know…