this post was submitted on 19 Oct 2023
1 points (100.0% liked)

Lisp

53 readers
3 users here now

founded 1 year ago
MODERATORS
 

The following is a kawa scheme program consisting of 3 files

Mytest.scm


(module-name MyTest)
(module-compile-options main: #t)
(define (printc)
    (display "c"))
(require 'srfi-1) ;;  List Library
(define (main)
    (import MyTestA)
    (printa)
    (MyTestB:printb)
    (printc))
(main)

MyTestA.scm


(module-name MyTestA)
(module-export printa)
(define (printa)
    (display "A"))

MyTestB.scm


(module-name MyTestB)
(module-export printb)
(define (printb)
    (display "B"))

To compile & run,

rm -vf ./*.class
kawa -Dkawa.import.path="." -C ./MyTestA.scm
kawa -Dkawa.import.path="." -C ./MyTestB.scm
kawa -Dkawa.import.path="." --main -C ./MyTest.scm
kawa MyTest

How do i do the same thing in abcl lisp ?

top 4 comments
sorted by: hot top controversial new old
[–] KaranasToll@alien.top 1 points 1 year ago (1 children)

It seems you are asking about kawa scheme not abcl common lisp.

[–] Ok_Specific_7749@alien.top 1 points 1 year ago

No it works with kawa scheme like i specified.

[–] anticrisisg@alien.top 1 points 1 year ago

If you're asking how to make a package consisting of multiple files in Common Lisp, try this for a start: https://lispcookbook.github.io/cl-cookbook/systems.html

[–] Ok_Specific_7749@alien.top 1 points 1 year ago

I found an interesting abcl function:

(add-to-classpath "some.jar")