delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2021/04/26/15:23:31

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=20161025;
h=from:date:to:subject:message-id:mail-followup-to:references
:mime-version:content-disposition:in-reply-to;
bh=RT1jVjz8jQMqbShiS3hLKdSmjKzCrbLCeW4Bb1Bs0eQ=;
b=fEbKG5WtwX/5RAuRT3EBawBOOExjRhhHTXhX/D14LAM9dzFWeYu9c+6Yv2Y2PMeIvb
1nFgHePBPSwZhwckkyWPihhfoNdbIH7P4piXW5RCaW4IKZ832PupgWnk/phT5z9NYCNw
dtpoecNAyO7Hm0OmS5PFojsvyPBkuRcPyCsZBcR9FBIFSwDazQ07yjy5/2gi2Qeuc58T
EQZ+hNqTQR6gah7YAiLcw6wFx5S3r+A1fcX8MKC7jv2pQH7RcMddQmvfbxT0XDOgKkQ8
nrJ566q3a4e/rXTg5RHN998lJGg47uJxk9Z+RM+/9Aq3q58nrCYv26J8PmcGXn+LXtX+
0gLA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:from:date:to:subject:message-id:mail-followup-to
:references:mime-version:content-disposition:in-reply-to;
bh=RT1jVjz8jQMqbShiS3hLKdSmjKzCrbLCeW4Bb1Bs0eQ=;
b=Q3TmGmYShMjf0qPJ/v9ryBTucEUWB1qb9K3/zAOKIjq+wUzpLqIJ0ltKxclvO5/G+j
0ecilXH+Dci1/ai0DcV2QrIJnBF4D8rqemJrixBQOfXu3nNJqosUs3fCZWxmHzgQGFnz
LOfA51badgwV8Lrj9rHOqN/0zlcimWR8+Sy30yZIL3PD3pEkNugGOWJJaBKzr0tTTzp6
Val+4L078+HTG66/pGVJ9Zlbx8vc0PMN8/f9hTaS2b8eGr4medd+74AydhwuD6ryUqHq
5BN9Jt1+ArAaUDYOyNmrk6bDZ5ubmBIs1UnuutWqSgo+AhqcAcOzALg6ebG77t4q0Bp2
87ZQ==
X-Gm-Message-State: AOAM531SVOWahmy/D8btdsqCYlyjmFZj0aLGPOVICGtoiA34RKFBU9Rn
0nCKEIKh1J5Ov0uExLRmfQ/LjWBXtAU=
X-Google-Smtp-Source: ABdhPJzm6Hu9isI04IhIQ+HBLjB4A9BgtpW2K/VJM/cW5D8z8CxUBvKsqaRT0RMtGHLH83nvBmQREQ==
X-Received: by 2002:a2e:908a:: with SMTP id l10mr14136705ljg.38.1619464962196;
Mon, 26 Apr 2021 12:22:42 -0700 (PDT)
From: "Vladimir Zhbanov (vzhbanov AT gmail DOT com) [via geda-user AT delorie DOT com]" <geda-user AT delorie DOT com>
X-Google-Original-From: Vladimir Zhbanov <vzh AT lepton>
Date: Mon, 26 Apr 2021 22:22:40 +0300
To: geda-user AT delorie DOT com
Subject: Re: [geda-user] system wide config
Message-ID: <YIcTALjjqRTe7vmq@lepton>
Mail-Followup-To: geda-user AT delorie DOT com
References: <YHrjzpKEMOvXREuY AT lepton>
<20210417144426 DOT E4238824EAA0 AT turkos DOT aspodata DOT se>
<YH4IPPe+k4MZJJkm AT lepton>
<20210420004032 DOT 30A6980770A6 AT turkos DOT aspodata DOT se>
<YH6T5zzhba9AqGX9 AT lepton>
<20210420143556 DOT CC46580770AF AT turkos DOT aspodata DOT se>
<20210420144634 DOT 1456180770AF AT turkos DOT aspodata DOT se>
<20210422091632 DOT 7178ff90 AT demon>
<YIFIRh9ENXpQgVmB AT lepton>
<20210426220149 DOT 279397ad AT demon>
MIME-Version: 1.0
In-Reply-To: <20210426220149.279397ad@demon>
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 Mon, Apr 26, 2021 at 10:01:49PM +0300, dmn (graahnul DOT grom AT gmail DOT com) [via geda-user AT delorie DOT com] wrote:
> On Thu, 22 Apr 2021 12:56:22 +0300
> "Vladimir Zhbanov (vzhbanov AT gmail DOT com) [via geda-user AT delorie DOT com]"
> <geda-user AT delorie DOT com> wrote:
> 
> > On Thu, Apr 22, 2021 at 09:16:32AM +0300, dmn
> > (graahnul DOT grom AT gmail DOT com) [via geda-user AT delorie DOT com] wrote:
> > > On Tue, 20 Apr 2021 16:46:34 +0200 (CEST)
> > > "karl AT aspodata DOT se [via geda-user AT delorie DOT com]"
> > > <geda-user AT delorie DOT com> wrote:
> > > 
> > > >  I think the following will suit me fine in the future.
> > > > 
> > > > (use-modules (ice-9 popen))
> > > > (use-modules (ice-9 rdelim))
> > > > 
> > > > (define (readlink file)
> > > >   (let*
> > > >    (
> > > >     (port (open-input-pipe (string-append "readlink -f " file)))
> > > >     (str  (read-line port))
> > > >     (close-pipe port)
> > > >    )
> > > >    str
> > > >   )
> > > > )
> > > > 
> > > > (define MK (readlink "Makefile"))
> > > > (define INC (dirname MK))
> > > > (define TOP (dirname INC))
> > > > ;(display MK)  (newline)
> > > > ;(display INC) (newline)
> > > > ;(display TOP) (newline)
> > > > 
> > > >  Thanks for the ideas and help.
> > > > 
> > > > Regards,
> > > > /Karl Hammar
> > > > 
> > > 
> > > Karl, first of all, I'd like to thank you for not using the "dog's
> > > breakfast coding style" (TM)! :-)
> > > Being not an expert in the bloody lisp programming language, I
> > > wonder does the call "(close-pipe port)" inside the "let" clause
> > > get executed? (It looks like a variable definition).
> > 
> > It's easy to check, use REPL and something like
> > 
> > (format #t "Closed? ~A\n" (port-closed? port))
> > 
> > before resulting 'str'.
> 
> 
> Thank you, I've tried that. Indeed, in the above context
> close-pipe is treated just as a local variable,
> no call to close-pipe().

Inconceivable ;-)

- Raw text -


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