Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 58 lines (37 sloc) 1.241 kb
a984b02 BUGGY, UNFINISHED, FUNNY file, do not use in bot!, security risk.
deego authored
1 ;; 2004-08-20 T14:53:35-0400 (Friday) D. Goel
2 ;; This file is work in progress. INCOMLPETE AND BUGGY. DO NOT REQUIRE
3 ;; THIS FILE IN A BOT.
4
5
6 (defvar backquote-symbols (list (intern (string 96)) 'backquote))
7
8
9 (defmacro backquote-parse (sexp)
10 "Will parse a sexp and return an equivalent sexp with no backquotes
11 in it. Any backquotes in the sexp are converted them to a
12 nonbackquoted form. "
13 (cond
14 ((atom sexp) sexp)
15 (t (cons 'quote (backquote-parse-unread sexp)))))
16
17
18
19 (defun backquote-parse-unread (sexp)
20 (cond
21 ;;;((vectorp sexp)
22 ;;;(error "this backquote parse does not deal with vectors. "))
23 ((null sexp)
24 nil)
25 ((atom sexp)
26 sexp)
27 ((equal (car sexp) 'quote)
28 (message "Answer is %s" sexp)
29 sexp)
30 ((member (car sexp) backquote-symbols)
31 (backquote-inside-parse (cadr sexp)))
32 ;; None of them:
33 (t (cons (backquote-parse-unread (car sexp))
34 (backquote-parse-unread (cdr sexp))))))
35
36
37
38
39
40
41 (defun backquote-inside-parse (sexp)
42 (cond
43 ((null sexp)
44 nil)
45 ((atom sexp)
46 (list 'quote sexp))
47 ((equal (car sexp) ',)
48 `(eval ,(backquote-parse-unread (cadr sexp))))
49 (t (cons (backquote-inside-parse (car sexp))
50 (backquote-inside-parse (cdr sexp))))))
51
52
53
54
55
56
57
Something went wrong with that request. Please try again.