[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using guile-scmutils with REPL and compilation

From: Viacheslav Dushin
Subject: Re: Using guile-scmutils with REPL and compilation
Date: Thu, 9 Jul 2020 00:04:29 +0300

Hello, sorry for the late reply.

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/"

>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
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

There is a strange thing: compilator was able to find
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
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
;;;       newer than compiled
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling
;;; 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 via email to

[Prev in Thread] Current Thread [Next in Thread]