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
3
votes
1 answer

Cleanest way to make a "derived" identifier?

It's very common for Scheme macros to make "derived" identifiers, like how defining a record type foo (using the R6RS syntactic record API) will by default define a constructor called make-foo. I wanted to do something similar in my own macro, but I…
lcmylin
  • 2,552
  • 2
  • 19
  • 31
3
votes
2 answers

How to load the slib library in chez scheme?

How to load the slib library in chez scheme? Or any other web server library for chez scheme? On the manual of slim it says: Configure the Scheme implementation(s) to locate the SLIB directory and implementation directories. Arrange for each…
guenchi
  • 61
  • 6
3
votes
1 answer

Chez Scheme: Macroexpand implementation

Does Chez Scheme offer a standard macroexpand implementation? If not, does some suitable replacement exist?
David Shaked
  • 3,171
  • 3
  • 20
  • 31
3
votes
0 answers

How do I correctly (import (srfi :42)) in Chez scheme?

(System: centos 7, 64 bits) I am attempting to import srfi-42 into my program. This is the first srfi in Chez Scheme for me. The srfi lib is at: /home/cecilm/play/ChezScheme/chez-srfi/srfi I added this dir to my .emacs : (setenv…
Trailing Dots
  • 378
  • 1
  • 12
2
votes
1 answer

How to find line causing exception in Chez Scheme

I have a couple of files written in Chez Scheme, each about a thousand lines. When I try to load a file into the REPL: > (load "filexxx.scm") ... Exception: variable A is not bound Type (debug) to enter the debugger. How can I figure out which line…
brj
  • 375
  • 2
  • 11
2
votes
1 answer

Is the memory of compiled/eval’ed procedures garbage-collected in Chez Scheme?

Multiple, perhaps most, language implementations that include a compiler at runtime neglect to garbage-collect discarded code (See, for example julia, where this leads to memory leaks in applications like genetic-programming) My preliminary tests…
MWB
  • 11,740
  • 6
  • 46
  • 91
2
votes
1 answer

Compiling and Installing Chez Scheme on 64 Bit Arm?

I tried to compile and install the Racket backend variant of the Chez Scheme compiler, since that now seems to support the aarch64 Arm 64 architecture, unlike the mainline Chez Scheme which is still restricted to 32bit ArmV6. I am running this on a…
haziz
  • 12,994
  • 16
  • 54
  • 75
2
votes
2 answers

set of x and x does not work in let in Scheme

I'm trying to run this line in Scheme: (let ((x y) (y x)) (set! x x) (set! y y)) where at the start of the program x is defined to be 1 and y is defined to be 2. I want the output to be x=2 and y=1 but I get x=1 and y=2 Appreciate your help!
2
votes
2 answers

How to define a function in scm scheme that tests if its parameter is a macro?

For example, assuming 'match is a macro and 'car isn't: > (macro? 'match) #t > (macro? 'car) #f
msantos
  • 21
  • 1
2
votes
2 answers

(Chez) Scheme macro for hiding lambdas

I would like to write a macro to create shorthand syntax for hiding more verbose lambda expressions, but I'm struggling to understand how to write macros (which I realize is an argument against using them). Given this example: (define alist-example …
2
votes
1 answer

Set chezschme run as geiser-default-implementation

I installed chezscheme $ chezscheme Chez Scheme Version 9.5 Copyright 1984-2017 Cisco Systems, Inc. > (define a (list 4 5 6 )) > (set-car! a 9) > a (9 5 6) and configure it as geiser-default-implementation (require 'geiser) (setq…
AbstProcDo
  • 19,953
  • 19
  • 81
  • 138
2
votes
1 answer

Find operating system and machine type in Chez Scheme

How can a Chez Scheme program or library find out which operating system and machine architecture it's running on (from within Scheme code)?
Lassi
  • 3,522
  • 3
  • 22
  • 34
2
votes
1 answer

Re-import a library in Chez Scheme

In Chez, how do I reload (re-import) a library into the REPL that I've already imported once? The Chez Scheme User's Guide says: When defined directly in the REPL or loaded explicitly from a file, a library form can be used to redefine an existing…
Lassi
  • 3,522
  • 3
  • 22
  • 34
2
votes
1 answer

Check if an identifier is lexically bound at the point of macro expansion?

This is probably a bit of a newbie question, but I'm trying to write a macro that detects whether an identifier is lexically bound at the point of macro expansion, and changes its output accordingly. Is this possible in R6RS Scheme, and if so,…
lcmylin
  • 2,552
  • 2
  • 19
  • 31
2
votes
2 answers

Why can you redefine `lambda`?

I do not understand the following behavior between these two Scheme programs: Program 1: (define a (begin (display "hmmm") (newline) lambda)) This program, run using scheme test.ss, gives me a syntax error at the lambda line without…
qfwfq
  • 2,416
  • 1
  • 17
  • 30