Questions tagged [r6rs]

The 6th Revised Report on the Algorithmic Language Scheme.

The 6th Revised Report on the Algorithmic Language Scheme was completed in 2007 and is intended to be the latest standard for implementations of the Scheme language. However, there was significant dissent among the Scheme community (informed arguments for and against can be read here), with the development teams of some Scheme compilers refusing to adopt the standard.

61 questions
0
votes
0 answers

How to export the same code as both an R6RS and R7RS library

I have written some procedures that I want to package as both an R6RS library and an R7RS library. The procedures are in a file named mylib.scm: (define (multiplier n) ; Private (lambda (x) (* n x))) (define double (multiplier 2)) ;…
Flux
  • 9,805
  • 5
  • 46
  • 92
0
votes
1 answer

Exporting a populated hashtable from a library

Here's a library which exports a hashtable. The library also contains expressions which populate the hashtable: (library (abc-1) (export tbl) (import (rnrs)) (define tbl (make-eq-hashtable)) (hashtable-set! tbl 'a 10) (hashtable-set!…
dharmatech
  • 8,979
  • 8
  • 42
  • 88
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
2 answers

Hygienic macro r7rs : Return second expression value

I'm currently learning some r7rs and I am trying to implement a macro 'begin' as following : (begin0 expr0 expr1 ... expr2) With expr being a regular expression (Like (set! x (+ x 1))) And begin0 as a macro that evaluates all the expression but…
Lucas M
  • 13
  • 4
0
votes
1 answer

Rotating a matrix, why isn't it working as a function, yet it does in line command?

A way to rotate a matrix is by getting it's transpose and then reversing all the rows. I've got around it with two functions, map (which returns the transpose) and reverse (completing a 90° rotation), in console I do the following: (reverse (apply…
Yoakain
  • 15
  • 2
0
votes
2 answers

How do I return a copy of an object?

I need to implement a function of one argument -- obj -- that returns a Scheme expression that, when evaluated, will return a copy of obj. Any ideas on how to proceed with the problem?
Avi C
  • 176
  • 1
  • 15
0
votes
1 answer

Order of evaluation in scheme

This is what works: (define obj1 (maak-object (coord 1 1) #f #f #t)) (set! karaktersenobjectenlijst (append karaktersenobjectenlijst (list (list 'object obj1))))) > (cadar karaktersenobjectenlijst) obj1 > (positie…
Vincent
  • 11
  • 1
0
votes
1 answer

How to delay an image swap in DrRacket?

i am trying to make aan animation for my game in DrRacket, when i press the left button i want my image to do a running animation (legs open --> legs closed). Is there a way i can delay the image swap? The computer does the swap soo fast that you…
KillerZ224
  • 41
  • 2
0
votes
1 answer

Why do all procedures have to be defined before the compiler sees them?

For example, take a look at this code (from tspl4): (define proc1 (lambda (x y) (proc2 y x))) If I run this as my program in scheme... #!r6rs (import (rnrs)) (define proc1 (lambda (x y) (proc2 y x))) I get this error: expand: unbound…
Cam
  • 14,930
  • 16
  • 77
  • 128
0
votes
1 answer

Do you have to use display to output stuff using r6rs?

Background: I am new to scheme, and am using DrScheme to write my programs. The following program outputs 12345 when I run the program as r5rs: 12345 However the following program outputs nothing (it's an r6rs program): #!r6rs (import…
Cam
  • 14,930
  • 16
  • 77
  • 128
0
votes
1 answer

How do you check if a value is of type "error" in Scheme?

The manual on standard libraries for Scheme r6rs suggests that if I import the library (rnrs exceptions (6)) I should be able to call (error? val) to check if a given value is an &error type. I want to do this for unit testing. I've added the…
Reggie
  • 413
  • 2
  • 9
  • 19
0
votes
1 answer

r6rs and define-record-type

HY everyone, for class i had to import some libraries. i got an error, after checking the libraries out, the problem basically boils down to r6rs that gives this error : define-record-type: unbound identifier in module in: define-record-type in…
0
votes
0 answers

Contract violation expected when using a module from R6RS

I have the following module in abc/main.rkt: #lang racket (provide (all-defined-out)) (define (abc) 10) Here's a short R6RS program which imports that module: #!r6rs (import (rnrs) (abc)) (display (abc)) (newline) This error message appears at…
dharmatech
  • 8,979
  • 8
  • 42
  • 88
0
votes
1 answer

Datum-skipping comment "#;" while making parser for R6RS with ANTLR4

I'm trying to write lexer/parser for R6RS, and I'm stuck with datum-skipping comment Here is some part of my lexer/parser rules: BOOLEAN: '#t' | '#f' | '#T' | '#F'; NUMBER: DIGIT+; // TODO: incomplete CHAR: '#\\' CHARNAME | '#\\x' HEXDIGIT+ | '#\\'…
Venusaur
  • 191
  • 12
0
votes
1 answer

How to correctly implement object inheritance in Scheme

As exercise, I'm trying to implement a small object oriented program, with 2 classes: point1d: 1 attribute (x), getter and setter point2d: inherits from point1d, add a new attribute (y) and its getter and setter I have implemented each class as a…
Aslan986
  • 9,984
  • 11
  • 44
  • 75