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

Using Scheme to assign the value returned by a function to a variable in another function

I have a function remove_duplicates that removes the duplicates in a list and returns the new list. (define (remove_duplicate list) (cond ((null? list) '() ) ;member? returns #t if the element is in the list and #f otherwise ((member?…
CS student
  • 305
  • 1
  • 3
  • 13
0
votes
1 answer

Filtering C structures with GNU guile

I'm new to scheme/guile. I'd like to filter an array of C struct inside a C program using a user's scm script. Something like: struct Date { int year; int month; int day; }; struct Person { char name[20]; Date birth; …
Pierre
  • 34,472
  • 31
  • 113
  • 192
0
votes
2 answers

Is there anyway to check if a function return nothing in Scheme?

Is there anyway to check if a function return nothing in Scheme? For example: (define (f1) (if #f #f) ) or (define (f2) (values) ) or (define (f3) (define var 10)) How can I check if f return nothing? Thanks in advance.
Sang
  • 4,049
  • 3
  • 37
  • 47
0
votes
1 answer

Assigning a value only if certain conditions are fulfilled in Scheme

I have a list which may contain some null values. However, I intend to ignore those null values. Example of my list would be: (() () MC+ () MD- () () ME+) In my procedure I am iterating over these elements and using let I am creating a local binding…
Rohit Shinde
  • 1,575
  • 5
  • 21
  • 47
0
votes
1 answer

Passing only one parameter to map instead of two in Scheme

I have a function in scheme (extract-disjunct word nodes) that takes two parameters: word and nodes. I have a sentence: "This is a test sentence". For each word in this sentence I want to apply the above given function. This can be done with a…
Rohit Shinde
  • 1,575
  • 5
  • 21
  • 47
0
votes
2 answers

How to have Guile on Ubuntu interpret Scheme source file?

First of all this might be really basic thing but I do not know how to proceed. I have Guile 2.0.9 and Libctl 3.2.2 installed on my Ubuntu 14.04.1 64-bit LTS. My aim is to write a source file in Scheme then have it interpret by Guile so I do not…
Vesnog
  • 773
  • 2
  • 16
  • 33
0
votes
1 answer

Trouble using hashq-get-handle in Guile

I'm having trouble getting the value associated with a key in a hash-table and I'm totally confused as to what I'm doing wrong. The code I'm using is shown below: (use-modules (curl)) (use-modules (json)) ;; use curl to hit the site's api to get…
unclejamil
  • 445
  • 3
  • 10
0
votes
1 answer

How to build make 4.0 from make 3.82?

I'm trying to upgrade my SH4 cpu packages. 'make''s version was 3.82. If I want to upgrade to 'make' 4.0, it require to build 'guile'. When I build 'guile'. It shows $ cd guile-2.0.11 $ ./configure --prefix=/usr --disable-static …
Daniel YC Lin
  • 15,050
  • 18
  • 63
  • 96
0
votes
1 answer

Setting alist with dynamically evaluated variable name in Guile Scheme

Currently, I have the following alist: (define globals '((objects test))) The name of its variable is stored in another alist: (define test '((loc globals) (other properties))) I would like to easily retrieve the objects list in globals. I first…
Elzair
  • 452
  • 1
  • 4
  • 11
0
votes
0 answers

Cygwin - Error Running Program on Windows 8.1

Operating System: Windows 8.1 Cygwin Version: Latest version, as of Sept. 9, 2014. Guile Version: 1.8 Background: My overall goal is to install a program called "MIT Photonics Band (MPB)" on Windows 8.1 using Cygwin. I am a new user, as I started…
Aman
  • 1
  • 1
0
votes
1 answer

How to create a macro that generates another macro in SISC / Scheme?

In Guile or using SRFI-46 it is possible like shown in Specifying a Custom Ellipsis Identifier. But is it possible in SISC or "pure scheme" R5RS? I know it is possible without using ellipsis, but what if I need to use inner ellipsis like the example…
Felipe
  • 16,649
  • 11
  • 68
  • 92
0
votes
1 answer

How do I link c++ code against "libguile" with "guile-1.8.8"?

I want to embed guile in a c++ application, but I get "undefined reference" errors when I try to compile: Ubuntu 12.04 guile-1.8.8 If I compile the example from the guile docs gcc -o guile-test `pkg-config guile-1.8 --cflags` `pkg-config guile-1.8…
0
votes
1 answer

Test if error occurred in a Guile function

I'm trying to create a function in Guile which tests if an arbitrary expression threw an error or not, but have hit a wall. (define (error-or-not qqx) (if (catch #t (lambda () ,qqx) (lambda (k . args) #t)) #t …
Yawar
  • 11,272
  • 4
  • 48
  • 80
0
votes
1 answer

NZEC on INVCNT with Guile on Spoj

I get NZEC with the following code for INVCNT ; for lists of length > 2 inversions are the same as the number of elements ; against which the first is greater + the inversions of the remaining (define (inversions l) (cond ((< (length l) 2)…
Himanshu
  • 2,384
  • 2
  • 24
  • 42
0
votes
3 answers

Can I assign a list of symbols to a list of elements in Guile?

I'm writing some guile code that gets a list of a set length, and I need to define a variable for every element in the list. Currently, I have to do something like this: (define (foo l) (let ((e-1 (car l)) (e-2 (cadr l)) (e-2…
charmlessCoin
  • 754
  • 3
  • 13
1 2 3
17
18