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

equal? and record-type

Suppose I have the following Scheme (R6RS) code: (define-record-type typeA (fields (mutable A))) and that I create two records: (define X (make-typeA 123)) (define Y (make-typeA 123)) I can't understand why (equal? X Y) and (equal? (make-typeA…
Aslan986
  • 9,984
  • 11
  • 44
  • 75
1
vote
1 answer

How to convert r6rs macro involving syntax-case to racket?

I am learning scheme/racket macros, and trying to make the following macro from sweet-macros work under racket 8.6. #lang racket (require (for-meta 1 srfi/1)) ; for cons* and fold-right (provide…
thor
  • 21,418
  • 31
  • 87
  • 173
1
vote
2 answers

Why might the Scheme `filter` form not process list elements 'in order'?

(filter procedure list) applies procedure to each element of list and returns a new list containing only the elements for which procedure returns true. (R. Kent Dybvig The Scheme Programming Language) (online) What may not be apparent from this…
mnemenaut
  • 684
  • 2
  • 11
1
vote
1 answer

How to write a macro that maintains local state?

This seems to work, it's a macro that expands to successive integers depending on how many times it has been expanded. ;; Library (test macro-state) (library (test macro-state) (export get-count incr-count) (import (rnrs)) (define *count* 0) …
john
  • 85,011
  • 4
  • 57
  • 81
1
vote
1 answer

ikarus implementation of vector-map

This bit of code is in Ikarus' implementation of vector-map: (let f ([p p] [v v] [i 0] [n (vector-length v)] [ac '()]) (cond [($fx= i n) (ls->vec ac n)] [else (f p v ($fxadd1 i) n (cons (p (vector-ref v i))…
dharmatech
  • 8,979
  • 8
  • 42
  • 88
1
vote
1 answer

notation in r6rs grammar for complex numbers

In r6rs grammar for numbers there is this rule: => .... | @ If I evaluate in mit-scheme the "number" 2@2 I get this strange complex number. 1 ]=> 2@2 ;Value: -.8322936730942848+1.8185948536513634i I did not find…
alinsoar
  • 15,386
  • 4
  • 57
  • 74
1
vote
1 answer

Arity mismatch when constructing a child record type

I have a point record type defined as follows: (define-record-type point (make-point x y) point? (x point-x) (y point-y) ) Now, I want to extend the point record type and define a new record type as follows: (define-record-type…
xabush
  • 849
  • 1
  • 13
  • 29
1
vote
2 answers

What's the benefit of "to distinguish procedures from lambda expressions and symbols"

I'm reading the r6rs(Revised6 Report on the Algorithmic Language Scheme), in the "INTRODUCTION" part there is one summary: "Scheme was the first major dialect of Lisp to distinguish procedures from lambda expressions and symbols, to use a single…
dhCompiler
  • 31
  • 4
1
vote
1 answer

Redefining syntactic keywords in r6rs

How can I create a library called rnrs-modified which will make the following code display "Hello, world!"...? #!r6rs (import (rnrs-modified)) (display set!) or even this would be good (arguably better, actually): #!r6rs (import (rnrs) (modified))…
Cam
  • 14,930
  • 16
  • 77
  • 128
1
vote
1 answer

How to make just part of a macro hygienic

I'd like to have a version of lambda, called lambda-r, from within which you can return. An example: (+ ((lambda-r () (return 1) 2)) 5) This would give the value 6. Although you might expect the value to be 7, it's 6 because 1 is returned…
Cam
  • 14,930
  • 16
  • 77
  • 128
1
vote
1 answer

exact/inexact results like sqrt and integer roots

R6RS 3.4 Implementation requirements reads ... Potentially inexact operations such as sqrt, when applied to exact arguments, should produce exact answers whenever possible (for example the square root of an exact 4 ought to be an exact 2). (1)…
false
  • 10,264
  • 13
  • 101
  • 209
1
vote
1 answer

getting command line arguments in Scheme using `command-line` function

This question has definitely been asked before, here. Some of the solutions presented did work(in Windows) except for the command-line function mentioned in Command-line access and exit values in r6rs-lib. I managed to achieve what I wanted in…
gebby
  • 155
  • 1
  • 5
1
vote
1 answer

Selectors in Scheme R6RS

I'm reading a old book Simply Scheme: Introducing Computer Science you can find it here . In the fifth section it introduces the "selectors", operators like the following: (first 'abcd) ;-> A (butfirst 'abcd) ;-> BCD and so on.. Does it exist…
Aslan986
  • 9,984
  • 11
  • 44
  • 75
1
vote
2 answers

Print the name of a variable

Is it possible in Scheme R6RS to print the name of a variable? I mean: (define (f) (lambda (arg) (display ( *name* arg)))) Such that: (define my-var 3) (f my-var) ; => displays the string "my-var")
Aslan986
  • 9,984
  • 11
  • 44
  • 75
0
votes
0 answers

Annoying DrRacket bug

I'm using DrRacket to develop R6RS programs but I often see a bug where DrRacket hangs when either clicking on Check Syntax or Run. For example when checking syntax the message 'Check Syntax: expanding expression' is displayed at the bottom of the…
john
  • 85,011
  • 4
  • 57
  • 81