Hallo,
Could somebody please explain me these two undocumented features, namespaces and define-type? I see them a lot in the examples, but cannot find them in the manual. :-(
Thanks, -alex http://www.ventonegro.org/
Afficher les réponses par date
Alex Sandro Queiroz e Silva wrote:
Hallo,
Could somebody please explain me these two undocumented features,
namespaces
http://dynamo.iro.umontreal.ca/~gambit/wiki/index.php/Namespaces
and define-type?
define-type is the same as define-structure.
For the list of currently supported keywords, load this program: http://scheme.mine.nu/gambit/experimental/div/define-type-keywords.scm and run for example (gambit-define-type-keywords "/COMPILE/gambc-v4_2_6"). (Read it's sources to find out what it does ;).
Christian.
On Tue, 26 Aug 2008 16:27:24 +0300, Christian Jaeger christian@pflanze.mine.nu wrote:
For the list of currently supported keywords, load this program: http://scheme.mine.nu/gambit/experimental/div/define-type-keywords.scm and run for example (gambit-define-type-keywords "/COMPILE/gambc-v4_2_6"). (Read it's sources to find out what it does ;).
(constant-constructor: constructor: equality-skip: equality-test: extender: id: implementer: init: macros: opaque: predicate: prefix: printable: read-only: read-write: type-exhibitor: unprintable:)
________ Information from NOD32 ________ This message was checked by NOD32 Antivirus System for Linux Mail Servers. part000.txt - is OK http://www.eset.com
Hallo,
Cristian Baboi wrote:
On Tue, 26 Aug 2008 16:27:24 +0300, Christian Jaeger christian@pflanze.mine.nu wrote:
For the list of currently supported keywords, load this program: http://scheme.mine.nu/gambit/experimental/div/define-type-keywords.scm and run for example (gambit-define-type-keywords "/COMPILE/gambc-v4_2_6"). (Read it's sources to find out what it does ;).
(constant-constructor: constructor: equality-skip: equality-test: extender: id: implementer: init: macros: opaque: predicate: prefix: printable: read-only: read-write: type-exhibitor: unprintable:)
I've seen the id: keyword used a lot with UUIDs. What is it for? There are several others I don't understand, but I guess I should not ask about them all here. :-)
Alex Sandro Queiroz e Silva wrote:
Hallo,
Cristian Baboi wrote:
On Tue, 26 Aug 2008 16:27:24 +0300, Christian Jaeger christian@pflanze.mine.nu wrote:
For the list of currently supported keywords, load this program: http://scheme.mine.nu/gambit/experimental/div/define-type-keywords.scm and run for example (gambit-define-type-keywords "/COMPILE/gambc-v4_2_6"). (Read it's sources to find out what it does ;).
(constant-constructor:
(not sure)
constructor:
Argument: the symbol (the name) of the constructor function
equality-skip: equality-test:
(not sure)
extender:
Argument: the symbol (the name) of the macro you want for extending this type.
id:
Argument: a symbol to identify the type (should have a random and long enough name). If omitted, the type is only valid during that particular program run and inside that program, i.e. you couldn't serialize data using object->u8vector and read it back in with u8vector->object. The philosophy is that the basename you're using for a type definition (the first argument to define-type) only serves as prefix for all the accessors, and not for identification of the type.
implementer: init:
(not sure)
macros:
No argument; if given, accessors are defined as macros instead of as procedures.
opaque:
(not sure)
predicate:
Argument: the name of the predicate.
prefix:
Argument: a prefix to be prepended.
printable:
Argument: none, if given, do not show the fields following this specification; can be given multiple times alternating with unprintable: iirc.
read-only: read-write:
Make the fields ro/rw I guess.
type-exhibitor:
(not sure)
unprintable:
See printable:
)
I've seen the id: keyword used a lot with UUIDs. What is it for?
There are several others I don't understand, but I guess I should not ask about them all here. :-)
(If you wanted to look at the Gambit sources, best start with the function which my function is scanning for keywords.)
Christian.
Hallo,
Christian, thanks a lot for taking the time to write this exhaustive explanation!