Created
November 16, 2015 00:41
-
-
Save kimitoboku/738b8f62479b71ab6ac8 to your computer and use it in GitHub Desktop.
program-language-no6
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
(defun my-match (pattern data) | |
(cond ((and (consp pattern) (eq '* (car pattern))) | |
(or (my-match (cdr pattern) data) | |
(and (consp data)(my-match pattern (cdr data))))) | |
((and (consp pattern) (consp data) (eq (car pattern) (car data))) | |
(my-match (cdr pattern) (cdr data))) | |
((eq pattern data) 't) | |
('t nil))) | |
(defun sample2 (pattern data) | |
(cond ((and (consp pattern) (consp data) | |
(or (eq '* (car pattern)) | |
(eq (car pattern) (car data)))) | |
(sample2 (cdr pattern) (cdr data))) | |
((eq pattern data) 't) | |
('t nil))) | |
(defun sample1(pattern data) | |
(cond ((and (consp pattern) (consp data) (eq (car pattern) (car data))) | |
(sample1 (cdr pattern) (cdr data))) | |
((eq pattern data) 't) | |
('t nil))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment