find and substitute example(incomplete)

find and substitute example(incomplete) - (define...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
;; The first three lines of this file were inserted by DrScheme. They record metadata ;; about the language level of this file in a form that our tools can easily process. #reader(lib "" "lang")((modname |find and substitute example(incomplete)|) (read-case-sensitive #t) (teachpacks ()) (htdp- settings #(#t constructor repeating-decimal #f #t none #f ())))
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: (define find (lambda (x y) (cond ((null? y) '()) ((cons? y ) (or (find x (car y)) (find x (cdr y)))) (else (eq? x (car y)))))) (define substitute (lambda (x y z) (cond ((null? y) y) ((cons? y) (let ((res1 (substitute x (car y) z)) (res2 (substitute x (cdr y) z)) (cons res1 res2))...
View Full Document

This note was uploaded on 10/13/2009 for the course CS 3773 taught by Professor Staff during the Spring '08 term at The University of Texas at San Antonio- San Antonio.

Ask a homework question - tutors are online