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
2
votes
3 answers

Installing eggs in Chicken Scheme

In MSYS2, I tried to intall a Chicken egg with:: chicken-install http-client I get several errors like the following: "c:\msys64\usr\local\bin\csc" -feature compiling-extension -setup-mode mathh.scm -shared -optimize-leaf-routines -inline…
antonio
  • 10,629
  • 13
  • 68
  • 136
2
votes
1 answer

How to use (import (prefix ...))

I'm trying to figure out how to use the > (import (prefix some-module :some-module)) docs are here I found the example of the definition here. Now, how do I then refer to a definition on it? Here are some things I…
Frank Henard
  • 3,638
  • 3
  • 28
  • 41
2
votes
1 answer

Different nCurses behaviours with different terminals

I obtain two different behaviours using different terminals, this is my code: (use ncurses) (initscr) (curs_set 0) (noecho) (start_color) (define win (newwin 20 50 1 1)) (wclear win) (box win 0 0) (for-each (lambda (y) (for-each (lambda…
Andrea Ciceri
  • 436
  • 6
  • 16
2
votes
1 answer

how to use number in CHICKEN scheme script parameter

Here is my scheme code: (define (fact n) (if (= n 1) 1 (* n (fact (- n 1))))) (define (main args) (fact (car args))) Then i run this code as a script with this command in bash: csi -ss test.scm 4 However, the interpreter get this…
user6253719
2
votes
2 answers

`getstr` in ncurses egg (Chicken Scheme)

I'm trying to figure how to use the function getstr of this egg (and consequently of mvgetstr, mvwgetstr, etc...). For example: (require-extension ncurses) (let ((stdscr (initscr)) (str (make-string 10))) (getstr str) (addstr str) …
Andrea Ciceri
  • 436
  • 6
  • 16
2
votes
2 answers

Different treatment of parameters: lambdas vs. defines in Scheme

I have two constructs that I expected to be functionally the same, but they are not and I can't figure out why. Using define (define (x2 . b) (display b) (newline)) (x2 3 4 5) => (3 4 5) Using lambda ((lambda (. b) (display b) …
AndrewE
  • 353
  • 1
  • 4
  • 16
2
votes
1 answer

How do I use a SRFI inside a module in Chicken Scheme?

The following file gives an error when it is compiled with csc. (module monoid * (import chicken scheme) (use srfi-9) (define-record-type a0 (a0) a0?)) The error is: Syntax error (import): cannot import from undefined module srfi-9 …
beroal
  • 369
  • 4
  • 14
2
votes
1 answer

What is a library unit in Chicken Scheme?

The terms "unit" and "library unit" are used in many places on the web site, but I failed to find documentation or even definitions of these terms. The only description that I found is in "User's Manual/Supported language/Declarations/(unit|uses)".…
beroal
  • 369
  • 4
  • 14
2
votes
0 answers

put a placeholder in nested parens when using cut

cut macro is defined in SRFI-26. Using this macro, you can write: (cut + 3 <>) which is equivalent to: (lambda (x) (+ 3 x)) However, when putting <> inside the the child parens, it won't work. (cut + 3 (* 2 <>)) Chicken Scheme interpreter…
ymonad
  • 11,710
  • 1
  • 38
  • 49
2
votes
1 answer

How do I get this Chicken Scheme code to compile?

Apparently my previous question was too broad. So here's the question again, simplified, and with example source code. I'm trying to compile a Chicken Scheme project containing multiple files: test-a.scm: #!/usr/bin/csi -script (declare (unit…
Sod Almighty
  • 1,768
  • 1
  • 16
  • 29
2
votes
1 answer

How to use existing macros - e.g. `let-values` - from a macro expander procedure in Chicken Scheme?

How do I call built-in Chicken Scheme macros - specifically let-values in this instance - from my own macros? (define-syntax ... (ir-macro-transformer (lambda (expr inject compare) (let-values (...) ... ... unbound variable: let-values
Sod Almighty
  • 1,768
  • 1
  • 16
  • 29
2
votes
1 answer

How to call other macros from a Chicken Scheme macro?

I'm trying to move from Common Lisp to Chicken Scheme, and having plenty of problems. My current problem is this: How can I write a macro (presumably using define-syntax?) that calls other macros? For example, in Common Lisp I could do something…
Sod Almighty
  • 1,768
  • 1
  • 16
  • 29
2
votes
1 answer

Call of non-procedure in function definition?

I found a short introduction to Scheme online, and I'm having a bit of trouble with this function: (define (title-style str) (let loop ((lc #\space) (i 0) (c (string-ref str 0))) ((if (char=? lc #\space) (string-set! str i (char-upcase…
user1610406
  • 722
  • 1
  • 13
  • 24
2
votes
1 answer

Is it possible to use user defined fuctions when expanding macro?

From chicken scheme manual: define-syntax evaluates the procedure in a distinct expansion environment (initially having access to the exported identifiers of the scheme module) Is it possible to inject the user-function to the expansion…
Feng
  • 2,872
  • 3
  • 23
  • 20
2
votes
1 answer

Trouble running Chicken Scheme in Emacs

I recently got into Scheme through Racket and I now want to use Chicken Scheme. Emacs seems to be pretty much the only option I have for developping in Scheme other than Racket so I boot up Emacs which I am not very good at. I had previously set up…