coalton-lang / coalton

Coalton is an efficient, statically typed functional programming language that supercharges Common Lisp.
https://coalton-lang.github.io/
MIT License
1.16k stars 71 forks source link

Update Coalton-Lisp Interoperation #629

Open stylewarning opened 2 years ago

stylewarning commented 2 years ago

There are some new native CL types, repr lisp <type> not fully documented, etc.

Jason94 commented 2 years ago

It would also be helpful to document how to reference Lisp variables within a coalton clause. AFAIK it isn't documented anywhere that this doesn't work:

(in-package :cl-user)
(let ((x 1))
  (coalton (+ x 9))

And that you need to do this:

(in-package :cl-user)
(let ((x 1))
  (coalton (+ (lisp Integer () x) 9))

This is probably beyond the scope of this documentation issue, but FWIW, it would be convenient to have some syntax like this to mirror the syntax going from Lisp into Coalton:

(in-package :cl-user)
(let ((x 1)
      (lst (list 1 2 3)))
  (coalton ((x Integer)
            (lst (List Integer)))
    (+ x 1)
    (fold + 0 lst)))