skribilo-users
[Top][All Lists]
Advanced

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

Re: [skribilo-users] work around immutability errors to build the docume


From: Ludovic Courtès
Subject: Re: [skribilo-users] work around immutability errors to build the documentation
Date: Mon, 11 Sep 2017 14:20:42 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

Hi Amirouche,

Amirouche <address@hidden> skribis:

> I tried to fix the errors related to the mutation of immutables(patch
> attached).
> Ithink the correct solution is more complex than that.
>
> That said, it still fails to compile. make.log attached.

I think the right fix is to avoid mutation of pairs or to make fresh
pairs.  I’ve tried the latter, to no avail:

diff --git a/src/guile/skribilo/engine.scm b/src/guile/skribilo/engine.scm
index 25dfa86..b965e0f 100644
--- a/src/guile/skribilo/engine.scm
+++ b/src/guile/skribilo/engine.scm
@@ -1,7 +1,7 @@
 ;;; engine.scm -- Skribilo engines.
 ;;; -*- coding: iso-8859-1 -*-
 ;;;
-;;; Copyright 2005, 2007, 2008, 2009, 2010  Ludovic Courtès <address@hidden>
+;;; Copyright 2005, 2007, 2008, 2009, 2010, 2017  Ludovic Courtès 
<address@hidden>
 ;;; Copyright 2003, 2004  Erick Gallesio - I3S-CNRS/ESSI <address@hidden>
 ;;;
 ;;;
@@ -29,6 +29,7 @@
   :use-module (ice-9 optargs)
   :use-module (ice-9 format)
 
+  :use-module (srfi srfi-1)
   :autoload   (srfi srfi-34)  (raise guard)
   :use-module (srfi srfi-35)
   :autoload   (srfi srfi-39)  (make-parameter)
@@ -228,7 +229,7 @@
   (let ((e (make <engine> :ident ident :version version :format format
                          :filter filter :delegate delegate
                          :symbol-table symbol-table
-                         :custom custom :info info)))
+                         :custom (list-copy custom) :info info)))
     e))
 
 
@@ -352,9 +353,9 @@ otherwise the requested engine is returned."
 (define (engine-custom-set! e id val)
   (let* ((customs (slot-ref e 'customs))
         (c       (assq id customs)))
-    (if (pair? c)
-       (set-car! (cdr c) val)
-       (slot-set! e 'customs (cons (list id val) customs)))))
+    (slot-set! e 'customs
+               (cons (list id val)
+                     (alist-delete id customs eq?)))))
 
 (define (engine-custom-add! e id val)
    (let ((old (engine-custom e id)))
To be continued…

Ludo’.

reply via email to

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