[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Extending svg.el
From: |
Ulf Jasper |
Subject: |
Re: Extending svg.el |
Date: |
Wed, 03 Dec 2014 21:40:44 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
Lars Magne Ingebrigtsen <address@hidden> writes:
> Ulf Jasper <address@hidden> writes:
>
>> However, in the end I only used very few
>> functions from 'svg.el', but wrote a handful of new functions and even
>> "re-invented" some functions (e.g. 'svg-line'). The reason is that many
>> of the functions in 'svg.el' produce side-effects (via 'svg-append' and
>> 'svg-possibly-update-image'). Besides that adding attributes to svg
>> primitives appears to have an effect on the containing xml tree (via
>> 'svg-arguments').
>
> Yes, svg.el is not an immutable functional-type library, but an
> object-oriented one that works on an XML tree.
>
> If you want a function variant of the same, you can just copy the DOM
> before you pass it in. Perhaps add a `dom-copy' function to dom.el?
Agreed. Implicitly, without realising it myself, I was expecting a
functional-type library but not an object-oriented one or anything else.
My mistake.
Ulf