delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2015/10/16/17:31:10

X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f
X-Recipient: geda-user AT delorie DOT com
X-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20120113;
h=date:from:to:subject:message-id:mail-followup-to:references
:mime-version:content-type:content-disposition:in-reply-to
:user-agent;
bh=qidJ++vgkkmIioox7qj5FMlBKjEsCnERd2lEt+tlJ18=;
b=kG5hUV0JS67y9RDvBP501/5ktfrEalneirZJ16djbKyfr04JpSGAgEmafc+3Jg3RVC
YX1jRNUdScNpfa9dm8qCSFHOQykOtDESg/YUN7oicsyjn+ruN4VhgP3L+nNQ053tFQ7e
OqVHbmha+dWVfm9qBHq7GDnUWt1Q/Rn8eDp+9c+0otqcrBEEsq1UHUriOZ1Oo2nadCOU
6P93tyudoV9Y5zF+TVuwZzmU3K3OEGGNJNpwOlTKXsTH7hLAaMF1R2KQDWx8yomxQeGs
mHemBO/LY81NF+j/19oRbzU0rJmSMPdBORzzef1x1JZEqK66+g9SimiN0yiAGP1LYSg3
Jufw==
X-Received: by 10.112.199.137 with SMTP id jk9mr9373499lbc.86.1445031032803;
Fri, 16 Oct 2015 14:30:32 -0700 (PDT)
Date: Sat, 17 Oct 2015 00:30:30 +0300
From: "Vladimir Zhbanov (vzhbanov AT gmail DOT com) [via geda-user AT delorie DOT com]" <geda-user AT delorie DOT com>
To: gEDA users mailing list <geda-user AT delorie DOT com>
Subject: Re: [geda-user] A lesson from gnet-makefile
Message-ID: <20151016213030.GC2813@localhost.localdomain>
Mail-Followup-To: gEDA users mailing list <geda-user AT delorie DOT com>
References: <1042003D-82E2-40F0-AB60-8186580C46AD AT noqsi DOT com>
<201510121905 DOT t9CJ5T9W026297 AT envy DOT delorie DOT com>
<CAM2RGhTMnybSnYgnNhVZGA6PTvyJu+=Kzd5LX2HMqxT1F4LoRg AT mail DOT gmail DOT com>
<88EA58F5-2B23-498A-9E5B-84054976DBED AT noqsi DOT com>
<CAM2RGhTPPtqmWVa3=Kf-PeN+WS5Tn4J+D0Ri6R_4OrQOk+LFKQ AT mail DOT gmail DOT com>
<4D3CD563-D8EE-4B2A-975A-AC2B573960FF AT noqsi DOT com>
<CAM2RGhT8WzhwvzFx3Rfv8vN-f=i1=uWuLF+48VygSRtfdzdo-A AT mail DOT gmail DOT com>
MIME-Version: 1.0
In-Reply-To: <CAM2RGhT8WzhwvzFx3Rfv8vN-f=i1=uWuLF+48VygSRtfdzdo-A@mail.gmail.com>
User-Agent: Mutt/1.5.23 (2014-03-12)
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

On Tue, Oct 13, 2015 at 02:02:53PM -0400, Evan Foss (evanfoss AT gmail DOT com)
[via geda-user AT delorie DOT com] wrote:
> On Tue, Oct 13, 2015 at 12:23 PM, John Doty <jpd AT noqsi DOT com> wrote:
> >
> > On Oct 12, 2015, at 9:56 PM, Evan Foss (evanfoss AT gmail DOT com) [via
> > geda-user AT delorie DOT com] <geda-user AT delorie DOT com> wrote:
> >
> >>> Translation to the various layout and simulation tools is then a
> >>> job for gnetlist or xorn. Pcb, having no mechanism to do anything
> >>> with this data, isn't terribly relevant at present.
> >>
> >> Well there needs to be something that works like s_conn and it's
> >> partners in gnetlist that walks the list mapping the nets but with
> >> this added metadata.
> >
> > Walking lists is easy in Lisp: gnet-makefile.scm has functions like:
> 
> I understand that but I would really like to go back and do more of
> this in C. The final parsing of the net attributes into xyz output
> format should be in scheme. Although I could be wrong.
Do it the way you like it. I hope, if we'll have algorithms we need,
we'll be able to express them in the language we want.

I can only note that Scheme is a hi-level language wrt C and sometimes
(not always) it's better to express things in it rather than in C.

For example, the following code from gsymcheck

------------------------8<--------------------------
SCM_DEFINE (...)
{
TOPLEVEL* pr_current = edascm_c_current_toplevel ();
  GList *iter;
  PAGE *p_current;
  SCM page_s;
  SCM return_status = scm_from_int (0);

 /* C code to check all symbols */

  for ( iter = geda_list_get_glist( pr_current->pages );
        iter != NULL;
        iter = g_list_next( iter ) ) {

    p_current = (PAGE *)iter->data;
    page_s = edascm_from_page (p_current);

    return_status = scm_sum (return_status, check_symbol (page_s));
  }

  return return_status;
}
------------------------>8--------------------------

can be replaced just with

------------------------8<--------------------------
(apply + (map check-symbol (active-pages)))
------------------------>8--------------------------

in guile module (I'm just working on this)

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019