Questions tagged [chicken-scheme]

CHICKEN is a compiler for the Scheme programming language.

CHICKEN is a compiler for the Scheme programming language. CHICKEN produces portable, efficient C, supports almost all of the R5RS Scheme language standard, and includes many enhancements and extensions. CHICKEN runs on Linux, MacOS X, Windows, and many Unix flavours.

Important Links

185 questions
0
votes
1 answer

How do I paste multiple lines into the chicken scheme interpreter?

Trying to get started with Chicken Scheme I'm finding myself thwarted by the REPL. CSI doesn't seem to allow me to paste multiple lines into it, which makes it really hard to work an a new function in a separate file and then paste it in to test…
masukomi
  • 10,313
  • 10
  • 40
  • 49
0
votes
1 answer

reading from STDIN, Chicken Scheme

I know how to (more or less) do this in C: #include #include int main(int argc, char** argv) { char buf[BUFSIZ]; fgets(buf, sizeof buf, stdin); // reads STDIN into buffer `buf` line by line if (buf[strlen(buf) - 1] ==…
Alexej Magura
  • 4,833
  • 3
  • 26
  • 40
0
votes
3 answers

How to find unused lists/procedures in scheme?

I am cleaning up some (Chicken) scheme code and I want to identify all lists/procedures not used in a given program. Is there a specific option to pass either to the Chicken compiler or to csi -s I can use to do so without listing out each define…
xuinkrbin.
  • 975
  • 2
  • 7
  • 17
0
votes
1 answer

Delete char from string X many times

I need to remove a character from a string, but I can't figure out how to specify a count, that is a limit on how many times said character should be removed from string in Chicken. Here's how I'd do it in Common Lisp: (let ((a "abca")) (delete…
Alexej Magura
  • 4,833
  • 3
  • 26
  • 40
0
votes
2 answers

Scheme's version of C's `++`

How would I go about incrementing a variable, that is doing something like a=0; a++; in Chicken? In Common Lisp I'd do this using incf like so: (setf a 0) (incf a) (print a) ;=> 0 ;=> 1 ;=> 1 ;=> 1 But Chicken-scheme doesn't seem to have a incf…
Alexej Magura
  • 4,833
  • 3
  • 26
  • 40
0
votes
1 answer

How to use getopt-long in Chicken

How do I use getopt-long in Chicken? I've got the following code: (require 'getopt-long) (define grammar `((help (required #f) (value #f) (single-char #\h)) (limit (required #t) (value #f) ;; optional value …
Alexej Magura
  • 4,833
  • 3
  • 26
  • 40
0
votes
1 answer

How do i get line number information for Chicken scheme errors

I am trying to isolate the cause of an error. The interpreter give "bad argument type" and a call history of 16 identical lines: [procedure name] (sexpr). However, this procedure is call from many different places in the program. Is there a…
xuinkrbin.
  • 975
  • 2
  • 7
  • 17
0
votes
1 answer

In Chicken Scheme how can I require files when writing a script

I'm using the BDD library missbehave for Chicken Scheme to write some scripts. I currently have a single file containing my specs and my code that I run with behave. This works as expected. Running my tests to verify the code. I know that when using…
eightbitraptor
  • 267
  • 2
  • 6
0
votes
1 answer

Looping over a list and generate serial statements in a lambda

I have a macro called compare-and-swap!: (define-macro (compare-and-swap! l x y) `(if (> (vector-ref ,l ,x) (vector-ref ,l ,y)) (vector-swap! ,l ,x ,y))) It works, I'm testing it like this: (define v (list->vector '(5 4 3 2 1))) (print…
Janus Troelsen
  • 20,267
  • 14
  • 135
  • 196
0
votes
2 answers

Error during expansion of macro in Chicken Scheme

I'm learning how the macro system in Scheme works and I'm trying to make my code look more JavaScript-y. So I thought I would start with the function macro. This is how I want a function definition to look: (function id (x) x) It should expand to…
Aadit M Shah
  • 72,912
  • 30
  • 168
  • 299
0
votes
1 answer

How to use the abort procedure in Chicken Scheme

I'm trying to use Chicken Scheme's abort procedure as shown in the code below: (module change-calculator (export calculate-change) (import scheme) (define (calculate-change coin-values amount) (cond ((null? coin-values) (abort '"coin-values…
Bas Bossink
  • 9,388
  • 4
  • 41
  • 53
0
votes
2 answers

How to perform benchmarking in scheme?

I am looking to test various Scheme constructs for comparison purposes and was wondering how to go about doing so. I know Ruby has a dedicate module for such benchmarking and a web search does not appear to readily provide a Scheme version. Can…
xuinkrbin.
  • 975
  • 2
  • 7
  • 17
0
votes
1 answer

How can I get platform specific information on stack limits

I'm playing around with making an interpreter that does memory allocation in the style of Chicken Scheme. The basic idea is: int main() { instruction instructions[] = { zero_root, print_root, hello_world, hello_world, stop…
0
votes
1 answer

How to print all the "parts" of a data structure made with defstruct in chicken scheme

Let's say that we have the above code: (require-extension defstruct) (defstruct tree height age leaf-color) (define coconut (make-tree height:30 age: 5 leaf-color: 'green)) I know i can use (tree-height coconut) to…
spk
  • 153
  • 9
-1
votes
1 answer

Symbols in chicken scheme egss don't get bound

Using chicken scheme, i installed some 'eggs', but when trying to use any procedure from them, the procedures name is never bound to an actual procedure. For example, on the csi interpreter: #;1> (import glfw3) #;2> (init) Error: unbound variable:…
am121
  • 31
  • 2
1 2 3
12
13