From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andrew Gaylard Newsgroups: gmane.lisp.guile.user Subject: Persisting GOOPS objects Date: Fri, 18 Jan 2013 12:25:40 +0200 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=0023547c9bbd7b575f04d38d8809 X-Trace: ger.gmane.org 1358504751 19482 80.91.229.3 (18 Jan 2013 10:25:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 18 Jan 2013 10:25:51 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Jan 18 11:26:10 2013 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Tw99F-0008Kd-FX for guile-user@m.gmane.org; Fri, 18 Jan 2013 11:26:09 +0100 Original-Received: from localhost ([::1]:57919 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tw98y-0004AW-Pr for guile-user@m.gmane.org; Fri, 18 Jan 2013 05:25:52 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:37813) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tw98s-00049W-7q for guile-user@gnu.org; Fri, 18 Jan 2013 05:25:49 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tw98o-0007IL-Nq for guile-user@gnu.org; Fri, 18 Jan 2013 05:25:46 -0500 Original-Received: from mail-la0-f52.google.com ([209.85.215.52]:46097) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tw98o-0007I6-5c for guile-user@gnu.org; Fri, 18 Jan 2013 05:25:42 -0500 Original-Received: by mail-la0-f52.google.com with SMTP id ee20so1574844lab.11 for ; Fri, 18 Jan 2013 02:25:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:date:x-google-sender-auth:message-id :subject:from:to:content-type; bh=7InKwZ7d781Ys8JSkLAdf3+aH3wHkQ6q+gtSFNJj/AQ=; b=cICvbRFFC/q+Si9LOO+POkDbxRcrxn4ODFIf32Btg01DMJlJA0VB40JzATeV8fG1M7 bqjJpwmSPbJbLxv65ExxT6DbgUh9XW0yVmr7/yonnrXTdo6tkEUEGTONeO8Y08tMXC97 C21xqfmrNW2FwQIhITgRVoXyyvd5TR9tDVHQFnrkkwgaHzLAVgINUWwoEFz0d6qzvCtg eToP+x+dki9IDsV3oBS27BRqEAODFJAula2s5pDiEMxxVfHCAKZyWfG4liBVSLnGWkGg RPlhFV2NGbfxRdznjnowsqNBCCO2EhIcnLHlso/fRZVhYczcwO59/z3CHhmDIp10Onoo DJ0w== X-Received: by 10.112.39.1 with SMTP id l1mr1907009lbk.35.1358504740476; Fri, 18 Jan 2013 02:25:40 -0800 (PST) Original-Received: by 10.114.75.6 with HTTP; Fri, 18 Jan 2013 02:25:40 -0800 (PST) X-Google-Sender-Auth: K64f_0SjeZleOqeN-ngWUmPwQHI X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.215.52 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:9879 Archived-At: --0023547c9bbd7b575f04d38d8809 Content-Type: text/plain; charset=ISO-8859-1 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 () r i) scheme@(guile-user)> (define c (make )) scheme@(guile-user)> (slot-set! c 'r 3) scheme@(guile-user)> (slot-set! c 'i 4) scheme@(guile-user)> (describe c) #< 91a35b0> is an instance of class 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]> --0023547c9bbd7b575f04d38d8809 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi,

I'm trying to per= sist 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.=A0 Below is an example of what I'm seeing.<= br>
I'm sure I'm doing something dumb here -- but what?
<= div>

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 w= ith 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 (oo= p goops))
scheme@(guile-user)> (use-modules (oop goops describe))
= scheme@(guile-user)> (use-modules (oop goops save))
scheme@(guile-use= r)> (define-class <ag-complex> (<number>) r i)
scheme@(guile-user)> (define c (make <ag-complex>))
scheme@(gui= le-user)> (slot-set! c 'r 3)
scheme@(guile-user)> (slot-set! c= 'i 4)
scheme@(guile-user)> (describe c)
#<<ag-complex&g= t; 91a35b0> is an instance of class <ag-complex>
Slots are:
=A0=A0=A0=A0 r =3D 3
=A0=A0=A0=A0 i =3D 4
scheme@(guil= e-user)> (define l '((c . c)))
scheme@(guile-user)> (assoc = 9;c l)
$1 =3D (c . c)
scheme@(guile-user)> (save-objects l (curren= t-output-port))
(define c 'c)
ERROR: In procedure hashq-get-handle:
ERROR: In pro= cedure hashq-get-handle: Handle access not permitted on weak table

E= ntering a new prompt.=A0 Type `,bt' for a backtrace or `,q' to cont= inue.
scheme@(guile-user) [1]>

--0023547c9bbd7b575f04d38d8809--