unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Edouard Klein <edou@rdklein.fr>
To: jgart <jgart@dismail.de>
Cc: help-guix@gnu.org
Subject: Re: Loading Common Lisp Libraries with GNU/Guix in a REPL
Date: Fri, 10 Dec 2021 16:03:12 +0100	[thread overview]
Message-ID: <87bl1oa44k.fsf@rdklein.fr> (raw)
In-Reply-To: <20211210055454.GB6841@gac.attlocal.net>

Hi !

I don't know the "correct" way to do it, but the way I do things is:

Create a manifest.scm or guix.scm file in the directory. Here is an
example manifest.scm file:

#+begin_src scheme
(define-module (osef)
  #:use-module (guix packages)
  #:use-module (gnu packages)
  #:use-module (guix profiles)
  #:use-module (gnu packages lisp)
  #:use-module (gnu packages lisp-xyz)
  #:use-module (gnu packages readline)
  )


(packages->manifest
 (list sbcl sbcl-numcl rlwrap))
#+end_src

Then I run guix shell, which will automatically load this manifest.scm
file.

Then, same as you, I run rlwrap sbcl.

Finally I invoke the following in sbcl:

#+begin_src lisp
    (load "~/.emacs.d/elpa/27.2/develop/slime-20211021.507/swank-loader.lisp")  ;; Found using find .emacs.d/ -iname '*swank*'
    (swank-loader:init)
    (swank:create-server)
#+end_src

This allows my emacs instance, which lives outside the guix shell, to
communicate with the sbcl instance which lives inside. I don't want to
pollute each project with my emacs config, which is done once and for
all for all projects.

To connect: M-x slime-connet, enter, enter.

Then I just (require :numcl) (for example). I did not need to use asdf,
although this may be package-specific. I remember being unable to load a
package once, but I don't rememder which or why (sorry).

So basically, the same as you already do.

If there is a more canonical way, I'd be happy to know :)


Cheers,

Edouard.



jgart <jgart@dismail.de> writes:

> On Fri, 10 Dec 2021 05:44:58 -0500 jgart <jgart@dismail.de> wrote:
>
> Alternatively, I was able to also load code this way also after running
> the following:
>
> ```
> $ guix shell sbcl sbcl-cl-str rlwrap
>
> CL-USER(2):
> jgart@gac ~ [env] λ rlwrap sbcl
> This is SBCL 2.1.9, an implementation of ANSI Common Lisp.
> More information about SBCL is available at <http://www.sbcl.org/>.
>
> SBCL is free software, provided as is, with absolutely no warranty.
> It is mostly in the public domain; some portions are provided under
> BSD-style licenses.  See the CREDITS and COPYING files in the
> distribution for more information.
> CL-USER(1): (asdf:make "str") 
> WARNING: System definition file
> #P"/gnu/store/aljfy13phr526w0iqmqz0cf2cnxkjxlb-sbcl-cl-ppcre-unicode-2.1.1/share/common-lisp/sbcl/cl-ppcre-unicode/cl-ppcre-unicode.asd"
> contains definition for system "cl-ppcre-unicode-test". Please only
> define "cl-ppcre-unicode" and secondary systems with a name starting with
> "cl-ppcre-unicode/" (e.g. "cl-ppcre-unicode/test") in that file.
>
> ;;; Computing Hangul syllable names
> T
> CL-USER(2): (in-package :str)
>
> #<PACKAGE "STR">
> STR(3): (trim "  rst  ")
>
> "rst"
> STR(4): (join " " '("foo" "bar" "baz"))
>
> "foo bar baz"
> STR(5): (concat "f" "o" "o")
>
> "foo"
> STR(6): (split "+" "foo++bar")
>
> ("foo" "" "bar")
> ```



  reply	other threads:[~2021-12-10 15:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-10 10:44 Loading Common Lisp Libraries with GNU/Guix in a REPL jgart
2021-12-10 10:54 ` jgart
2021-12-10 15:03   ` Edouard Klein [this message]
2021-12-12 17:01     ` Katherine Cox-Buday
2021-12-12 19:27       ` raingloom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bl1oa44k.fsf@rdklein.fr \
    --to=edou@rdklein.fr \
    --cc=help-guix@gnu.org \
    --cc=jgart@dismail.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).