Recommended structure for small-ish Coalton project? #364
-
I'm new to Common Lisp and Coalton, so this may be a silly question. Is there an idiomatic way to setup a small-ish Coalton project (let's say it's called "numbers") with ASDF and Common Lisp packages? In the project directory root I would have a file
Then I'd have a
And the
This is all assuming I've manually installed Coalton somewhere that Quicklisp can find it. If I didn't want the common Any advice much appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I recommend actually making two packages, one for CL code and one for Coalton code: (cl:in-package #:cl-user)
(defpackage #:numbers.cl
(:use #:cl)
(export ...))
(defpackage #:numbers
(:use #:coalton #:coalton-library)
(:export ...)) That way, you can easily write Lisp functions as needed and use them within Coalton, without having to prefix a lot of stuff. Your typical Coalton file would look like (cl:in-package #:numbers.cl)
;; lisp code
(cl:in-package #:numbers)
;; coalton code If you wanted one package per file (a style I've never really appreciated), you'd do the same, just put package definitions at the top of the file. Directory structure would be however you want; Coalton wouldn't require anything. |
Beta Was this translation helpful? Give feedback.
I recommend actually making two packages, one for CL code and one for Coalton code:
That way, you can easily write Lisp functions as needed and use them within Coalton, without having to prefix a lot of stuff. Your typical Coalton file would look like
If you wanted one package per file (a style I've never really appreciated), you'd do the same, just put package definitions at the top of the file. Directory structure would be however you want; Coa…