unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Viacheslav Dushin <slava333@gmail.com>
To: guile-user@gnu.org
Subject: Re: Using guile-scmutils with REPL and compilation
Date: Thu, 9 Jul 2020 00:04:29 +0300	[thread overview]
Message-ID: <CAJN5JQrnWhs5JcE7tbhA_m89JayuThu1UHOpOkDM_X1t2MAs5A@mail.gmail.com> (raw)
In-Reply-To: <20200704145737.GA2838@newvzh.lokolhoz>

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 = #<module (#{ g3541}#) 110a1a8c0>

>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


>
>
>


  reply	other threads:[~2020-07-08 21:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-19 23:43 Using guile-scmutils with REPL and compilation Viacheslav Dushin
2020-06-20  7:33 ` Vladimir Zhbanov
2020-07-04 14:57 ` Vladimir Zhbanov
2020-07-08 21:04   ` Viacheslav Dushin [this message]
2020-07-09  6:32     ` Vladimir Zhbanov
  -- strict thread matches above, loose matches on Subject: below --
2020-06-20 14:39 Viacheslav Dushin
2020-07-04  1:06 Viacheslav Dushin
2020-07-04  4:15 ` Catonano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJN5JQrnWhs5JcE7tbhA_m89JayuThu1UHOpOkDM_X1t2MAs5A@mail.gmail.com \
    --to=slava333@gmail.com \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).