Home Up Feedback Contents Search

Paradigms                                              
       A Heavenly Help to CS Students

 

[Under Construction]

Home
Up

 

 

 Hit Counter

Various Data Abstraction techniques are used in to build computer languages. Scheme, LISPS next generation permits us to build our on abstractions and languages. 

MIT Scheme:

bulletDownload the Software for windows   And  Implementation Documentation
bullet Download Dr Scheme, a more advance editor for Win9X kernel
bulletOnline Reference and Books :

Example:

(define the-empty-stream '())

(define (stream-enumerate-interval low high)

(if (> low high)

the-empty-stream

(cons-stream low

(stream-enumerate-interval (+ low 1) high))))

 

(define (stream-filter pred stream)

(cond ((stream-null? stream) the-empty-stream)

((pred (stream-car stream))

(cons-stream (stream-car stream)

(stream-filter pred (stream-cdr stream))))

(else (stream-filter pred (stream-cdr stream)))))

 

 

 

(define (stream-map proc s)

(if (stream-null? s)

the-empty-stream

(cons-stream (proc (stream-car s))

(stream-map proc (stream-cdr s)))))

 

(define (stream-accumulate op initial stream)

(if (stream-null? stream)

initial

(op (stream-car stream)

(stream-accumulate op initial (stream-cdr stream)))))

 

(define (doeven low high)

(define (even? number)

(if (= (modulo number 2) 0)

#t

#f) )

 

(define (positive? number)

(if (>= number 0)

#t

#f))

(define (even-and-positive? number)

(if (and (even? number)

(positive? number))

#t

#f))

(stream-accumulate cons

'()

(stream-filter even-and-positive?

(stream-enumerate-interval low high))))

 

 

 

 

 

Send mail to [email protected] with questions or comments about this web site.
Copyright © 2001 SIK YUEN .DOTCOM
Last modified: January 09, 2002