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
3
votes
4 answers

shorthand for ((lambda () ))

Is there a shorthand in scheme for ((lambda () )) For example, instead of ((lambda () (define x 1) (display x))) I would love to be able to do something like (empty-lambda (define x 1) (display x))
Cam
  • 14,930
  • 16
  • 77
  • 128
3
votes
0 answers

R6RS: Does the syntax expression form applied to the empty list return a wrapped syntax object?

Consider the following expression in R6RS Scheme: (syntax ()) When I type this expression into Racket, a (wrapped) syntax object is returned. On the other hand, the same expression yields the (unwrapped) empty list in Chez Scheme. I am wondering…
Marc
  • 4,327
  • 4
  • 30
  • 46
3
votes
1 answer

Serialize scheme object to string

When doing (display obj), a nice representation is shown to the output. But is it possible to capture this representation to a string? I could use this to better handle debug information. The closest I could get is to display the object to a .txt,…
3
votes
2 answers

Advantages of different Scheme R6RS implementations

I'd like to start programming in Scheme but the variety of different implementations is confusing. What are some advantages or disadvantages of various implementations?
Jeremy
  • 1
  • 85
  • 340
  • 366
3
votes
2 answers

Append string to existing textfile in IronScheme

We are trying to construct a log file using IronScheme, and we have written a code for it using racket. It works fine in racket, but IronScheme throws an error. This is what we have so far: (define…
Robert
  • 197
  • 11
3
votes
3 answers

Racket lists incompatible with r6rs?

I'm writing a program in which i have to reuse code from one of my professors. My program is written in Racket and the code i want to reuse is written in r6rs. When I want to test my program it always fails. This is because I call a procedure with…
Kevin
  • 2,813
  • 3
  • 20
  • 30
2
votes
1 answer

Is it possible to load an entire file from disk efficiently in Scheme R6RS?

The following get_file function reads file from disk as a Scheme R6RS string: ; Gets all characters from a port (define (read_chars_from_port_rev port result) (let ((char (read-char port))) (if (eof-object? char) result …
MaiaVictor
  • 51,090
  • 44
  • 144
  • 286
2
votes
1 answer

Forcing left-to-right evaluation order in procedure call

In some cases, it is useful to call a procedure with guaranteed left-to-right evaluation order. For example, when calling a record constructor with data read from a port, order matters. Often the fields are in the same order as in the file, so no…
Florian Weimer
  • 32,022
  • 3
  • 48
  • 92
2
votes
1 answer

include vs. load in mit-scheme

What is the difference between (include path) and (load path) in mit-scheme? I grep the source code of mit-scheme and I see a few uses of include and I found the definition of load in the reference documentation, but I cannot find the semantics. I…
alinsoar
  • 15,386
  • 4
  • 57
  • 74
2
votes
1 answer

Racket R6RS support: syntax-case

This simple R6RS program: #!r6rs (import (rnrs base) (rnrs syntax-case) (rnrs io simple)) (define-syntax stest (lambda (x) (syntax-case x () ((_ z) #'(z 0))))) (stest display) works with Chez, Guile and Ypsilon but not…
Watcom
  • 2,359
  • 1
  • 17
  • 15
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
1 answer

Scheme: Using only R6RS, how do I determine a flonum's mantissa and exponent

Is this possible to extract mantissa and exponent from a float in major R6RS Scheme implementations so that: v = f x b^e f - mantissa b - base e - exponent For example: 3.14 = 0.785 x 2^2 If it's not supported, I'd like to have access to flonum's…
YasirA
  • 9,531
  • 2
  • 40
  • 61
2
votes
1 answer

lexical scoping and syntax-case

I'm trying to write a pattern matching macro. I haven't got very far but I'm already confused. My test code is as follows #!r6rs (import (for (rnrs base (6)) run expand) (for (rnrs syntax-case (6)) expand) (rnrs io simple…
john
  • 85,011
  • 4
  • 57
  • 81
2
votes
0 answers

How to change printing behaviour in DrRacket for R6RS to print results like with #lang racket

When I'm running a program in the IDE, version 5.3.5--2013-06-18(-/f), for #lang racket, eg. #lang racket (+ 4 5) (/ 10 2) When pressing Run >, the interaction window gets "9\n5\n" printed to the interactions window. The same version as…
Sylwester
  • 47,942
  • 4
  • 47
  • 79
2
votes
2 answers

R6RS Library body: definition after expression

Consider the following code: #!r6rs (library (test) (export) (import (rnrs)) (define a 5) (begin (define b 4) (+ 3 b)) 'cont (define c 5) 'done) From the R6RS Report 7.1: A is like a (see section 11.3) except…
Venusaur
  • 191
  • 12