lokke-org / lokke

Lokke: Clojure for Guile
Other
199 stars 11 forks source link

lokke on top of Guix (System) API #12

Open jgarte opened 3 years ago

jgarte commented 3 years ago

Hi, has anyone tested using lokke with Guix (System) APIs?

rlbdv commented 3 years ago

I don't know offhand. I suspect lokke might build fine there (if not, we can try to fix it), and access to guile modules is fairly straightforward:

lokke@lokke.user> (guile.srfi.srfi-1/iota 3)
$1 = (0 1 2)
jgarte commented 3 years ago

@rlbdv It would be nice to be able to do

lokke@lokke.user> gnu.packages.suckless/dwm
$1 = #<package dwm@6.2 gnu/packages/suckless.scm:215 7f2963565420>
rlbdv commented 3 years ago

Assuming (gnu packages suckless) is already a guile module and is in the load path, then currently, the reference would be guile.gnu.packages.suckless/dwm, i.e. the entire guile module tree should be available under guile..

rlbdv commented 2 years ago

@jgarte Now that I look back at this, I wonder if I might have misinterpreted your question. i.e. your example should already work with the guile. prefix, but perhaps you were hoping to avoid the prefix?

jgarte commented 2 years ago

@rlbdv Hi, yes I'd like to avoid the prefix. What do you suggest for that? defining aliases?

jgarte commented 2 years ago

I can just import qualify the guix stuff like here? https://github.com/lokke-org/lokke/blob/main/test/clojure-concurrency#L11

rlbdv commented 1 year ago

Definitely, :refer is the conventional way to handle that. For what it's worth, I think I often tend to follow https://stuartsierra.com/2016/clojure-how-to-ns.html and https://github.com/bbatsov/clojure-style-guide

You can also use a shorter prefix if you prefer (as compared to a longer :refer list) via :as something.