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
1
vote
1 answer

Inserting at arbitrary position in list in Scheme

I have a list with me, for example: (B D F) I want to insert an element at an arbitrary position in the list. For example, if the element is A, I want to insert it before B and if the element C, I want to insert it after B but before D. Is there any…
Rohit Shinde
  • 1,575
  • 5
  • 21
  • 47
1
vote
2 answers

Arranging a list of words according to the order they occur in a sentence in Scheme

I have a sentence with me, for example, The game is played on a level playing field. Now, I have with me a list of words (played is the). These are random words given to me. Now, I have to order them according to the order they occur in the…
Rohit Shinde
  • 1,575
  • 5
  • 21
  • 47
1
vote
1 answer

How can I convert a string into exact number in Scheme Lisp?

For example, I have this string: "6119726089.12814713" If I do (string->number "6119726089.12814713") - using the SISC implementation the result is 6.119726089128147e9 - and in Guile implementation is 6119726089.128147 but I would like an exact…
Felipe
  • 16,649
  • 11
  • 68
  • 92
1
vote
2 answers

Guile/Scheme - redefine another module's internal function

Let's say I have the following two files: ;; demo.scm (define-module (demo) #:export (f)) (define (g x) 1) (define (f x) (g x)) ... and in the same directory: ;; use-demo.scm (add-to-load-path ".") (use-modules (demo)) (define (g x) (+ x…
Yawar
  • 11,272
  • 4
  • 48
  • 80
1
vote
2 answers

scheme function to call a procedure n times

Does scheme have a function to call a function n times. I don't want map/for-each as the function doesn't have any arguments. Something along the lines of this :- (define (call-n-times proc n) (if (= 0 n) '() (cons…
Himanshu
  • 2,384
  • 2
  • 24
  • 42
1
vote
1 answer

variable defined inside a procedure is kept?

I wrote a procedure (do-test). Since the test might have some effects on the variable env, I defined env inside do-test hoping that env would not be carried with the procedure, so everytime I run it, I will get a fresh environment to work with. To…
Javran
  • 3,394
  • 2
  • 23
  • 40
1
vote
3 answers

Why this lisp recursive macro doesn't work?

I have macro let-- (like let* using lambdas) in guile: (define (let-make-lambdas pairs body) (if (null? pairs) `((lambda () ,@body)) `((lambda (,(caar pairs)) ,(let-make-lambdas (cdr pairs) body)) ,(cadar…
jcubic
  • 61,973
  • 54
  • 229
  • 402
1
vote
2 answers

How to load an extension in Guile 2.0?

I'm trying to load the Graphviz extension for Guile 2.0. This line of scheme code, suggested by Graphviz's documentation, works in Guile 1.8: (load-extension "/usr/lib/graphviz/guile/libgv_guile.so" "SWIG_init") However, it will fail in Guile 2.0…
ivarec
  • 2,542
  • 2
  • 34
  • 57
0
votes
0 answers

How to learn the file paths of every loaded module in a Guile program?

I am playing around with reflection in Guile (specifically, within GNU Make's guile support) and I wish to obtain the fully qualified path names of every loaded module. I've found this page in the Guile manual: …
Cognitive Hazard
  • 1,072
  • 10
  • 25
0
votes
0 answers

WIX toolset 3.11.2 preserve source files timestamps

I'm struggling to maintain file timestamps in MSI installer. I'm installing few scheme source files that needs to preserve their timestamps (Guile problems) and I can't figure way to do that. Is there any way to stop Windows from adding [NOW]…
0
votes
0 answers

What is #~ in scheme?

What does #~ mean in scheme (guile)? For example in this snippet from the guix source code: #~(list (string-append "prefix=" #$output))
Rikard N
  • 427
  • 4
  • 16
0
votes
1 answer

How can I load a foreign library using Guile Scheme?

I want to use a function that I have written in C and compiled into a library using gcc -shared -o libsum.so sum.c, but I don't know how to load the library and call the function from the Scheme interpreter. I successfully compiled the shared…
Display name
  • 721
  • 2
  • 11
  • 29
0
votes
0 answers

Why can't I use this unexported procedure?

I am missing something very basic. There is an unexported procedure in the Guix source module (guix build-system python) I want to use. I thought I could just use @@ to get it. Yet, when I try that I get an error. > (define pwep (@@ (guix…
wdkrnls
  • 4,548
  • 7
  • 36
  • 64
0
votes
0 answers

How to tell configure where the required version is?

I'm attempting to compile geda-gaf cloned from https://github.com/rlutz/geda-gaf.git when I do $ ./configure; I get: checking for GUILE... no configure: error: you need at least version 2.0.0 of guile but $ which guile /usr/bin $ guile -v guile (GNU…
Brad
  • 11
  • 1
  • 1
0
votes
1 answer

Why defining a recursive-display procedure in Guile causes infinite loop?

The following procedure causes an infinite loop: (define (recursive-display . args) (if (null? args) #t (begin (display (car args)) (recursive-display (cdr args))))) I'm still learning about Guile so I'm a bit confused…
Amanda Ferrari
  • 1,168
  • 5
  • 17
  • 30