[gambit-list] Namespaces and define-type

Christian Jaeger christian at pflanze.mine.nu
Tue Aug 26 10:44:32 EDT 2008


Alex Sandro Queiroz e Silva wrote:
> Hallo,
>
> Cristian Baboi wrote:
>   
>> On Tue, 26 Aug 2008 16:27:24 +0300, Christian Jaeger 
>> <christian at 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.




More information about the Gambit-list mailing list