From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Vladimir Zhbanov Newsgroups: gmane.lisp.guile.user Subject: Re: Using guile-scmutils with REPL and compilation Date: Thu, 9 Jul 2020 09:32:12 +0300 Message-ID: <20200709063212.GA2566@newvzh.lokolhoz> References: <20200704145737.GA2838@newvzh.lokolhoz> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4372"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/1.10.1 (2018-07-13) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Thu Jul 09 08:33:00 2020 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jtQ7A-0000zy-0G for guile-user@m.gmane-mx.org; Thu, 09 Jul 2020 08:33:00 +0200 Original-Received: from localhost ([::1]:39616 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jtQ78-00022w-MG for guile-user@m.gmane-mx.org; Thu, 09 Jul 2020 02:32:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58182) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jtQ6z-00022o-At for guile-user@gnu.org; Thu, 09 Jul 2020 02:32:49 -0400 Original-Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]:43721) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jtQ6x-0001ok-J3 for guile-user@gnu.org; Thu, 09 Jul 2020 02:32:48 -0400 Original-Received: by mail-lj1-x231.google.com with SMTP id f5so1058690ljj.10 for ; Wed, 08 Jul 2020 23:32:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=wxhsJjedFuTnFBSMBogv9sO7WZqKZrIeWY0qCBS5xas=; b=uakrQMFAeGHh/J581KgjKDJDbvHT2KJR2qIYSZlpaYw2AFbu96ryIZwgzXiG7h4a8D W/OnVJgAOmviWIVOPKUIwqZWjaG9ofWNFZVhqWrW+rHVznS+STm7tBWvJDMQuakANYDp ebOdD8cDsjI98WnjtI+u23U4ZSWCpA2j2z1htXCaWFqTg5430PhiPGoZnz4ytgoEoI4i 2N3YGUAECLYEUw/Ih2TtfCCZyXs0Z6Qle8dn4pvmHV5E3ytk4Sp1G3AicZqfMUt5zCfk uuzGCRfA5U74fcnGKnsqLZ4VuolzZi4g4zsg9Xg4ovj6Vh57qpEK9fNa4uB35qK9F74G 4Lxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mail-followup-to :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=wxhsJjedFuTnFBSMBogv9sO7WZqKZrIeWY0qCBS5xas=; b=OjB48aJqcwt8qZgOYaoJBV7/68n6BD8VT+h3JlLfBH/YnPj9uWJCfLfa++4Ned3Y21 NBj7Y9UG/6oryZj4IrtlwXDzSvg6R817miYumtkrIu65+gduuSi1l1vvOhpP/9537iwA OmpIi+aNNV0leDRq2+N+G+MtUhnL7hRpx/+0PxJlNDDD4NyAX459PpF742uxVgnp6T4w pOIA8avJa9fHNlu3sxth53dN5JSgEMkxTyb84nWPsLDHmpzJT3t1NH2QeQfBvbs7R68d 7gzAkozH2bNa3xzev+862HgpeSYGlB3nC0GxKIQIr/ZFcdVuvDZ3hyN+VCiI7Vq6zwHP xonQ== X-Gm-Message-State: AOAM532VbaNbO6k1Qg9BoPishQunF9kOxV0JfhSGQhoa0qvoomHHxKFq Q9IJATNYDpZtIW6kNWc2OpP6kn0/ X-Google-Smtp-Source: ABdhPJx9Rg08IsSlr1T0lCOzPelkgZBPcFBsGbs3RxtJiMsZ0XCVmrA4tHTAdEZUYt/rQ6CdXR0jSw== X-Received: by 2002:a2e:8e68:: with SMTP id t8mr27878081ljk.335.1594276364996; Wed, 08 Jul 2020 23:32:44 -0700 (PDT) Original-Received: from newvzh.lokolhoz ([95.179.127.78]) by smtp.gmail.com with ESMTPSA id x6sm507376ljd.34.2020.07.08.23.32.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jul 2020 23:32:44 -0700 (PDT) Original-Received: from vovka by newvzh.lokolhoz with local (Exim 4.92) (envelope-from ) id 1jtQ6Y-00011b-Sb for guile-user@gnu.org; Thu, 09 Jul 2020 09:32:22 +0300 Mail-Followup-To: guile-user@gnu.org Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::231; envelope-from=vzhbanov@gmail.com; helo=mail-lj1-x231.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:16646 Archived-At: On Thu, Jul 09, 2020 at 12:04:29AM +0300, Viacheslav Dushin wrote: ... > >Another way is to just use: > > >scheme@(guile-user)> (primitive-load "/My/absolute/file/name.scm") > > What's the key difference between load and primitive-load? The docs are > unclear. AFAICS in the docs, under the hood, 'load' calls for 'primitive-load', it's a wrapper for it and may take an additional argument, the "reader" procedure. It's a subject to play with :-) ... > Anyway thanks for your answer. I moved a bit forward with this code > > (add-to-load-path "/Users/slava/.guile.d/") > (load (%search-load-path "guile-scmutils/src/load.scm")) > (use-modules (generic-environment)) > > Now it fails with the following error: > > ;;; note: source file > /Users/slava/Documents/work/func-diff-geometry/prologue/code.scm > ;;; newer than compiled > /Users/slava/.cache/guile/ccache/3.0-LE-8-4.3/Users/slava/Documents/work/func-diff-geometry/prologue/code.scm.go > ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0 > ;;; or pass the --no-auto-compile argument to disable. > ;;; compiling > /Users/slava/Documents/work/func-diff-geometry/prologue/code.scm > ;;; WARNING: compilation of > /Users/slava/Documents/work/func-diff-geometry/prologue/code.scm failed: > ;;; no code for module (generic-environment) Is there the file "generic-environment.scm" with the module definition "(define-module (generic-environment) ...)" in the '%load-path' visible within 'code.scm'? ... > I think the main question is why REPL and compiler act differently. > This code works ok inside the REPL but fails to compile: > (add-to-load-path "/Users/slava/.guile.d/") > (load (%search-load-path "guile-scmutils/src/load.scm")) > > (set-current-module generic-environment) > > (define ((Gamma w) t) > (up t (w t) ((D w) t))) Maybe, different settings wrt '%load-path' and such in some config files? Or maybe some additional modules are loaded when the REPL starts? Check what '%load-path' and '(module-uses (current-module))' return in both cases. (Dunno, if '%load-compiled-path' can affect something in such a case.) HTH -- Vladimir (λ)επτόν EDA — https://github.com/lepton-eda