PROPERTIES - brombres/Rogue GitHub Wiki

Syntax

 class XYZ
  PROPERTIES
    name1 : Type [attributes]
    name2 = initial_value
    name3 = initial_value : Type
    name4, name5, ... : Type
    nativeC "char* st;"
  ...

Description

When an object is created, all properties that aren't explicitly set to an initial value will contain a "zero value" (0, null, false, etc.) by default.

Primitive and compound properties are value types (pass-by-value) embedded in the object while object properties are reference types (pass-by-reference) that link to other objects.

Attributes

Attribute Description
faux Acts like a real property during program analysis but no C code definition is generated. This is useful to allow direct access to a union declared in a native C property. See Value.rogue in the standard library for an example.

Native Properties

See Inline Native for information on declaring native properties and writing inline native expressions.