Run an ABCL code that uses cl-cppre

301 views Asked by At

With reference to my previous question, Executing a lisp function from Java I was able to call lisp code from Java using ABCL. But the problem is, the already existing lisp code uses CL-PPCRE package. I can not compile the code as it says 'CL-PPCRE not found'. I have tried different approaches to add that package, including 1) how does one compile a clisp program which uses cl-ppcre? 2)https://groups.google.com/forum/#!topic/cl-ppcre/juSfOhEDa1k

Doesnot work! Other thing is, that executing (compile-file aima.asd) works perfectly fine although it does also require cl-pprce

(defpackage #:aima-asd
(:use :cl :asdf))

(in-package :aima-asd)

(defsystem aima
  :name "aima"
  :version "0.1"
  :components ((:file "defpackage")
           (:file "main" :depends-on ("defpackage")))
   :depends-on (:cl-ppcre))

The final java code is

interpreter.eval("(load \"aima/asdf.lisp\")");
interpreter.eval("(compile-file \"aima/aima.asd\")");
interpreter.eval("(compile-file \"aima/defpackage.lisp\")");
interpreter.eval("(in-package :aima)");
interpreter.eval("(load \"aima/aima.lisp\")");
interpreter.eval("(aima-load 'all)");

The error message is

Error loading C:/Users/Administrator.NUIG-1Z7HN12/workspace/aima/probability/domains/edit-nets.lisp at line 376 (offset 16389)
#<THREAD "main" {3A188AF2}>: Debugger invoked on condition of type READER-ERROR
  The package "CL-PPCRE" can't be found.
[1] AIMA(1): 

Can anyone help me?

2

There are 2 answers

1
Hamda Binte Ajmal On BEST ANSWER

I used QuickLisp to add cl-ppcre (because nothing else worked for me). Here is what I did

(load \"~/QuickLisp.lisp\")")
(quicklisp-quickstart:install) 
(load "~/quicklisp/setup.lisp")
(ql:quickload :cl-ppcre)

First 2 lines are only a one time things. Once quickLisp is installed you can start from line 3.

2
Svante On

You need to load cl-ppcre before you can use it. You can do that by using (asdf:load-system :aima), provided that you put both aima and cl-ppcre into locations that your ASDF searches.