Questions tagged [guile]
GNU Guile is the GNU project's official plugin infrastructure. Guile typically refers to the Scheme front-end which Guile provides.
204
questions
1
vote
0answers
12 views
liliypond NIL NULL NOOP symbol – or how to define a empty expression
tl;dr How to define a noop expression in lilypond?
Hello, I play the organ and sometimes need to transcribe some sheet music for it. I use lilypond for this.
For pedaling symbols I defined some ...
0
votes
0answers
17 views
Extending GDB with guile pretty printer
I tried to write some pretty printer for GDB using guile scheme.
https://sourceware.org/gdb/onlinedocs/gdb/Writing-a-Guile-Pretty_002dPrinter.html#Writing-a-Guile-Pretty_002dPrinter
Unfortunately ...
0
votes
1answer
23 views
How do I turn #<unspecified> into a number in guile scheme
I'm trying to get the hang of recursion in scheme. I put together a Fibinachi function and it keeps returning unspecified instead of a number. How do I make this function return a number and to ...
1
vote
1answer
34 views
How to read a string to get user input in GNU Guile?
I'm trying to make a Rock Paper Scissors game to help myself lean GNU Guile. I've hit a snag where I get user input, the player's choice in the game. If I set it to a string, then the game works ...
0
votes
0answers
15 views
'Make: exec: compile: not found' Guile's Haunt build error (CentOS 8; Guile 2.0.14; Haunt 0.2.4)
The build of 'Haunt' ('make' step) fails with the following:
GEN haunt/config.go
./pre-inst-env: line 31: exec: compile: not found
'compile: not found' ?
Guile is in version 2.0.14, Haunt 0.2....
2
votes
1answer
66 views
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) (...
1
vote
2answers
81 views
SRFI notational conventions
I'm reading (looking at) the Guile Reference Manual but I do not understand some notational conventions specified by SRFI.
Note that the Guile Reference Manual seems to follow the structure of the ...
0
votes
0answers
40 views
Where does brew install the guile module “(ice-9 r5rs)”?
Using the brew installer, I installed Guile 2.2.6 on Mac OS X Sierra.
I typed ",use" at the Guile prompt and a list of modules was returned.
One entry on the list (for example) was "(ice-9 r5rs)" I am ...
0
votes
1answer
35 views
How can I compile with Guile 2.0 on Homebrew?
I am trying to compile a project with Homebrew on Mac OSX 10.14 Mojave. I have guile 2.2.x:
guile --version
guile (GNU Guile) 2.2.6
but the project does not support guile 2.2, only 2.0. How can I ...
0
votes
0answers
20 views
Compiling GNUTLS gives config.status:error: cannot find input file: 'guile/pre-inst-guile.in'
I'm trying to compile GNUTLS through a VirtualBox debian VM. I've installed all dependencies yet I still get
config.status:error: cannot find input file: 'guile/pre-inst-guile.in'
I've already ...
0
votes
2answers
84 views
How to use the POSIX package of Guile 2.2?
Context:
I am currently coding the generate-ninja-build.scm script in git commit cb7530e3ff10 of my GPLv3+ project bismon (funded by H2020 research projects). This is contractually some Linux free ...
0
votes
1answer
89 views
Should I define separate module for every file in my Guile project?
Let me explain my problem by comparison. In Common Lisp I could split package definitions to several files, it was enough to declare in each of them that it's in-package and load them.
However in ...
1
vote
1answer
27 views
Module dependency while building scheme project using automake
I am trying to build and install a scheme project that has module dependencies using automake. However, I keep getting errors as described below.
To demonstrate with a simple example, imagine I have ...
2
votes
2answers
71 views
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 ...
3
votes
2answers
46 views
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"...
0
votes
1answer
76 views
Circular lists in guile
I was testing this code in guile:
> (define xxx (let ((x '(1 2 3))) (set-cdr! (cddr x) x) x))
> xxx
it display (1 2 3)
but this:
(define x '(1 2 3))
(set-cdr! (cddr x) x)
x
=> (1 2 3 . #-...
3
votes
1answer
80 views
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 ()
...
2
votes
1answer
72 views
My lisp macro stops working in latest guile
I have macro that I've written in 2010, it was for managing structures like in Common Lips using Alists (here is whole file including functions https://jcubic.pl/struct.txt).
(define-macro (defstruct ...
1
vote
1answer
32 views
Determine whether Guile is running interactively
How to test whether Guile running interactively?
The purpose is the following: implement an exception handler such that, if not running interactively, exceptions should print a message and exit Guile,...
1
vote
6answers
150 views
How implement tarai in guile
I now would like to run tarai, which reads in Prolog as follows. A test case would be to run ?- tarai(12,6,0,X). This is quite a hard test case, for example GNU Prolog crashes with this test case.
...
1
vote
1answer
105 views
Alter REPL to display username, hostname and current working directory?
In Guile's REPL the prompt is scheme@(guile-user)>, but I want it to show my-name@hostname(current-working-directory)>. Is there a way to do this?
1
vote
2answers
109 views
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).
1
vote
0answers
57 views
Sandboxing Guile by deleting unwanted libraries?
I have an open-source GUI for which I've just implemented a very basic extension mechanism that allows the user to embed a snippet of Lisp (Guile) code in a document to allow certain functions to be ...
1
vote
1answer
70 views
How to export classes in Guile Scheme using Goops?
In my project I have several goops classes defined in different modules (hence in different files). I can't understand how to correctly export a class (and its accessories) from a module.
This is ...
3
votes
0answers
88 views
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 ...
3
votes
0answers
217 views
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 %...
1
vote
0answers
57 views
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-...
1
vote
1answer
88 views
Geiser / Emacs hangs when I start Guile web server
I'm experimenting with Guile and simple web development. I have some experience with Common Lisp and Slime. And I'm a huge fan of interactive development. Geiser is great IDE, however I loose ...
3
votes
1answer
69 views
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? ...
0
votes
1answer
567 views
configure says guile-config not found
I am trying to install libgraph on my debian stretch installation. I installed guile and other necessary packages. Also built guile from source. When I try to configure libgraph by using './configure' ...
2
votes
1answer
49 views
How to output a comment using display
I'm using scheme to output some s-expressions to a port and I would really like
to add comments to the stream I'm writing.
As the ; character will comment everything after I'm unsure how to actually
...
0
votes
0answers
36 views
What's the difference between define and defmacro-public
I try to decipher libctl.
In base/io-vars.scm, defmacro-public appears.
58(defmacro-public define-input-var
59 (name init-val var-type-name . var-constraints)
60 `(begin
61 (define-param ,name ...
0
votes
1answer
66 views
How can i check if a URL exists via Guile Scheme?
I tried to google my question before but i didn't found anything about how to check if a URL http status code is 404 or not by using scheme, so forgive me if my question can sound a little bit ...
0
votes
0answers
41 views
In procedure scm_lreadr: #<unknown port>:1:42: end of file in string constant
I am writing test code using guile/scheme and i tried to extract each line of a text file as a string and used (eval-string str) to evaluate the expresion in the string. But, i get In procedure ...
1
vote
0answers
63 views
How can I debug failed tests in guile source installation?
I'm building GNU guile-2.0.0 from its source code on an old RHEL6.6 machine. It seems to be built successfully, but I got the following error when I run make check. As I'm very new to scheme and guile,...
1
vote
1answer
78 views
Why does calling my home-rolled (reduce) function with a macro affect future calls to the function?
Background: I was working on a project in guile 1.8.8 scheme a few weeks ago and, being a little rusty, I forgot about the built-in (reduce) function, so I rolled my own. A little later, I ran into ...
1
vote
0answers
238 views
Guile | How to parse a file?
I am trying to figure out how to manipulate variables of a guile script through a config file, instead of having to edit the source code.
Got a file called test.cfg that contains this:
name = Gareth
...
1
vote
1answer
94 views
Passing chords to and returning music with Lilypond music substitution functions
I am trying to write functions in Lilypond which take a chord (or list of pitches) as an argument and return music with said chord inserted into a rhythm. More specifically, I would like the function ...
2
votes
2answers
161 views
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 ...
2
votes
1answer
103 views
scheme read function's behavior
I can't understand this scheme read function's behavior.
gosh> (null? '())
#t
gosh> (null? (read))
'()
#f
gosh> (define a (read))
'()
a
gosh> a
'()
gosh> (null? a)
#f
I expected (null?...
1
vote
3answers
151 views
How efficient is (Guile) Scheme's reverse function
It is very easy to use Scheme's reverse function, for example after creating a list in reverse order with (cons new-obj my-list) rather than (append my-list (list new-obj)).
However, I'm wondering ...
0
votes
1answer
80 views
Error building Guile-2.2.2 on cluster
I am trying to install Guile-2.2.2 locally on a cluster. I installed (locally) all the prerequisites for guile as mentioned in the README file. When I run configure using the command below, I do not ...
0
votes
1answer
49 views
Compiling g-wrap
I am trying to compile G-Wrap from http://www.nongnu.org/g-wrap/download.html.
When I go through the usual steps (configure, make, make install) however, I get some errors in the make step:
Step 1: ....
0
votes
1answer
109 views
Guile Scheme parallel forms speedup
I am experimenting with the parallel forms of Guile Scheme and I have the following code:
(use-modules (srfi srfi-1)
(ice-9 pretty-print)
(ice-9 receive))
(define (busy-...
2
votes
0answers
215 views
Guile Scheme scripting tutorial loading scripts
I am trying to learn a bit Guile Scheme and I am looking at the tutorial at gnu: Scriping Examples
Currently I have the following code:
modules.scm:
#!/usr/bin/env sh
exec guile -l fact.scm -e '(@ (...
1
vote
1answer
132 views
How to have objects print nicely in Guile scheme repl
I'm using GOOPS in Guile Scheme 2.2.3. If I have code like:
(use-modules (oop goops))
(define-class <vec3> ()
(e0 #:init-value 0.0 #:init-keyword #:e0)
(e1 #:init-value 0.0 #:init-keyword ...
3
votes
2answers
242 views
macro expansion in guile scheme
In Guix there's a layer made of macros beautifying the creation and manipulation of srfi-9 records
The code is in guix/records.scm
The code is large and articulated
I thought to expand those macros ...
2
votes
1answer
97 views
SICP practise 3.51 Wrong type to apply: #<syntax-transformer cons-stream>
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 (...
1
vote
0answers
143 views
Connect to Websocket Via Guile
I have near no knowledge/experience with sockets of any kind so my question may just end up being due to my ignorance.
Guile doesn't have any concept of the protocol but I figure, since websockets ...
0
votes
1answer
133 views
Where to install “guile-git” on Ubuntu 14?
I got stuck installing "git clone https://gitlab.com/guile-git/guile-git.git". In which directory is this supposed to be cloned and installed?