Thunks and Streams Assignment

From CSE425S Wiki
Revision as of 07:08, 2 July 2019 by Dennis.cosgrove (talk | contribs) (Created page with "=Thunk Utilities= define a function <code>thunk?</code> which returns #t if the specified parameter is a thunk, #f otherwise. define a macro <code>thunk</code> which creates...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Thunk Utilities

define a function thunk? which returns #t if the specified parameter is a thunk, #f otherwise.

define a macro thunk which creates thunk

define a function dethunk which takes a thunk parameter th and returns the result of invoking th.

Stream Utilities

define a function stream? which returns #t if the specified parameter is a stream, #f otherwise.

define a function next-value-from-stream which takes a stream parameter and returns the next value of that stream.

define a function stream-cons which takes two parameters value and stream-prime. if the specified stream-prime parameter is not a stream then an error should be raised:

(raise (error "not a stream" stream-prime))

Stream App

define a flip-flop-stream which produces #t #f #t #f #t #f #t #f...