Questions tagged [chez-scheme]

Use this tag for questions about the Chez-Scheme dialect of the Scheme programming language.

The Chez Scheme compiler, interpreter and REPL is an R6RS compliant Scheme programming language compiler and interpreter. Written primarily by R. Kent Dybwig, formerly professor (now professor emeritus) at Indiana University, now currently at Cisco. The compiler was previously a commercial product, but has been "open-sourced" under an Apache license.

88 questions
0
votes
2 answers

How can I run scheme?

1( import ( chezscheme ) ) 2 3 4 ( define ( bigger a b ) 5 ( if ( > a b ) 6 a 7 b 8 ) 9 ) 10 11 ( define ( smaller a b ) 12 ( if ( < a b ) 13 a 14 b 15 …
Marcos
  • 111
  • 1
  • 2
  • 5
0
votes
2 answers

Capturing the output of an external call as a string (in Chez Scheme)

Using Chez Scheme, I tried to capture the output of an external command into a string port (see https://www.scheme.com/csug8/io.html): (define output (with-output-to-string (lambda () (system "ls -a"))) ) The output of (system "ls -a") is…
AlQuemist
  • 1,110
  • 3
  • 12
  • 22
0
votes
0 answers

Mixed programming between scheme and C

I'm reading the CSUG to learn the FFI of chez-scheme. So I may have some beginner's error. I just want to know is there some question of FFI. C have some type of data, just like char, float, double, int, functions, struct, union, or enumeration. But…
Novice
  • 1
  • 3
0
votes
1 answer

Is it possible to get the current raise continuation in debug mode in Chez-Scheme?

I have the following program: debugging.scm (define (fn1 x) (printf "fn1/ x=~a\n" x) (fn2 x) (printf "fn1/ end\n")) (define (fn2 x) (printf "fn2/ x=~a\n" x) (fn3 x) (printf "fn2/ end\n")) (define (fn3 x) (printf "fn3/…
chansey
  • 1,266
  • 9
  • 20
0
votes
1 answer

An error of chez-scheme FFI just like because of C Cross-platform

There is a c file #include #include struct termios raw; int raw_on(void) { if (tcgetattr(0, &raw) == -1) return -1; raw.c_lflag &= ~ECHO; raw.c_lflag &= ~ICANON; raw.c_lflag &= ~ISIG; //…
Novice
  • 1
  • 3
0
votes
1 answer

ReadProcessMemory with Chez Scheme FFI

I'm having some trouble reading from an arbitrary memory address using Chez Scheme's FFI and the kernel32/user32.dll's ReadProcessMemory function. I got the process handle and everything fine, but I'm struggling with quite a few aspects of the read…
ArooBaito
  • 1
  • 2
0
votes
1 answer

Turn off tail call optimization for debugging in Chez Scheme

I am debugging the following program in Chez Scheme. (define (proc3 x3) (printf "proc3 ~a\n" (+ 1 x3))) (define (proc2 x2) (printf "proc2 ~a\n" x2) (proc3 x2)) (define (proc1 x1) (printf "proc1 ~a\n" x1) (proc2 x1)) (proc1 'a) Run this…
chansey
  • 1,266
  • 9
  • 20
0
votes
1 answer

Scheme procedure exception about: incorrect number of arguments

I am a new schemer. Maybe this question is so easy. But it really bothers me. I defined a procedure (define insertL (lambda (new old lat) (cond ((null? lat) '()) ((eq? old (car lat)) (cons new lat)) (else (cons (car…
Tim Chan
  • 11
  • 2
0
votes
1 answer

Quoting numerical constants in Chez Scheme

I am curious as to why Chez Scheme does not treat numbers as symbols. Whether they are in a list or are quoted alone, number? returns true, meaning that it was not made into a symbol. Is there a practical reason for this? Chez Scheme Version…
Caspian Ahlberg
  • 934
  • 10
  • 19
0
votes
1 answer

Left shift into fixnum sign bit

I'm looking for a way to shift a bit from a positive fixnum into the sign position. Basically, what I want is a predictable (not undefined) way to perform a fixnum left shift without overflow checks. An inefficient implementation looks like…
Florian Weimer
  • 32,022
  • 3
  • 48
  • 92
0
votes
1 answer

A Scheme function to compose other functions

I wish to create a function that can compose two functions into one. Given g and f, it should create a function h provides the output of f as input to g. Here was my result: (define (compose g f) (lambda (.args) (g (apply f (if (atom?…
0
votes
2 answers

make-counter which retain the state of variable next

I read such a make-counter example from Section 2.9. Assignment of Scheme Programming > (define make-counter (lambda () (let ([next 0]) (lambda () (let ([v next]) (set! next (+ next 1)) v))))) >…
AbstProcDo
  • 19,953
  • 19
  • 81
  • 138
0
votes
1 answer

Math manuals in chez scheme

I could apply functions of sqrt and sin as > (sqrt 35) 5.916079783099616 > (sin 1.57) 0.9999996829318346 in chez scheme's interactive shell, but I cannot reference them in Chapter 8. Numeric Operations Where are their manuals?
AbstProcDo
  • 19,953
  • 19
  • 81
  • 138
0
votes
1 answer

Scheme error says "attempt to apply non-procedure" when flipping tuples in a list

I'm working through a textbook on programming languages, and one of the exercises was to make a function in Scheme that flips tuples in a list. Here's my code: ; invert : Listof(List(Int,Int)) -> Listof(List(Int,int)) ; usage: (invert '((a 1) (a 2)…
BrainFRZ
  • 437
  • 3
  • 15
0
votes
1 answer

Having troubles installing ChezScheme-9.5.2 in Codeanywhere

Trying to install ChezScheme-9.5.2.tar.gz on Ubuntu 16.04 LTS on Codeanywhere. During sudo make command, get error message failed because uuid/uuid.h is missing. How do I get uuid/uuid.h in a location where $ sudo make can find it?
dogwood
  • 371
  • 2
  • 11