I suggest to check for symbol instead of "#+" feature testing.

This will allow FFI-free pure-lisp build.

To quote the FriCAS development goals:

    "make it easier for external programs to interface with FriCAS"

I think that FFI-free pure-lisp build is one step toward this goal.

fricas0 is one example that utilizes pure-lisp build.

In Sagemath, there's a pexpect (IO) based interface for FriCAS and
Maxima, but there's an additional ECL based interface for Maxima.
So using FriCAS as a pure-lisp library can have its advantages.

- Qian


diff --git a/src/interp/nlib.lisp b/src/interp/nlib.lisp
index 8c844fa7..ffdacae6 100644
--- a/src/interp/nlib.lisp
+++ b/src/interp/nlib.lisp
@@ -304,10 +304,10 @@
 ;; ($ERASE filearg) -> 0 if succeeds else 1
 (defun |erase_lib|(filearg)
   (if (|fricas_probe_file| filearg)
-      #+:fricas_has_remove_directory
-          (|remove_directory| filearg)
-      #-:fricas_has_remove_directory
-          (delete-directory filearg)
+      (let ((sym (find-symbol "remove_directory" "FRICAS-LISP")))
+        (if sym
+            (funcall sym filearg)
+            (delete-directory filearg)))
       1))

 (defun |erase_lib0|(fn ft) (|erase_lib| (|make_filename0| fn ft)))

--
You received this message because you are subscribed to the Google Groups "FriCAS - 
computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/262c6015-b7e1-47d4-897c-ba28a8453450%40gmail.com.

Reply via email to