guile-user
[Top][All Lists]
Advanced

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

Re: Using guile-scmutils with REPL and compilation


From: Vladimir Zhbanov
Subject: Re: Using guile-scmutils with REPL and compilation
Date: Sat, 20 Jun 2020 10:33:34 +0300
User-agent: Mutt/1.10.1 (2018-07-13)

Hi Slava,

On Sat, Jun 20, 2020 at 02:43:00AM +0300, Viacheslav Dushin wrote:

...

> Second one:
> There is also a problem with code compilation:
> 
> (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)))
> 
> works fine in the REPL, but fails to compile (guile code.scm) with the
> following error:
> 
> ;;; note: source file
> /usr/local/Cellar/guile/2.2.7_2/share/guile/2.2/ice-9/boot-9.scm
> ;;;       newer than compiled
> /usr/local/Cellar/guile/2.2.7_2/lib/guile/2.2/ccache/ice-9/boot-9.go
> ;;; note: source file
> /Users/slava/Documents/work/func-diff-geometry/prologue/code.scm
> ;;;       newer than compiled
> /Users/slava/.cache/guile/ccache/2.2-LE-8-3.A/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:
> ;;; Syntax error:
> ;;; /Users/slava/Documents/work/func-diff-geometry/prologue/code.scm:4:0:
> source expression failed to match any pattern in form (define ((Gamma
> w) t) (up t (w t) ((D w) t)))
> Backtrace:
>            6 (primitive-load "/Users/slava/Documents/work/func-diff-…")
>            5 (_ #<procedure 102790fe0 at ice-9/eval.scm:330:13 ()> # #)
>            4 (_ #<procedure 102790ec0 at ice-9/eval.scm:330:13 ()> # #)
>            3 (_ #<procedure 102790de0 at ice-9/eval.scm:330:13 ()> # #)
> In ice-9/eval.scm:
>    245:16  2 (_ #(#(#<module (guile) 102695dc0> #f #<variable 10…> …)))
> In unknown file:
>            1 (string-prefix? "/" #f #<undefined> #<undefined> #<und…> …)
>            0 (_ #<procedure 102790b20 at ice-9/eval.scm:330:13 ()> # #)
> 
> ERROR: In procedure string-prefix?: Wrong type argument in position 2
> (expecting string): #f

Try

  (load #f)

and you'll get the same error.

`load' requires string as an argument.  AFAICS in the Guile
reference manual, probably the function is supposed to work in
REPL only (while it works without it).

If `%search-load-path' is not able to find the file you want to
load, it returns #f.  You can check your `%load-path' if the
directory with that file is listed in that variable.  If not, use
`add-to-load-path "the-dir-your-file-resides-in"' to make it work,
or use the absolute path of the file.

HTH

-- 
  Vladimir

(λ)επτόν EDA — https://github.com/lepton-eda



reply via email to

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