Last active
September 27, 2017 14:56
-
-
Save MarkShulhin/d2d92f164a2c0239a74b7110ea197c21 to your computer and use it in GitHub Desktop.
Scheme lab 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang scheme | |
(define (reverse1 l) | |
(if (null? l) | |
null | |
(append (reverse1 (cdr l)) (list (car l))))) | |
(define (DFM atom list rezlist) | |
(cond ((or (equal? atom '())(equal? list '())) '(wrong input!)) | |
((equal? atom (car list)) (reverse1 (cons (cdr list) rezlist))) | |
(#t (DFM atom (cdr list) (cons (car list) rezlist))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment