0

The comment by sds at Saving CLOS objects provides a reference to a Common Lisp Open Code Collection (CLOCC) file (closio.lisp) for printably reading & writing CLOS objects. Instructions for installing the software are at Installation of CLOCC. However, not having previously used CLOCC, I would like some additional guidance in setting things up for reading/writing CLOS objects. Here are the additions to my init file (.clinit) so far:

(in-package :cl-user)
(setq *clocc-root* "D:\\clocc\\")
(load "D:\\clocc.fasl")
(load 
  (compile-file ;warns about |make|::COMPILED-FILE-P being undefined
    (translate-logical-pathname 
      "clocc:src;defsystem;defsystem")))
(dolist (s '("clocc:src;cllib;base" "clocc:src;port;sys"))
  (mk:add-registry-location (translate-logical-pathname s)))

Instructions for what to add next appreciated.

Community
  • 1
  • 1
davypough
  • 1,847
  • 11
  • 21
  • did you follow the instructions in the `INSTALL` file you link to step by step? you need to compile file using `mk:oos` and then load whatever files you need and you are good to go. – sds Feb 21 '17 at 01:16
  • The next two statements I've tried are `(mk:oos "cllib" :compile)` and `(mk:oos "port" :compile)` but they produce an error--e.g., Can't find system named "cllib". Also, tried `(mk:oos "src\\cllib")` where the directories are located, but same error. – davypough Feb 21 '17 at 04:39

1 Answers1

1

The instructions were obsolete. Sorry.

The installation instructions now say (I removed the systems you don't need):

(compile-file "c:/gnu/clocc/clocc") ; or whatever ...
(load *)
;; * load the defsystem facility
;; most lisps come with "asdf"; if this fails, get it yourself from
;; https://common-lisp.net/project/asdf/
(require "asdf")

;; * compile some systems
(asdf:compile-system "port")
(asdf:compile-system "cllib")
...

You will need to follow the asdf instructions:

$ mkdir -p ~/.config/common-lisp/source-registry.conf.d/
$ echo '(:tree "c:/gnu/clocc/")' > asdf.conf
sds
  • 58,617
  • 29
  • 161
  • 278
  • Doh, on to 2nd base (using Allegro CL). When compiling mop.lisp (in port), `slot-definition-initargs` is undefined function, with option to call `mop:slot-definition-initargs` instead. Doing so moves on to same error for `class-direct-slots`. – davypough Feb 21 '17 at 18:46
  • Looks like `port:mop` needs to be updated for the latest Allegro. We will need some back and forth on this. Please replace `:clos` with `:mop` on line 19 in `port:mop.lisp`. Does it work now? – sds Feb 21 '17 at 20:22
  • Changing `:clos` to `:mop` on line 19 (for allegro) still produces same error for `slot-definition-initargs`. Continuing with `mop:slot-definition-initargs` instead, and after that with `mop:class-direct-slots`, then get Error: No methods applicable for generic function # with args (#) of classes (EXCL::STRUCTURE-DIRECT-SLOT-DEFINITION) [condition type: PROGRAM-ERROR]. – davypough Feb 21 '17 at 21:30
  • This is weird. Please remove all compiled files and start from scratch. Thanks. – sds Feb 21 '17 at 21:44
  • I went back and downloaded the clocc files again from https://sourceforge.net/p/clocc/hg/ci/default/tree/ (snapshot); extracted them to a new directory; ran thru each of the "Installation of CLOCC" steps again with no problems (except the MAKE::COMPILED-FILE-P undefined function warning); changed :clos to :mop in mop.lisp (line 19 only); but the exact same errors repeat when doing `(mk:oos "port" :compile)`. (ps: I'm using the "express" free version of Allegro CL, which has limited heap, but receive no message about over-running.) – davypough Feb 21 '17 at 22:51
  • I am sorry, please follow the new `asdf`-based instructions. They worked for me with Allegro and SBCL. – sds Feb 21 '17 at 23:48
  • OK, bear with me please. I have `asdf` working with quicklisp libraries. For a clocc library, do I need to also install "ASDF-INSTALL" at https://common-lisp.net/project/asdf-install/tutorial/index-save.html ? (ps: on Windows 10) – davypough Feb 22 '17 at 16:41
  • No, just plain `asdf`, not `asdf-install`. – sds Feb 22 '17 at 16:50
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/136386/discussion-between-davypough-and-sds). – davypough Feb 22 '17 at 18:42