Held: Thursday, 30 October 2003
Summary: Today we pause to enjoy the wonderful weather.
(car (cdr lst))
(cdr (cdr lst))
(cons first-element reduced-list)
(cons second-element previous-list)
(define swap-first-two (lambda (lst) (cons (car (cdr lst)) (cons (car lst) (cdr (cdr lst))))))
(between a b c)should return true (#t) if b is strictly between a and c and false otherwise.
(define between (lambda (a b c) (cond ((and (< a b) (< b c)) #t) ((and (> a b) (> b c)) #t) (else #f))))
ands, just use three parameters.
(define between (lambda (a b c) (cond ((< a b c) #t) ((> a b c) #t) (else #f))))
If an expression is true, use true.Since the value returned is the same as the value of the expression, why not just use that?
(define between (lambda (a b c) (or (< a b c) (> a b c))))
exact->inexact, can you define a value, v, such that v is an integer and v is inexact. E.g.,
> (define v ...) > (integer? v) #t > (exact? v) #f
Are there other problems you've encountered in recent labs?
Thursday, 28 August 2003 [Samuel A. Rebelsky]
I usually create these pages
on the fly, which means that I rarely
proofread them and they may contain bad grammar and incorrect details.
It also means that I tend to update them regularly (see the history for
more details). Feel free to contact me with any suggestions for changes.
This document was generated by
Siteweaver on Tue Dec 9 13:59:50 2003.
The source to the document was last modified on Mon Sep 1 13:30:51 2003.
This document may be found at