Questions tagged [guile]

GNU Guile is the GNU project's official plugin infrastructure. Guile typically refers to the Scheme front-end which Guile provides.

GNU Guile is the GNU project's official plugin infrastructure. It is intended to be plugged into applications through libguile, but can also be run as a standalone Scheme interpreter.

Guile has a few front-end languages:

  • Scheme, supporting R5RS fully and some of R6RS (the default)
  • EmacsLisp
  • ECMAScript, which has some implementation, but is not completed
  • Lua, which is planned but as of yet nonexistant

Guile has support for modules outside of the core system, which allow for things that are either at SRFI status, or not implemented in Guile's core. See the list of included modules for exactly what the bundled modules do.

Guile has extensive documentation which is hosted here. It contains details on both embedding Guile into applications as well as its features at the language level.

There is also a tutorial that explains step-by-step how to use guile in a straightforward Logo-like ("turtle graphics") application.

261 questions
3
votes
1 answer

guile-config fails to run

I am trying to install libgraph in my WSL Ubuntu 20.04 installation. I installed all the necessary packages. But when I try to configure libgraph, it fails with this: $ ./configure checking build system type... x86_64-unknown-linux-gnu checking host…
divykj
  • 576
  • 6
  • 12
3
votes
2 answers

How to inspect/export/serialize a (guile) Scheme environment

I'd like to export or replicate a scheme environment in another guile process. The algorithm I'm imagining would do something like this to serialize: (map (lambda (var val) (display (quasiquote (define ,var ,val)) (newline)) …
drysdam
  • 8,341
  • 1
  • 20
  • 23
3
votes
1 answer

Define goto in scheme

As an exercise to learn call/cc and macros, I tried to define goto. (define-syntax label (syntax-rules () ((_ name) (begin (define name) (call/cc (lambda (c) (set! name c))))))) (define (goto label)…
3
votes
2 answers

Regex not matching string in scheme but works on other platform

I am running string-match using the pattern [ \[\]a-zA-Z0-9_:.,/-]+ to match a sample text Text [a,b]. Although the pattern works on regex101, when I run it on scheme it returns #f. Here is the regex101 link. This is the function I am running…
xabush
  • 849
  • 1
  • 13
  • 29
3
votes
2 answers

difference between let inside and outside a lambda expression

Consider a module with the following procedures: (define-module (test test) #:export (proc1 proc2 proc3)) (define proc1 (let ((module (current-module))) (lambda () (format #t "~s\n" module)))) (define proc2 (lambda () (let…
Ernest A
  • 7,526
  • 8
  • 34
  • 40
3
votes
1 answer

Guile `syntax-rules`: Misplaced Ellipsis in Form; How to Write this Macro with Two Ellipses?

I'm trying to, more or less, recreate a let construct via syntax-rules but it seems to be tripping on the use of two ellipses. I tried writting it out as so: (define-syntax if-let (syntax-rules () [(_ (([binding value] ...) …
Jaft
  • 43
  • 2
  • 8
3
votes
2 answers

How to check whether GNU Make supports Guile

How to check from the command line whether GNU Make is built with support of Guile? Inside Makefile it can be determined via analyzing .FEATURES variable (see documentation).
ruvim
  • 7,151
  • 2
  • 27
  • 36
3
votes
0 answers

Valgrind reports errors with libgc

I'm developing an application with guile and I get some strange errors with it. I suspect that the errors are caused by uninitialized variables in guile or some of the libraries it uses. The problem occurs with both guile versions 2.0 and 2.2. When…
tohoyn
  • 139
  • 4
3
votes
1 answer

Make an executable Guile program with auto-tools?

Recently started learning to use auto-tools and have been trying make a simple Guile program with it. Following this tutorial I got the program successfully compiling, with the .go file placed in %site-ccache-dir and the .scm file placed in…
3
votes
0 answers

GNU Guile segfaults when loading guile-readline

I'm embedding guile in a small program I'm writing, I'm opting to use guile-readline as an extension. This extension works perfectly fine the default REPL, (use-modules (ice-9 readline)) (activate-readline). However, when I try to invoke the same…
oldjohn1994
  • 359
  • 4
  • 12
3
votes
1 answer

What does `when` return when the condition is false?

scheme@(guile-user)> (define val (when #f 1)) scheme@(guile-user)> val scheme@(guile-user)> (null? val) $6 = #f scheme@(guile-user)> (boolean? val) $7 = #f scheme@(guile-user)> (pair? val) $8 = #f scheme@(guile-user)> (when val 1) $9 = 1 It does…
Ernest A
  • 7,526
  • 8
  • 34
  • 40
3
votes
2 answers

How can I read file loaded in a variable in guile?

I am new to to guile and scheme and what I am trying to do right now is take a scheme file (file.scm) and load it up into a variable so I will be able to parse it, and I am having trouble finding how to do this anywhere. What I have right now is…
Ryan w
  • 528
  • 1
  • 7
  • 21
3
votes
1 answer

SICP practise 3.51 Wrong type to apply: #

In practice 3.51 of the SICP, it defines a procedure "show", and use stream-map to create a stream: (add-to-load-path ".") (load "stream.scm") (define (show x) (display-line x) x) (define x0 (stream-enumerate-interval 0 3)) (display-stream…
byhc
  • 173
  • 8
3
votes
1 answer

Can't find libunistring when building guile from nonstandard location

I'm trying to build Guile 2.2. I've installed libunistring to /path/to/libunistring. When I run ./configure --with-libunistring-prefix=/path/to/libunistring/ it fails, because it can't find libunistring. configure:15954: checking for…
Nick ODell
  • 15,465
  • 3
  • 32
  • 66
3
votes
1 answer

Scheme/Guile: Variable self-re-definition inside a function

I feel that understanding this subtlety might help me to understand how scope works in Scheme. So why does Scheme error out if you try to do something like: (define (func n) (define n (+ 1 n)) n) It only errors out at runtime when calling the…
ison
  • 60
  • 8