Held Friday, September 13, 2002
Today we pause for a day to consider issues in the design of Scheme procedures and to help resolve any confusions you may have over past labs.
(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, 29 August 2002
Wednesday, 11 September 2002
Friday, 13 September 2002
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 Mon Dec 2 08:40:57 2002.
The source to the document was last modified on Fri Sep 13 08:42:32 2002.
This document may be found at