Fundamentals of Computer Science I (CS151 2003F)
[Skip to Body]
Primary:
[Front Door]
[Current]
[Glance]

[Honesty]
[Instructions]
[Links]
[Guidelines for Lab Writeups]
Groupings:
[EBoards]
[Examples]
[Exams]
[Handouts]
[Homework]
[Labs]
[Outlines]
[Readings]
[Reference]
Misc:
[Scheme Report]
[Glimmer Scheme Reference]
[CSC151.01 (Gum)]
[CSC151 2003S]
[CSC151 2002F]
[SamR]
Back to Input and Output. On to Files.
Held: Thursday, 30 October 2003
Summary: Today we pause to enjoy the wonderful weather.
Assignments
Notes:
(car lst)
(car (cdr lst))
(cdr (cdr lst))
(cons firstelement reducedlist)
(cons secondelement previouslist)
(define swapfirsttwo (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?
Back to Input and Output. On to Files.
[Skip to Body]
Primary:
[Front Door]
[Current]
[Glance]

[Honesty]
[Instructions]
[Links]
[Guidelines for Lab Writeups]
Groupings:
[EBoards]
[Examples]
[Exams]
[Handouts]
[Homework]
[Labs]
[Outlines]
[Readings]
[Reference]
Misc:
[Scheme Report]
[Glimmer Scheme Reference]
[CSC151.01 (Gum)]
[CSC151 2003S]
[CSC151 2002F]
[SamR]
Disclaimer:
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 http://www.cs.grinnell.edu/~rebelsky/Courses/CS151/2003F/Outlines/outline.33.html
.
You may wish to validate this document's HTML ; ; Check with Bobby
Samuel A. Rebelsky, rebelsky@grinnell.edu