[gambit-list] Compiling Meroon objects and initializers

Roger Wilson misterrogerwilson at gmail.com
Sat Jul 9 02:51:19 EDT 2011


I have a basic Scheme question.

The following works as intended from my Swank REPL.  How do I make it work
with a compiled file?  I'm trying to create a Meroon object that has an
automatically created unique id each time one is created.

(define *global-id* 0)
(define (get-next-global-id)
    (let ((current-global-id *global-id*))
         (set! *global-id* (+ *global-id* 1))

(define-class my-object Object
  ((= object-id :initializer get-next-global-id)))

When the Gambit setup function runs I get the error....

*** ERROR IN | object| -- (Argument 1) NUMBER expected
(= #!unbound #!unbound 'get-next-global-id)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20110709/f2df8f91/attachment.htm>

More information about the Gambit-list mailing list