Questions tagged [chibi-scheme]

Small Footprint Scheme for use as a C Extension Language

Small Footprint Scheme for use as a C Extension Language

https://github.com/ashinn/chibi-scheme

8 questions
7
votes
2 answers

Chibi Scheme - Simple define-library example not working

I wrote the following example, in an attempt to experiment with R7RS libraries in Chibi Scheme 0.5.3: (define-library (example hello) (export hello-world) (import (scheme base)) (begin (define (hello-world) "hello, world")))…
Justin Ethier
  • 131,333
  • 52
  • 229
  • 284
3
votes
1 answer

Does a syntax-rules expression by itself evaluate to a value in Scheme?

In Chibi and CHICKEN, the following syntax-rules expression evaluates to a procedure: (syntax-rules () ((_) #f)) Is this just an artifact of how these particular implementations are written? The Scheme language specs do not seem to call out…
Justin Ethier
  • 131,333
  • 52
  • 229
  • 284
2
votes
2 answers

Scheme: Passing defines inside macro definition to submacro?

Consider the following macro definition in R7RS scheme: (define-syntax foo (syntax-rules () ((_ bar) (begin (define baz 42) (define-syntax bar (syntax-rules () ((_) baz))))))) I have loaded this…
Marc
  • 4,327
  • 4
  • 30
  • 46
1
vote
1 answer

Scheme: list all bindings in scope

In R7RS or chibi-scheme, is there a function I can call to get a list of symbols containing all bindings in the current scope? As a comparison, in Python, I can use functions globals() and locals() to see what names are available in the current…
math4tots
  • 8,540
  • 14
  • 58
  • 95
1
vote
1 answer

Chibi-scheme Error with Iterator

Anyone got any idea why chibi-scheme throws the error below while attempting to use the chibi-loop up-from function: ERROR: car: not a pair: # ERROR in set-dk! on line 590 of file /usr/local/share/chibi/init-7.scm: cdr: not a pair:…
cobie
  • 7,023
  • 11
  • 38
  • 60
0
votes
1 answer

Out of bounds index returns correct values from vector created in chibi scheme

I've embedded chibi scheme into my C++ application and am trying to create a float vector with a size of 3 in scheme, and then get the individual values of that vector back into my c++ program, however when I attempt to do so I only get the correct…
0x003
  • 65
  • 9
0
votes
1 answer

chibi-scheme embedded: calling scheme function with multiple params from C

The following site shows an sample of embedding chibi scheme into a c program: http://synthcode.com/scheme/chibi/ /* construct a Scheme expression to eval */ obj1 = sexp_intern(ctx, "my-procedure", -1); obj2 = sexp_cons(ctx, obj1,…
Dess
  • 2,064
  • 19
  • 35
0
votes
1 answer

Get struct* from out parameter in Chibi Scheme FFI bindings

Can you get a struct * from the out parameter of a C function in Chibi Scheme? I'm trying to get a struct archive_entry * from this C function: int archive_read_next_header( struct archive *archive, struct archive_entry **out_entry); In C…
Lassi
  • 3,522
  • 3
  • 22
  • 34