FAQ Database Discussion Community


What extension allows access to time function in r5rs?

time,scheme,r5rs
A 4-year-old old post suggests that one might be able access the current-seconds and related functions in the r5rs language. Here's why I ask: I'm a high school teacher new to Racket and we are using the r5rs language. I would like to introduce students to functions by starting with...

scheme `promise?` Dr Racket, geiser

promise,racket,r5rs
Welcome to DrRacket, version 6.0 [3m]. Language: racket; memory limit: 128 MB. > promise? #<procedure:promise?> > (promise? (delay (+ 1 2))) #t I need to use R5RS and am working with delayed evaluation... here using geiser in emacs: racket@> (require r5rs) racket@> (cons 1 '()) (mcons 1 '()) ;; this...

Writing a While Loop in Scheme

loops,recursion,lambda,scheme,r5rs
I am trying to implement a while loop using recursion with lambda, but I just don't understand how to do it. I am supposed to start with this lambda expression: ((lambda (x) (x x)) (lambda (x) (x x)) My first question is why does this cause 'eternal' recursion? I try...

In Scheme, Is there a filter like function defined in the R5RS specification?

scheme,r5rs,mit-scheme
My baseline for this questions comes from MIT's Structure and Interpretation of Computer Programs. In the book, a filter function is defined. I know that map is part of the spec, but I see nothing resembling filter. EDIT: Specifically I'm referring to the spec here: http://www.schemers.org/Documents/Standards/R5RS/HTML/...

Defining cons, car and cdr with lambda - how does it work? [duplicate]

lambda,scheme,sicp,r5rs
This question already has an answer here: Use of lambda for cons/car/cdr definition in SICP 2 answers I can't seem to explain how this definition of cons, car and cdr works: (define (p-cons x y) (lambda (proc) (proc x y))) (define (p-car proc) (proc (lambda (p q) p))) (define...

Append list from assoc to another list in Scheme

scheme,lisp,r5rs
I'm a bit confused on how to append a list that I've gotten from the assoc procedure into another list, here is what I have: (define new-list (list 'test)) (define source-a (list '(a foo) '(b bar) '(c hello))) (append new-list (assoc 'a source-a)) (display new-list) The output is just (test)...