jscl-project / jscl

A Lisp-to-JavaScript compiler bootstrapped from Common Lisp
https://jscl-project.github.io
GNU General Public License v3.0
874 stars 108 forks source link

nested feature testing: ERROR: ECASE expression failed for the object `NIL'. #475

Open VitoVan opened 1 year ago

VitoVan commented 1 year ago
CL-USER> #-jscl 
... (defun hello () 
...   #+types (format t "Has types~%") 
...   #-types (format t "No types~%"))
ERROR: ECASE expression failed for the object `NIL'.
CL-USER> 

Am I doing something wrong?

on SBCL nothing will happen:

This is SBCL 2.3.3, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses.  See the CREDITS and COPYING files in the
distribution for more information.
* #-sbcl
(defun hello ()
  #+types (format t "Has types~%")
  #-types (format t "No types~%"))

This makes me not able to test features happily.

VitoVan commented 1 year ago

Found a workaround, don't nest, use uiop:featurep or just check *features* manually.

(uiop:featurep :darwin)