Skip to content

Commit

Permalink
Simplified example to not need FSET
Browse files Browse the repository at this point in the history
  • Loading branch information
easye committed Jul 16, 2023
1 parent 8df47c0 commit f346bce
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
19 changes: 14 additions & 5 deletions t/compiler-inline.lisp
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
;;;; <https://github.com/armedbear/abcl/issues/591>
(unless (ignore-errors (asdf:load-system :fset))
(ql:quickload :fset))
;;;; <https://github.com/armedbear/abcl/issues/591>


(in-package :cl-user)
(declaim (inline tail))
(defun tail (x)
(cdr x))

(defpackage :cl-user-2
(:use :cl)
(:import-from :cl-user :tail))

(in-package :cl-user-2)
(load
(compile-file
(asdf:system-relative-pathname :abcl "t/eg/inline-labels.lisp")))

(prove:plan 1)
(prove:is
(fset-user::foo '(a &rest b))
'(a fset-user::local-tail b))
(cl-user-2::foo '(a b))
'((a b) . LOCAL-TAIL))
(prove:finalize)

10 changes: 5 additions & 5 deletions t/eg/inline-labels.lisp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
(in-package :fset-user)
(in-package :cl-user-2)
(defun foo (x)
(labels ((bar (x)
(cond ((null x) nil)
((eq (car x) '&rest) (tail (cadr x)))
(t (cons (car x) (bar (cdr x))))))
(tail x))
(tail (x)
(list 'local-tail x)))
(cons x 'local-tail)))
(bar x)))


0 comments on commit f346bce

Please sign in to comment.