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
1
vote
0 answers

How can I input a password in Chez Scheme?

I want to write a simple file encryption/decryption program in Chez Scheme, using the scripting feature of Chez Scheme to run the program from the Unix command line. To do that, I need to input the key. I want to prompt the user to enter the key at…
user448810
  • 17,381
  • 4
  • 34
  • 59
1
vote
2 answers

How to implement asynchronous code that looks synchronous mimicking async / await?

Otherwise said, I want to rely on epoll (or similar) to write asynchronous network code that looks like regular code that is without relying on callbacks. The code must look like synchronous code but unlike synchronous code instead of blocking to…
amirouche
  • 7,682
  • 6
  • 40
  • 94
1
vote
2 answers

Chez Scheme Record - Functional Copy/Update?

I have searched the Chez Scheme documentation for an answer to this question but can't seem to find it: Does Chez have a functional copy/update for its Records - something like Racket has for its Structures? Thank you.
ericky
  • 1,641
  • 2
  • 14
  • 16
1
vote
1 answer

Encrypt [Petite Chez Scheme]

I had a question about a program I've been trying to get running. Encrypt takes a message, public-key, and private-key, and returns the message with the letters from the message in the public-key changed to the letters from the private-key. For…
mdegges
  • 963
  • 3
  • 18
  • 39
1
vote
1 answer

Printing hashtables in Scheme (Chez)

I'm using quite a lot of (standard R6RS) hashtables in Chez Scheme, but it's not very nice working with them at the REPL because they are just printed as #. I have written a print-table function but it's a bit annoying to keep calling…
tommaisey
  • 449
  • 2
  • 10
1
vote
1 answer

Can one speed up this Chez Scheme microbenchmark?

This double loop is 50 times slower in Chez Scheme than in C++ (compiled with --optimize-level 3 and -O3, respectively) (import (rnrs) (rnrs r5rs)) (let* ((n (* 1024 16)) (a (make-vector n)) (acc 0)) (do ((i 0 (+ i 1))) …
MWB
  • 11,740
  • 6
  • 46
  • 91
1
vote
1 answer

In Scheme, what is the returned value of `(begin)`?

I know that (begin expr1 expr2 ...) will evaluate all of the expressions and will return the last one evaluated. I found that in Chez Scheme it's allowed to use begin without expressions like so: (begin). I'm using Chez Scheme as part of my studies.…
1
vote
0 answers

How to pass void** to a foreign function in Chez Scheme

When a foreign function declared as int open_db(char *path, Db **db) creates internally an instance of Db and assigns the pointer to *db, what is the most efficient way to handle this from Chez Scheme? The only thing I could come up with was…
1
vote
2 answers

How to import files relative to main file, instead of current directory? ((Chez) Scheme)

For example, in my main.scm file I have (load "util.scm"). util.scm is a file in the same folder as main.scm. Both files are located in ~/documents/myproject/. Now when I'm in this directory, and I run $ chez-scheme main.scm everything works fine.…
Lara
  • 2,594
  • 4
  • 24
  • 36
1
vote
2 answers

How to configure Sublime3 for chez scheme?

I have compile chez scheme and installed sublime3 SublimeREPL and scheme in OSX system. and config as How to configure SublimeREPL for mit-scheme? topic. edit SublimeText3 >> InstalledPackages >> Scheme.sublime-package (open with Zip software) >>…
ryandroll
  • 11
  • 2
1
vote
0 answers

petite chez scheme interpreter in eclipse

I installed the "schemeway" plugin in eclipse and now i need an interpreter. I'm trying to set the "petite chez scheme" interpreter on eclipse but with no success. i tried to fill the boxes with the name of the interpreter and set the "Working…
kitsuneFox
  • 1,243
  • 3
  • 18
  • 31
1
vote
1 answer

Using match in chez scheme

I'm trying to learn how to use match in scheme. I sort of understand how it works with really short problems (ie: defining length is just two lines) but not with problems where there's more than one input, and helper programs. For example, here's a…
mdegges
  • 963
  • 3
  • 18
  • 39
1
vote
1 answer

What is the fastest way to do integer division?

Using scheme I have the need to use the following function. (All args are natural numbers [0, inf) ) (define safe-div (lambda (num denom safe) (if (zero? denom) safe (div num denom)))) However, this function is called quite…
Ross Larson
  • 2,357
  • 2
  • 27
  • 38
0
votes
0 answers

Chezscheme says "Exception: attempt to apply non-procedure #" when I tried to print a pascal triangle

I'm new to scheme and I'm learning sicp. I'm working on exercise 1.12 and tried to print a pascal triangle with the code below. Cause I don't know much about scheme IO, I only used display procedure. (define (pascal n k) (if (or (= k 1) (= k n)) …
0
votes
1 answer

How and when to use ChezScheme's timer interrupt?

The document of Chez mentioned set-timer and timer-interrupt-handler, but how to "kick off" or combine them? Is it used to implement things like periodic events or just some delayed operation? I searched around but only find them embedded into…