Skip to content

Recommended structure for small-ish Coalton project? #364

Answered by stylewarning
ornamentist asked this question in Help!
Discussion options

You must be logged in to vote

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; Coa…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ornamentist
Comment options

Answer selected by ornamentist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help!
Labels
None yet
2 participants