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
0
votes
0 answers

Loading srfi in guile scheme

I found out that the srfi's already used live under /user/guile/3.0/srfi/. This is also in the load-path variable. Now I go into /user/guile/3.0/srfi/ and 'git clone github-link-to-srfi-25' but I can not load the code via (use-module (srfi…
SourBitter
  • 157
  • 2
  • 11
0
votes
1 answer

Can I write a loop procedure in Guile?

I was trying to write a loop procedure in Guile. I came up with the following: (define loop (lambda (predicate callback) (when predicate) callback (loop predicate callback))) But that of course didn't work. The compiler doesn't…
Amanda Ferrari
  • 1,168
  • 5
  • 17
  • 30
0
votes
0 answers

How to pass MAKE variables to guile

I'm using GNU Make with Guile. How do I pass Make variables to Guile? %.txt: @echo $* $(guile (string-upcase $*)) What I want to see is this: $ make foo.txt foo FOO What I get is an error, Unbound variable: foo. My Guile invocation expands to…
iter
  • 4,171
  • 8
  • 35
  • 59
0
votes
2 answers

How to match any element?

This works fine: (sxml-match '(div) ((div) #t)) But this fails: (sxml-match '(div) ((,element) #t)) I am wondering how to match any element? This is a more concrete example. The following is a snippet from the XCB's "xproto.xml" file: (define…
ceving
  • 21,900
  • 13
  • 104
  • 178
0
votes
0 answers

Makevars cannot find libguile.h but the file exists

I would like to be able to use Guile from within R but I don't want RcppGuile::call_guile taking so long to initialize Guile every time. Ideally, Guile could initialize into a reusable object on the R side given a source file. I wanted to poke…
wdkrnls
  • 4,548
  • 7
  • 36
  • 64
0
votes
2 answers

Is there a way to run guile function from command line

So I have a simple file.scm file with following code in it: #!/usr/bin/guile -s !# (define (printer arg) (display arg)) I know you can execute it inside guile repl by doing a (load "file.scm"), and then by invoking the function like (printer…
tvman
  • 13
  • 4
0
votes
1 answer

Error starting Guile with `readline` support

I'm trying to configure Guile to use readline. Here's my ~/.guile: (use-modules (ice-9 readline)) (there was more, this one line is sufficient to have this failure) Here's a log of my interaction: agam@ssdnodes-61de65ea00d0b:~$ guile guile:…
agam
  • 5,064
  • 6
  • 31
  • 37
0
votes
1 answer

Generating cond's (test expression ...) in Scheme

I've been using Guile for about a year, but am fairly inexperienced in using macros in Scheme. Although I have got some more complicated examples to work satisfactorily, I'm getting stuck on what (to me) feels like a really simple use case akin to…
Phil
  • 592
  • 6
  • 15
0
votes
1 answer

How to parse a function into another function in scheme

I am trying to create a function that takes another function as a parameter and calls the functions in a loop. The code below should get the function and the number of times the loop should execute: (define (forLoop loopBody reps) (let …
COM
  • 45
  • 4
0
votes
1 answer

Generating a complete GNU Make recipe with Guile

I am playing with the $(guile ...) support in GNU Make, but I'm having trouble generating a complete recipe from within Guile. This traditional approach works as expected: brazil: <--tab-->@echo Ere I am J.H. (where <--tab--> is an ASCII tab…
Cognitive Hazard
  • 1,072
  • 10
  • 25
0
votes
1 answer

How do I open a file relative to the source files directory in Guile Scheme?

I'm writing a Guix developer environment definition for a Python project I'm working on, it looks something like this: (use-modules (gnu packages) (gnu packages python) (gnu packages python-crypto) (gnu…
Rovanion
  • 4,382
  • 3
  • 29
  • 49
0
votes
1 answer

finding an alternative for a let binding of a define-syntax

I'm in the process of trying to update some old guile 1.8 code to guile 3.x. I'm struggling to find a good replacement for a particular construct. Here's an example that represents the old 1.8 code: (define h (make-hash-table 31)) (define…
Andrew
  • 3,770
  • 15
  • 22
0
votes
1 answer

How to write a self currying lambda macro in scheme?

I would like to write functions like this: (define foo (\ (a b c) (+ a (+ b c)))) get it automatically transformed into this: (define foo (lambda (a) (lambda (b) (lambda (c) (+ a (+ b c)))))) and use it like this (if possible): (map (foo 1 2)…
0
votes
2 answers

If-else statement error in Scheme using guile

Total newbie to Scheme here. I've been stuck on a scheme problem for sometime now. I don't understand how to code this right. I've looked every where on this site and others, and I just can't get this to work. the problem: define a function Square…
Cali_boy23
  • 19
  • 1
0
votes
1 answer

Guile Scheme GOOPS slot accessor is not a valid generic function error

I'm learning Guile GOOPS. I have a problem with a slot accessor. The code below (use-modules (oop goops)) (define-class () (name #:init-keyword #:name #:accessor person-name)) (let ([p (make #:name "Vlad")]) (display…