1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-21 03:00:19 +02:00

remove unnecessary elisp macros

* module/language/elisp/runtime/macros.scm (when, unless, dotimes)
  (dolist, pop, push): Remove. (They are not special forms in Emacs.)

* module/language/elisp/runtime/function-slot.scm: Update import and
  export lists.

* test-suite/tests/elisp-compiler.test ("Conditionals")["failing when"]
  ["succeeding when", "failing unless", "succeeding unless"]: Remove.
  ("Iteration")["dotimes", "dolist"]: Remove.
  ("List Built-Ins")["pop", "push"]: Remove.
This commit is contained in:
BT Templeton 2011-06-17 02:10:55 -04:00
parent 59e46065ce
commit a338fa3d87
3 changed files with 3 additions and 120 deletions

View file

@ -77,18 +77,6 @@
3)
(equal (if nil 1) nil)))
(pass-if-equal "failing when" nil-value
(when nil 1 2 3))
(pass-if-equal "succeeding when" 42
(progn (setq a 0)
(when t (setq a 42) a)))
(pass-if-equal "failing unless" nil-value
(unless t 1 2 3))
(pass-if-equal "succeeding unless" 42
(progn (setq a 0)
(unless nil (setq a 42) a)))
(pass-if-equal "empty cond" nil-value
(cond))
(pass-if-equal "all failing cond" nil-value
@ -127,27 +115,7 @@
(while (<= i 5)
(setq prod (* i prod))
(setq i (1+ i)))
prod))
(pass-if "dotimes"
(progn (setq a 0)
(setq count 100)
(setq b (dotimes (i count)
(setq j (1+ i))
(setq a (+ a j))))
(setq c (dotimes (i 10 42) nil))
(and (= a 5050) (equal b nil) (= c 42))))
(pass-if "dolist"
(let ((mylist '(7 2 5)))
(setq sum 0)
(setq a (dolist (i mylist)
(setq sum (+ sum i))))
(setq b (dolist (i mylist 5) 0))
(and (= sum (+ 7 2 5))
(equal a nil)
(equal mylist '(7 2 5))
(equal b 5)))))
prod)))
(with-test-prefix/compile "Exceptions"
@ -628,15 +596,6 @@
(and (equal (car-safe '(1 2)) 1) (equal (cdr-safe '(1 2)) '(2))
(equal (car-safe 5) nil) (equal (cdr-safe 5) nil)))
(pass-if "pop"
(progn (setq mylist '(a b c))
(setq value (pop mylist))
(and (equal value 'a)
(equal mylist '(b c)))))
(pass-if-equal "push" '(a b c)
(progn (setq mylist '(b c))
(push 'a mylist)))
(pass-if "nth and nthcdr"
(and (equal (nth -5 '(1 2 3)) 1) (equal (nth 3 '(1 2 3)) nil)
(equal (nth 0 '(1 2 3)) 1) (equal (nth 2 '(1 2 3)) 3)