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

Guile build error on linux

I get the following error(s), when building guile. The error is with both the versions, version 2.2.2, version 2.2.0 and version 2.0.14 fports.c: In function 'fport_input_waiting': fports.c:626:10: error: variable 'pollfd' has initializer but…
hell_ical_vortex
  • 361
  • 2
  • 11
1
vote
1 answer

Tweaking Vim syntax file for character literals in Scheme

For those who love code, there is nothing worse than looking at ugly code. My current syntax highlighting file scheme.vim for the editor vim on debian does not seem to recognize some character literals which are perfectly legal (at least in guile or…
Sven Williamson
  • 1,094
  • 1
  • 10
  • 19
1
vote
0 answers

Warning from guile when using procedure from external file

I have procedure that generate sha1 hash from string: (define (string->sha1 string) (let ((port (open-input-string string))) (hex (sha1 port)))) the function hex and sha1 are taken from A "pure" scheme implementation (R5RS) of SHA256?…
jcubic
  • 61,973
  • 54
  • 229
  • 402
1
vote
0 answers

How to prevent sql injection/escape input in sqlite

I'm using guile-dbi/sqlite and I have code like this: (dbi-query db-obj (string-append "SELECT * FROM users WHERE username = '" username "'")) How can I escape username given from…
jcubic
  • 61,973
  • 54
  • 229
  • 402
1
vote
0 answers

How to trigger a breakpoint in a guile script using gdb?

gdb has support for guile. I am trying to use the debugging capability. Here is my attempt: enter an interactive session with 'gr' command. load a scheme file. set a breakpoint to a procedure called create_branches. finally call create_tree which…
KHL
  • 316
  • 2
  • 6
1
vote
0 answers

What makes the action of this lwp program different between directly loading in commend line and using load procedure?

I use guile 2.0.13 as my scheme interpreter and i wrote file 3.3.3.scm as follow: (define lwp-list '()) (define quit-k #f) (define lwp (lambda (thunk) (set! lwp-list (append lwp-list (list thunk))))) (define start (lambda () (if (not…
linux40
  • 368
  • 1
  • 9
1
vote
0 answers

flatpak compile depedencies - permissions denied

I'm creating a flatpak package for vlc. Since flatpak runs in sandbox and vlc depends on lua -> guile -> bdw-gc -> libunistring. I have to first compile all these dependencies into flatpak sandbox. However bdw-gc and libunistring`` compile…
Ivansek
  • 372
  • 5
  • 17
1
vote
1 answer

Error in Guile Procedure "procedure->pointer": Wrong Type Argument in Position 1

So the Guile procedure "procedure->pointer" takes a return type, Scheme function, and a list of parameter types, and returns a C function pointer. procedure->pointer: (return type, Scheme function, list of parameter types) -> C function pointer My…
1
vote
2 answers

Pass command line options to guile via geiser

Geiser can be configured to read ~/.guile when running Guile from within Emacs. I would like to append command line options to the argument list passed to guile. Is there a variable that holds the command line options?
Tobin
  • 359
  • 1
  • 2
  • 14
1
vote
1 answer

How does one perform conditional statments on SMOB types?

I know that Guile has a scm_assert_smob_type function, but I do not believe that it returns a boolean. I want to be able to do something like: if (type(smob) == int_smob) { int_foo(smob); } else if (type(smob) == string_smob) { …
1
vote
2 answers

What is define* in guile or scheme?

I can't find it by searching, what is define* in guile? You can find it for instance in this answer https://stackoverflow.com/a/24101699/387194
jcubic
  • 61,973
  • 54
  • 229
  • 402
1
vote
1 answer

What exactly is low bits subtraction

I was reading this article and thought that that everything was perfectly clear until I stumble upon this: Again, most real Scheme systems use a slightly different implementation; for example, if GET_PAIR subtracts off the low bits of x, instead of…
P. P
  • 21
  • 2
1
vote
1 answer

How to find a Guile package?

I found a code example in the webs, that solves a current problem of mine by using the the os process module. (use-modules (os process)) (http://gnu-guile.7481.n7.nabble.com/getting-pipes-going-td14625.html#a14627) That's cool, except I don't have…
Falko
  • 1,028
  • 1
  • 12
  • 24
1
vote
1 answer

Colon in Scheme

(show-data 'YHOO :config 'my-config) I saw some Scheme code (in Guile) like the line above and get confused with the colon syntax :config . What kind of language features of this? Is it a intrinsic feature of Scheme, or specially designed for the…
lichgo
  • 523
  • 1
  • 6
  • 16
1
vote
1 answer

Scheme Guile: apply function all ellements but last one

I need to apply a function to all elements but the last one in a list. Basically I am writing a kind of toy compiler, so given a arithmetic term like this: (+ 1 10) I would like to get something like Plus(1, 10) I managed to get the…
pafede2
  • 1,626
  • 4
  • 23
  • 40