Warning: Parameter 3 to processTexinfoTag() expected to be a reference, value given in /Users/gambit/Sites/wiki/includes/parser/Parser.php on line 3333Documentation:Special form define-record-type - Gambit wiki

There is also an [http://www.schemespheres.org/guides/en/object-systems extensive documentation made for SchemeSpheres] that you might find useful as well.

Line 98:

Line 100:

*** ERROR IN (console)@4.1 -- Macro name can't be used as a variable: bar-a

*** ERROR IN (console)@4.1 -- Macro name can't be used as a variable: bar-a

-

TODO other define-type's parameters:

*'''constant-constructor:'''

*'''constant-constructor:'''

+

Specifies a constructor that creates constants (available at compile-time). Can be used only with non-generative type definitions.

+

*'''implementer:'''

*'''implementer:'''

+

Adds a definition of the parameterless macro "implementer-name" that expands to all non-macro definitions produced by the define-type. This is useful to distinguish the two binding times (compile-time and run time). It can be used to avoid duplicate definitions when a file containing a define-type is included in multiple files (I think this problem should be solved through the module system, but this is how the problem can be solved without a module system). For example, let's say the file point-def.scm contains the definition of the point type, and files a.scm and b.scm need to manipulate points.

+

*'''type-exhibitor:'''

*'''type-exhibitor:'''

+

If specified will create a function with no arguments that returns the type descriptor of this type without the need of creating an instance.

+

*'''opaque:'''

*'''opaque:'''

+

This flag causes a change in the behavior of equal? and equal?-hash. When the opaque: flag is not used, two structures are equal? if they have the same type and each field is equal? in both structures. When the opaque: flag is used, two structures are equal? only if they are eq? (i.e. the same instance).

Specifies a constructor that creates constants (available at compile-time). Can be used only with non-generative type definitions.

implementer:

Adds a definition of the parameterless macro "implementer-name" that expands to all non-macro definitions produced by the define-type. This is useful to distinguish the two binding times (compile-time and run time). It can be used to avoid duplicate definitions when a file containing a define-type is included in multiple files (I think this problem should be solved through the module system, but this is how the problem can be solved without a module system). For example, let's say the file point-def.scm contains the definition of the point type, and files a.scm and b.scm need to manipulate points.

type-exhibitor:

If specified will create a function with no arguments that returns the type descriptor of this type without the need of creating an instance.

opaque:

This flag causes a change in the behavior of equal? and equal?-hash. When the opaque: flag is not used, two structures are equal? if they have the same type and each field is equal? in both structures. When the opaque: flag is used, two structures are equal? only if they are eq? (i.e. the same instance).

Field attributes

read-write:

Default option. A setter procedure/macro is generated.

read-only:

No setter is generated, effectively rendering the field read-only after it is set by the constructor.

equality-test:

Default option. Testing type instances using equal? will check the values of this field as part of that test.

equality-skip:

Testing type instances using equal? will ignore the values of this field.