Questions tagged [r5rs]

The 5th Revised Report on the Algorithmic Language Scheme

The 5th Revised Report on the Algorithmic Language Scheme, R5RS is a de facto standard for Scheme implementations. Schemers take pride in the fact that at 50 pages the specification is shorter than the index for books on some other languages.

225 questions
15
votes
1 answer

R6RS vs. R5RS scheme

I'm relatively new to scheme and am having a hard time finding a concrete document online overviewing the major changes that happened with R6RS. Anyone care to elaborate?
Chris Bolton
  • 2,878
  • 6
  • 38
  • 57
15
votes
1 answer

Differences between Guile Scheme and Standard Scheme (in Racket IDE)?

I've got a bunch of "legacy" Guile Scheme code that I want to get running in the Racket Scheme IDE. There appear to be enough differences to make this a non-trivial exercise. (My level of Scheme knowledge is the level to complete the The Little…
hawkeye
  • 34,745
  • 30
  • 150
  • 304
9
votes
1 answer

Scheme, SICP, R5RS, why is delay not a special form?

This is concerning chapter 3.5 from SICP, in which streams are being discussed. The idea is that: (cons-stream 1 (display 'hey)) Should not evaluate the second part of the cons-stream, so it should not print “hey”. This does happen, I get the…
KnowsLittle
  • 1,197
  • 2
  • 13
  • 20
9
votes
2 answers

Is there a digest for different "RnRS" Scheme standards?

I need to choose a Scheme standard for an academic compiler implementation. It has to be simple enough, but should still be a powerful language. There are several (RRS–R7RS) standards of Scheme. Is there a public comparison of these reports for…
Necto
  • 2,594
  • 1
  • 20
  • 45
8
votes
4 answers

Scheme getting last element in list

Im trying to write a simple scheme function that returns the last element of a list. My function looks like it should work, but I managed to fail on something: (define (last_element l)( (cond (null? (cdr l)) (car l)) (last_element (cdr…
calccrypto
  • 8,583
  • 21
  • 68
  • 99
7
votes
1 answer

Extensible macro definitions

Inspired by a comment thread on a related question regarding functions instead of macros. Is there any way to extend a Scheme syntax definition so that it can use the previous definition of the syntax in the new definition? Furthermore, this must be…
Lily Chung
  • 2,919
  • 1
  • 25
  • 42
6
votes
2 answers

SICP exercise 1.5 and 1.6

In addition to question What's the explanation for Exercise 1.6 in SICP?. So Dr. Racket (R5RS) evaluates sqrt-iter function with "if" in finite time, clearly showing normal order evaluation. But if I use example from exercise 1.5 (define (p)…
Vasaka
  • 579
  • 6
  • 17
5
votes
2 answers

Multiple lines comments in Scheme (RnRS)

I created this solution: ; use like this: ; (/* content ... */ ) ; or ; (/* content ... */) => #f (define-syntax /* (syntax-rules (*/) ((/* body ... */) #f) ((/* body ... */ r) r))) But is it really the best or easiest…
Felipe
  • 16,649
  • 11
  • 68
  • 92
5
votes
1 answer

A "pure" scheme implementation (R5RS) of SHA256?

I can use SHA256 in Scheme using external libraries (Java, C or system dependent) or using a specific Scheme implementation (like Chicken e.g.), but I wonder if there is a "pure" scheme implementation.
Felipe
  • 16,649
  • 11
  • 68
  • 92
5
votes
6 answers

Is it possible to "extend" a function / lambda / macro in Scheme?

For example: if I want the function equal? recognize my own type or record, can I add a new behavior of equal?? without erasing or overwriting the old one? Or for example if I want to make the function "+" accept also string?
Felipe
  • 16,649
  • 11
  • 68
  • 92
4
votes
3 answers

How do I break a Scheme list into args to be passed to a procedure?

I want to use the predefined (max) function (R5RS) with a list of numbers, which varies in length. Unfortunately, (max) accepts input like this: (max 2 43 5 6) => 43 I'm attempting to use it like so: (define lst '(3 5 53 4 53 54 32)) (max…
ray
  • 1,966
  • 4
  • 24
  • 39
4
votes
5 answers

Scheme List Manipulation (Recursion)

The basic problem here is, when given a list, to return all elements of that list other than the last element. For example, given (a b c d) --> return (a b c). I essentially have the function, it's just the Scheme syntax that I'm having trouble with…
Chris Arena
  • 1,602
  • 15
  • 17
4
votes
0 answers

Differences between the first and second editions of Queinnec's "Lisp in Small Pieces"

I would like to study Queinnec's book "Lisp in Small Pieces". I already have the English version of the first edition, the French version of which appeared in 1994, at the time of the R4RS. A quick look at the table of contents of the second edition…
Alex M.
  • 483
  • 11
  • 23
4
votes
2 answers

Create new identifier with macros

I want a macro that create a new identifier like (new-name first second) => first-second that could be used to define new toplevel bindings (define-syntax define-generic (syntax-rules () ((define-generic (name a b ...)) (begin …
knivil
  • 916
  • 5
  • 10
4
votes
2 answers

Racket and unbound identifier in lambda expression, contrast with r5rs

In DrRacket, when I set the language to R5RS and run the following code: (lambda (x) z) it runs without error and returns #. This makes sense to me; the lambda form defines a procedure whose body has not yet been evaluated, and so that…
Vultan
  • 409
  • 3
  • 13
1
2 3
14 15