7.7
1.1 Generative Tokens
(require rebellion/base/generative-token) | |
package: rebellion |
A generative token
is a primitive data type for unique objects. Two
generative tokens are only equal? if they are eq?, and the
constructor make-generative-token always creates a new token that is
not eq? to any other token. Tokens contain no other data —
procedure
(generative-token? v) → boolean?
v : any/c
A predicate for generative tokens.
procedure
Constructs a new generative token that is distinct from all other
tokens. Multiple calls to make-generative-token always yield multiple
distinct tokens.
Examples:
> (define tok (make-generative-token)) > tok #<generative-token>
> (equal? tok tok) #t
> (equal? tok (make-generative-token)) #f