From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Viacheslav Dushin Newsgroups: gmane.lisp.guile.user Subject: Re: Using guile-scmutils with REPL and compilation Date: Thu, 9 Jul 2020 00:04:29 +0300 Message-ID: References: <20200704145737.GA2838@newvzh.lokolhoz> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4847"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Wed Jul 08 23:04:55 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 1jtHFP-0001BD-Et for guile-user@m.gmane-mx.org; Wed, 08 Jul 2020 23:04:55 +0200 Original-Received: from localhost ([::1]:42174 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jtHFO-00014M-Gb for guile-user@m.gmane-mx.org; Wed, 08 Jul 2020 17:04:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56178) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jtHFE-00014A-Gt for guile-user@gnu.org; Wed, 08 Jul 2020 17:04:44 -0400 Original-Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:39453) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jtHFC-00079A-JM for guile-user@gnu.org; Wed, 08 Jul 2020 17:04:44 -0400 Original-Received: by mail-wm1-x32d.google.com with SMTP id w3so4580066wmi.4 for ; Wed, 08 Jul 2020 14:04:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=awmCPFfvWP8Waq4SAScejxLQoKqVO/f/iAWUa/kXrh8=; b=RtobGKWcorstO13UghiRqsLPqmE702IqaZ+uRN8zV9sfeLkWsqXWVitpvL0IgTWYfE cSYuwjqMeELSevuwXEUbKO2VI2nGPJLblzCNvGsZGL+IVI4pJpPMvFCh5iGqv5JsWMrl FFBOsajw/PgRSKQnB/MsIDtW/26vmyYNJWgknPO148lfn6qmy1C9p6lJcpYyIOgQmnhc VN0X+md1P5Cxdd2mmgK4qlQc/RIZxW7MgSlF/Tq5Xa5GooGBqE/EDPR28Fy1PhAyFLu1 colgu/mUD4yNNwhXQ7+7I1P2AO3cbzOHEOVdgb/eGqAbpkeqyNB3BtqonBDAJOMZhflU RjFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=awmCPFfvWP8Waq4SAScejxLQoKqVO/f/iAWUa/kXrh8=; b=fT7DvSd1gCVVGXdvNrphgIsy4X222ykU1TTU2Nl48zNmIEpDQTNq/UkB5ZUHhaUN74 vSOAdpl9lT9ua03Mcro3fpZsq33z/Dknhmdn0SpW0oN+R5yZMxp5EskjzEMhpRg5lXNX UZ+3DXl/rayKNVvC/aQuEJFNT6NswpkezASSIgOQ4LwyZkTUEGX2TT/oAZlET31L2d3o NLX4/TljzlX4qct7mXuA40xsVJzfCPNHZ4sWh2Stzhwneayrdy66pANbRov0grbHtH+K AqL+RO3kUXgDvRaSfcYguCcU3dEwPSqGctY1aK8JtKDS0QCz6sUzdz1KvhBumIjapzdc tWpg== X-Gm-Message-State: AOAM530HU0vq8pKCmTVu2fDCdeiW1W4ozgWWHIhUqS7TV/l7OSaC5X7h cc8EA6LAJKB4uVAI4moZ11gHWRpUbXJ1Xn2mAnVoPWVzC4k= X-Google-Smtp-Source: ABdhPJwgPAszXWAzTrrd1UVVR+PxVb75KKtK/tsRguA/CEmdtb/Rb7srNDrwNQVCtUVKXic+tWaGnq3UJExlaK1NLoI= X-Received: by 2002:a7b:c8c2:: with SMTP id f2mr10572856wml.57.1594242280305; Wed, 08 Jul 2020 14:04:40 -0700 (PDT) In-Reply-To: <20200704145737.GA2838@newvzh.lokolhoz> Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=slava333@gmail.com; helo=mail-wm1-x32d.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: -7 X-Spam_score: -0.8 X-Spam_bar: / X-Spam_report: (-0.8 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.23 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:16645 Archived-At: Hello, sorry for the late reply. zhbanov@gmail.com I already have "/Users/slava/.guile.d/" in the load path >scheme@(guile-user)> %load-path Here is the output: $1 = ("/Users/slava/.guile.d/" "/usr/local/Cellar/guile/2.2.7_2/share/guile/2.2" "/usr/local/Cellar/guile/2.2.7_2/share/guile/site/2.2" "/usr/local/Cellar/guile/2.2.7_2/share/guile/site" "/usr/local/Cellar/guile/2.2.7_2/share/guile") >Check, if the directory *really* contains your file >"guile-scmutils/src/load.scm", and try the following after that: >scheme@(guile-user)> (%search-load-path "guile-scmutils/src/load.scm") yes, I checked, the file is there: (%search-load-path "guile-scmutils/src/load.scm") $1 = "/Users/slava/.guile.d/guile-scmutils/src/load.scm" >So, only if the command above returns the file name you're >searching for, try loading it: >scheme@(guile-user)> (load (%search-load-path "guile-scmutils/src/load.scm")) yes, it works, the output: (load (%search-load-path "guile-scmutils/src/load.scm")) $2 = done >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. There is a strange thing: compilator was able to find "guile-scmutils/src/load.scm" only when I added "/Users/slava/.guile.d/" at the beginning of my code. In interactive mode this line is not needed: `.guile` file is loaded. >If you're defining a module in your file, use the 'use-modules' >procedure to load it. Ok, I'll post the updated code later Now about your second question. >I don't know, what 'generic-environment' is. Is it defined at >all? Yes, in guile-scmutils/src/kernel/genenv-module.scm >Try on the prompt: >scheme@(guile-user)> generic-environment >and read what it reports. yes, the output is: $2 = # >BTW, the command '(set-current-module generic-environment)' won't >work anyway in your code, since you use '(set-current-module >guile-user-module)' just *after* it. my bad. 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) 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))) I'll keep looking into the scmutils code right now. Thanks, Slava > > >