guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Persisting GOOPS objects


From: Andrew Gaylard
Subject: Persisting GOOPS objects
Date: Fri, 18 Jan 2013 12:25:40 +0200

Hi,

I'm trying to persist a GOOPS object.

I've found oop/goops/save.scm, which defines save-object.
That looks like what I need.

However, I can't get it to work.  Below is an example of what I'm seeing.
I'm sure I'm doing something dumb here -- but what?

Many thanks for your help,
- Andrew

$ /usr/bin/guile
GNU Guile 2.0.5-deb+1-1
Copyright (C) 1995-2012 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guile-user)> (use-modules (oop goops))
scheme@(guile-user)> (use-modules (oop goops describe))
scheme@(guile-user)> (use-modules (oop goops save))
scheme@(guile-user)> (define-class <ag-complex> (<number>) r i)
scheme@(guile-user)> (define c (make <ag-complex>))
scheme@(guile-user)> (slot-set! c 'r 3)
scheme@(guile-user)> (slot-set! c 'i 4)
scheme@(guile-user)> (describe c)
#<<ag-complex> 91a35b0> is an instance of class <ag-complex>
Slots are:
     r = 3
     i = 4
scheme@(guile-user)> (define l '((c . c)))
scheme@(guile-user)> (assoc 'c l)
$1 = (c . c)
scheme@(guile-user)> (save-objects l (current-output-port))
(define c 'c)
ERROR: In procedure hashq-get-handle:
ERROR: In procedure hashq-get-handle: Handle access not permitted on weak table

Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
scheme@(guile-user) [1]>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]