X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f X-Recipient: geda-user AT delorie DOT com X-TCPREMOTEIP: 72.130.189.202 X-Authenticated-UID: jpd AT noqsi DOT com From: John Doty Content-Type: multipart/mixed; boundary="Apple-Mail=_2CBF8D6A-AB38-4AD7-92AA-6B03C3D22030" Message-Id: <220C1787-45BF-459E-B217-29686DC25DF2@noqsi.com> Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: [geda-user] gschem refactoring ideas -- overall architecture document. Date: Wed, 11 Feb 2015 17:08:32 -1000 References: <54DBDFF1 DOT 1010409 AT ecosensory DOT com> To: geda-user AT delorie DOT com In-Reply-To: X-Mailer: Apple Mail (2.1878.6) Reply-To: geda-user AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: geda-user AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk --Apple-Mail=_2CBF8D6A-AB38-4AD7-92AA-6B03C3D22030 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Feb 11, 2015, at 3:19 PM, Kai-Martin Knaak = wrote: > A unambiguous sort of symbols on save would finally solve a still = standing=20 > issue you may remember: gnetlist behaves differently depending on the=20= > order symbols were added.=20 I agree this is an annoyance. However, take account of the problem of = filled graphics, where one may manipulate that order to get the = appearance you want. That might require the addition of layer numbers to = the format in to work with canonicalization.=20 The most serious troubles here come from the way = (gnetlist:get-package-attribute) works, and I deal with that with a = Makefile line like: GNET=3Dgnetlist -m censor-fix.scm (and then just use "$(GNET)" in place of =93getlist=94 in rules) Peter B. is more conservative about backward compatibility than I am. He = didn=92t want this code to be added to gnetlist.scm in 1.8. See the long = docstring in (gnetlist:get-package-attribute) for more details. I believe I sent you censor-fix.scm years ago, but if you don=92t have = it (and for anybody listening in who needs it), here it is: --Apple-Mail=_2CBF8D6A-AB38-4AD7-92AA-6B03C3D22030 Content-Disposition: attachment; filename=censor-fix.scm Content-Type: application/octet-stream; name="censor-fix.scm" Content-Transfer-Encoding: 7bit ;;; gEDA - GPL Electronic Design Automation ;;; censor-fix.scm - plug-in to fix the attribute censorship bug ;;; Copyright (C) Patrick Bernaud, Peter T. B. Brett, John P. Doty ;;; ;;; This program is free software; you can redistribute it and/or modify ;;; it under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 2 of the License, or ;;; (at your option) any later version. ;;; ;;; This program is distributed in the hope that it will be useful, ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with this program; if not, write to the Free Software ;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ;; Load this file with the -m flag to gnetlist. ;; ;; Checks for consistency when there are multiple attributes attached ;; to a package, instead of yielding the first one. In case of conflict, ;; generates an error message and yields "attribute_conflict" for the ;; attribute value. ;; ;; Requires gnetlist 1.7.0 or later to work properly. ;; ;; Send bug reports to jpd AT noqsi DOT com ;; This function will be called by get-package-attribute to ;; determine the attribute value given a list of values. ;; It ignores #f, which indicates the attribute was missing from ;; a symbol instance. It checks to see if the remaining attribute ;; values are identical. ;; ;; Returns: ;; #f if no value found ;; the common value if all values match ;; "attribute_conflict" if they don't match (define (unique-attribute refdes name values) (let ((v (delq #f values))) (if (null? v) #f (if (allsame? v) (car v) (attribute-conflict refdes name v))))) ;; Checks that a list contains all same value (define (allsame? items) (every (lambda (item) (equal? item (car items))) items)) ;; Complain of conflict, yield "attribute_conflict" (define (attribute-conflict refdes name values) (format (current-error-port) "\ Attribute conflict for refdes: ~A name: ~A values: ~A " refdes name values) "attribute_conflict") --Apple-Mail=_2CBF8D6A-AB38-4AD7-92AA-6B03C3D22030 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=windows-1252 John Doty Noqsi Aerospace, Ltd. http://www.noqsi.com/ jpd AT noqsi DOT com --Apple-Mail=_2CBF8D6A-AB38-4AD7-92AA-6B03C3D22030--