Lisp-Stat / lisp-stat

Lisp-Stat main system
https://lisp-stat.github.io/lisp-stat
Microsoft Public License
145 stars 11 forks source link

"Getting Started" errors #13

Closed HM0880 closed 1 year ago

HM0880 commented 2 years ago

I am following the "Getting Started" tutorial [1]. Using SBCL version 2.2.6, the (ql:quickload :lisp-stat) and (in-package :ls-user) behave as expected. [Comment: SBCL version 2.1.9 and lower gave the error System "lisp-stat" not found.]

However, LS-USER> (ql:quickload :plot/vega) gives the error System "plot/vega" not found. I tried LS-USER> (ql:quickload :plot), which did load.

Then, (data :vgcars) gives the error The function LS-USER::DATA is undefined. Can someone help me get Lisp Stat working (since I would really like to use it)? Thanks!

[1] https://lisp-stat.dev/docs/getting-started/

Symbolics commented 2 years ago

The problem is that Quicklisp, the common lisp version of a package manager, hasn't been updated yet. It's usually done monthly.

Until Quicklisp is updated, you can do a manual install by doing a git clone into your ~/common-lisp directory of the following systems:

After than ql:quickload :lisp-stat should work.

HM0880 commented 2 years ago

Thanks for the fast response.

I cloned the following directories into ~/common-lisp/

git clone https://github.com/Lisp-Stat/data-frame.git &&
git clone https://github.com/Lisp-Stat/dfio.git &&
git clone https://github.com/Lisp-Stat/special-functions.git &&
git clone https://github.com/Lisp-Stat/numerical-utilities.git &&
git clone https://github.com/Lisp-Stat/documentation.git &&
git clone https://github.com/Lisp-Stat/plot.git &&
git clone https://github.com/Lisp-Stat/select.git &&
git clone https://github.com/Symbolics/alexandria-plus &&
git clone https://github.com/Lisp-Stat/lisp-stat.git

I ran sbcl to open the SBCL REPL, and then I ran (ql:quickload :lisp-stat). I got the following error (line-wrapped for readability):

* (ql:quickload :lisp-stat)

debugger invoked on a LOAD-SYSTEM-DEFINITION-ERROR in thread 
#<THREAD "main thread" RUNNING {1004C10113}>: Error while trying to load definition for system lisp-stat from 
pathname /home/hm/common-lisp/lisp-stat/lisp-stat.asd: 
READ error during LOAD: The file #P"/home/hm/common-lisp/lisp-stat/description.text" does not exist: 
No such file or directory(in form starting at line: 4, column: 0, position: 147)
Symbolics commented 2 years ago

Apologies for that. I've just checked in the description file.

HM0880 commented 2 years ago

Thanks! ~/common-lisp/select/ was also missing a description.text file, so I added a dummy description.text on my machine.

Now LS-USER> (ql:quickload :plot/vega) fails with the error:

compiling #<CL-SOURCE-FILE "plot/vega" "pkgdcl">
   [Condition of type UIOP/LISP-BUILD:COMPILE-FILE-ERROR]

Restarts:
 0: [RETRY] Retry compiling #<CL-SOURCE-FILE "plot/vega" "pkgdcl">.
 1: [ACCEPT] Continue, treating compiling #<CL-SOURCE-FILE "plot/vega" "pkgdcl"> as having been successful.
 2: [RETRY] Retry ASDF operation.
 3: [CLEAR-CONFIGURATION-AND-RETRY] Retry ASDF operation after resetting the configuration.
 4: [RETRY] Retry ASDF operation.
 5: [CLEAR-CONFIGURATION-AND-RETRY] Retry ASDF operation after resetting the configuration.
 --more--

Backtrace:
  0: (UIOP/LISP-BUILD:CHECK-LISP-COMPILE-RESULTS NIL T T "~/asdf-action::format-action/" ((#<ASDF/LISP-ACTION:COMPILE-OP > . #<ASDF/LISP-ACTION:CL-SOURCE-FILE "plot/vega" "pkgdcl">)))
  1: ((SB-PCL::EMF ASDF/ACTION:PERFORM) #<unused argument> #<unused argument> #<ASDF/LISP-ACTION:COMPILE-OP > #<ASDF/LISP-ACTION:CL-SOURCE-FILE "plot/vega" "pkgdcl">)
  2: ((LAMBDA NIL :IN ASDF/ACTION:CALL-WHILE-VISITING-ACTION))
  3: ((:METHOD ASDF/ACTION:PERFORM-WITH-RESTARTS :AROUND (T T)) #<ASDF/LISP-ACTION:COMPILE-OP > #<ASDF/LISP-ACTION:CL-SOURCE-FILE "plot/vega" "pkgdcl">) [fast-method]
  4: ((:METHOD ASDF/PLAN:PERFORM-PLAN (T)) #<ASDF/PLAN:SEQUENTIAL-PLAN {10065ABDB3}>) [fast-method]
  5: ((FLET SB-C::WITH-IT :IN SB-C::%WITH-COMPILATION-UNIT))
  6: ((:METHOD ASDF/PLAN:PERFORM-PLAN :AROUND (T)) #<ASDF/PLAN:SEQUENTIAL-PLAN {10065ABDB3}>) [fast-method]
  7: ((:METHOD ASDF/OPERATE:OPERATE (ASDF/OPERATION:OPERATION ASDF/COMPONENT:COMPONENT)) #<ASDF/LISP-ACTION:LOAD-OP > #<ASDF/SYSTEM:SYSTEM "plot/vega"> :PLAN-CLASS NIL :PLAN-OPTIONS NIL) [fast-method]
  8: ((SB-PCL::EMF ASDF/OPERATE:OPERATE) #<unused argument> #<unused argument> #<ASDF/LISP-ACTION:LOAD-OP > #<ASDF/SYSTEM:SYSTEM "plot/vega"> :VERBOSE NIL)
  9: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
 10: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) #<ASDF/LISP-ACTION:LOAD-OP > #<ASDF/SYSTEM:SYSTEM "plot/vega"> :VERBOSE NIL) [fast-method]
 11: ((SB-PCL::EMF ASDF/OPERATE:OPERATE) #<unused argument> #<unused argument> ASDF/LISP-ACTION:LOAD-OP "plot/vega" :VERBOSE NIL)
 12: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
 13: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) ASDF/LISP-ACTION:LOAD-OP "plot/vega" :VERBOSE NIL) [fast-method]
 14: (ASDF/SESSION:CALL-WITH-ASDF-SESSION #<FUNCTION (LAMBDA NIL :IN ASDF/OPERATE:OPERATE) {10065A991B}> :OVERRIDE T :KEY NIL :OVERRIDE-CACHE T :OVERRIDE-FORCING NIL)
 15: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
 16: (ASDF/SESSION:CALL-WITH-ASDF-SESSION #<FUNCTION (LAMBDA NIL :IN ASDF/OPERATE:OPERATE) {100652EB1B}> :OVERRIDE NIL :KEY NIL :OVERRIDE-CACHE NIL :OVERRIDE-FORCING NIL)
 17: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) ASDF/LISP-ACTION:LOAD-OP "plot/vega" :VERBOSE NIL) [fast-method]
 18: (ASDF/OPERATE:LOAD-SYSTEM "plot/vega" :VERBOSE NIL)
 19: (QUICKLISP-CLIENT::CALL-WITH-MACROEXPAND-PROGRESS #<FUNCTION (LAMBDA NIL :IN QUICKLISP-CLIENT::APPLY-LOAD-STRATEGY) {100652E8BB}>)
 --more--
Symbolics commented 2 years ago

Hmm. I'm not seeing this. Can you try to load the system with ASDF? (asdf:load-system :plot/vega) and see if we get any more helpful error messages?

HM0880 commented 2 years ago

Manual install of missing dependencies

asdf command

; SLIME 2.27
CL-USER> (asdf:load-system :plot/vega)
WARNING: System definition file #P"/home/hm/quicklisp/dists/quicklisp/software/cl-interpol-20201220-git/cl-interpol.asd" contains definition for system "cl-interpol-test". Please only define "cl-interpol" and secondary systems with a name starting with "cl-interpol/" (e.g. "cl-interpol/test") in that file.

Backtrace

Component "lass" not found, required by #<SYSTEM "plot/vega">
   [Condition of type ASDF/FIND-COMPONENT:MISSING-DEPENDENCY]

<<more text here>>

Solution

Manually install the dependencies at https://github.com/Lisp-Stat/plot/blob/master/plot.asd#L46-L55 with (ql:quickload :<dep>).

New error

asdf command

CL-USER> (asdf:load-system :plot/vega)
; compiling file "/home/hm/common-lisp/plot/src/plot/pkgdcl.lisp" (written 26 JUL 2022 09:53:56 AM):

; wrote /tmp/.cache/common-lisp/sbcl-2.2.6-linux-x64/home/hm/common-lisp/plot/src/plot/pkgdcl-tmpGUPVY9U8.fasl
; compilation finished in 0:00:00.008
; compiling file "/home/hm/common-lisp/plot/src/plot/init.lisp" (written 26 JUL 2022 09:53:56 AM):

; wrote /tmp/.cache/common-lisp/sbcl-2.2.6-linux-x64/home/hm/common-lisp/plot/src/plot/init-tmpRN3R67YS.fasl
; compilation finished in 0:00:00.004
; compiling file "/home/hm/common-lisp/plot/src/plot/browser.lisp" (written 26 JUL 2022 09:53:56 AM):

; wrote /tmp/.cache/common-lisp/sbcl-2.2.6-linux-x64/home/hm/common-lisp/plot/src/plot/browser-tmp7HHRWWH4.fasl
; compilation finished in 0:00:00.012
; compiling file "/home/hm/common-lisp/plot/src/plot/plot.lisp" (written 26 JUL 2022 09:53:56 AM):

; wrote /tmp/.cache/common-lisp/sbcl-2.2.6-linux-x64/home/hm/common-lisp/plot/src/plot/plot-tmp6U571HHA.fasl
; compilation finished in 0:00:00.012
; compiling file "/home/hm/common-lisp/plot/src/vega/pkgdcl.lisp" (written 26 JUL 2022 09:53:56 AM):

; file: /home/hm/common-lisp/plot/src/vega/pkgdcl.lisp
; in: UIOP/PACKAGE:DEFINE-PACKAGE #:VEGA
;     (UIOP/PACKAGE:DEFINE-PACKAGE #:VEGA
;                                  (:USE #:CL #:DFIO #:PLOT #:SELECT #:LET-PLUS
;                                   #:ALEXANDRIA #:ALEXANDRIA+ #:DATA-FRAME)
;                                  (:IMPORT-FROM #:SELECT #:SELECT)
;                                  (:IMPORT-FROM #:LISP-STAT #:DATA)
;                                  (:IMPORT-FROM #:DATA-FRAME #:DEFDF)
;                                  (:IMPORT-FROM #:PARENSCRIPT
;                                   #:SYMBOL-TO-JS-STRING)
;                                  (:IMPORT-FROM #:DFIO #:WITH-INPUT-STREAM
;                                   #:DATA-COLUMN #:DATA-COLUMN-ADD
;                                   #:DATA-COLUMN-VECTOR)
;                                  (:LOCAL-NICKNAMES (:LT :LOCAL-TIME))
;                                  (:DOCUMENTATION
;                                   "A plotting backend for Plot based on Vega. The specification DSL, in PLIST format, is that of Vega-Lite.  The data output representation is Vega.")
;                                  (:EXPORT #:SPEC #:ADD #:PLOT #:DEFPLOT
;                                   #:AESTHETICS #:SAVE-PLOT #:MAKE-PLOT
;                                   #:SHOW-PLOTS #:WRITE-HTML #:WRITE-SPEC
;                                   #:WRITE-VEGA-DATA ...))
; 
; caught ERROR:
;   (during macroexpansion of (UIOP/PACKAGE:DEFINE-PACKAGE #:VEGA ...))
;   unrecognized define-package keyword :LOCAL-NICKNAMES

; wrote /tmp/.cache/common-lisp/sbcl-2.2.6-linux-x64/home/hm/common-lisp/plot/src/vega/pkgdcl-tmpJGY3AJ0L.fasl
; compilation finished in 0:00:00.004

Backtrace

COMPILE-FILE-ERROR while
compiling #<CL-SOURCE-FILE "plot/vega" "pkgdcl">
   [Condition of type UIOP/LISP-BUILD:COMPILE-FILE-ERROR]

Restarts:
 0: [RETRY] Retry compiling #<CL-SOURCE-FILE "plot/vega" "pkgdcl">.
 1: [ACCEPT] Continue, treating compiling #<CL-SOURCE-FILE "plot/vega" "pkgdcl"> as having been successful.
 2: [RETRY] Retry ASDF operation.
 3: [CLEAR-CONFIGURATION-AND-RETRY] Retry ASDF operation after resetting the configuration.
 4: [RETRY] Retry ASDF operation.
 5: [CLEAR-CONFIGURATION-AND-RETRY] Retry ASDF operation after resetting the configuration.
 --more--

Backtrace:
  0: (UIOP/LISP-BUILD:CHECK-LISP-COMPILE-RESULTS NIL T T "~/asdf-action::format-action/" ((#<ASDF/LISP-ACTION:COMPILE-OP > . #<ASDF/LISP-ACTION:CL-SOURCE-FILE "plot/vega" "pkgdcl">)))
  1: ((SB-PCL::EMF ASDF/ACTION:PERFORM) #<unused argument> #<unused argument> #<ASDF/LISP-ACTION:COMPILE-OP > #<ASDF/LISP-ACTION:CL-SOURCE-FILE "plot/vega" "pkgdcl">)
  2: ((LAMBDA NIL :IN ASDF/ACTION:CALL-WHILE-VISITING-ACTION))
  3: ((:METHOD ASDF/ACTION:PERFORM-WITH-RESTARTS :AROUND (T T)) #<ASDF/LISP-ACTION:COMPILE-OP > #<ASDF/LISP-ACTION:CL-SOURCE-FILE "plot/vega" "pkgdcl">) [fast-method]
  4: ((:METHOD ASDF/PLAN:PERFORM-PLAN (T)) #<ASDF/PLAN:SEQUENTIAL-PLAN {10079C4B03}>) [fast-method]
  5: ((FLET SB-C::WITH-IT :IN SB-C::%WITH-COMPILATION-UNIT))
  6: ((:METHOD ASDF/PLAN:PERFORM-PLAN :AROUND (T)) #<ASDF/PLAN:SEQUENTIAL-PLAN {10079C4B03}>) [fast-method]
  7: ((:METHOD ASDF/OPERATE:OPERATE (ASDF/OPERATION:OPERATION ASDF/COMPONENT:COMPONENT)) #<ASDF/LISP-ACTION:LOAD-OP > #<ASDF/SYSTEM:SYSTEM "plot/vega"> :PLAN-CLASS NIL :PLAN-OPTIONS NIL) [fast-method]
  8: ((SB-PCL::EMF ASDF/OPERATE:OPERATE) #<unused argument> #<unused argument> #<ASDF/LISP-ACTION:LOAD-OP > #<ASDF/SYSTEM:SYSTEM "plot/vega">)
  9: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
 10: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) #<ASDF/LISP-ACTION:LOAD-OP > #<ASDF/SYSTEM:SYSTEM "plot/vega">) [fast-method]
 11: ((SB-PCL::EMF ASDF/OPERATE:OPERATE) #<unused argument> #<unused argument> ASDF/LISP-ACTION:LOAD-OP :PLOT/VEGA)
 12: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
 13: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) ASDF/LISP-ACTION:LOAD-OP :PLOT/VEGA) [fast-method]
 14: (ASDF/SESSION:CALL-WITH-ASDF-SESSION #<FUNCTION (LAMBDA NIL :IN ASDF/OPERATE:OPERATE) {10079C25AB}> :OVERRIDE T :KEY NIL :OVERRIDE-CACHE T :OVERRIDE-FORCING NIL)
 15: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
 16: (ASDF/SESSION:CALL-WITH-ASDF-SESSION #<FUNCTION (LAMBDA NIL :IN ASDF/OPERATE:OPERATE) {100792F69B}> :OVERRIDE NIL :KEY NIL :OVERRIDE-CACHE NIL :OVERRIDE-FORCING NIL)
 17: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) ASDF/LISP-ACTION:LOAD-OP :PLOT/VEGA) [fast-method]
 18: (ASDF/OPERATE:LOAD-SYSTEM :PLOT/VEGA)
 19: (SB-INT:SIMPLE-EVAL-IN-LEXENV (ASDF/OPERATE:LOAD-SYSTEM :PLOT/VEGA) #<NULL-LEXENV>)
 --more--

So now I am stuck on compiling #<CL-SOURCE-FILE "plot/vega" "pkgdcl">.

Symbolics commented 2 years ago

Very good report! Thanks. We can use this to identify a couple of issues:

If it's a problem with SBCL using an old version of ASDF, I may have to stop using package-local-nicknames until they catch up. That should not be too difficult, as I just started the conversion from use -> p-l-n.

Symbolics commented 2 years ago

What OS are you using?

HM0880 commented 2 years ago

You could also have used quicklisp

Good point; I used (ql:quickload :plot/vega) some time before, but I have also reinstalled Quicklisp a few times, so I wasn't sure what was and was not working when I did the manual install. :)

Once that's done once (loading via quicklisp), (asdf:load-system :vega/plot) will work.

Do you mean (asdf:load-system :plot/vega)? I will try to remember to report back on this sequence of events once the pkgdcl issues is working.

asdf version

CL-USER> asdf::*asdf-version* "3.3.2"

What OS are you using?

Per Neofetch: Debian GNU/Linux 10 (buster) x86_64

Symbolics commented 2 years ago

Well, this is strange. There's another report of this behaviour, but on Windows 11. Yet, I can't reproduce it, and there are other reports of success with the new code.

Let's try commenting out the offending line in pgkdcl -- the one with the local-nickname line. Expect errors in two other locations in encode, but that's fine, it's only two lines and easy to change if this experiment gets pkgdcl compiling. It seems a problem in uiop:define-package and package-local-nicknames, but I can't see how. Also, ensure that package-local-nicknames in in *features*.

HM0880 commented 2 years ago

Misc

I think package-locak-nicknames is available:

CL-USER> *features*
(:SWANK :QUICKLISP :ASDF3.3 :ASDF3.2 :ASDF3.1 :ASDF3 :ASDF2 :ASDF :OS-UNIX
 :NON-BASE-CHARS-EXIST-P :ASDF-UNICODE :X86-64 :GENCGC :64-BIT :ANSI-CL
 :COMMON-LISP :ELF :IEEE-FLOATING-POINT :LINUX :LITTLE-ENDIAN
 :PACKAGE-LOCAL-NICKNAMES :SB-LDB :SB-PACKAGE-LOCKS :SB-THREAD :SB-UNICODE
 :SBCL :UNIX)

Also, FYI, I am running SBCL v2.2.6.

pkgdcl attempts

Commented out line 18: https://github.com/Lisp-Stat/plot/blob/master/src/vega/pkgdcl.lisp#L18

Now CL-USER> (ql:quickload :plot/vega) gives:

The value of UIOP/PACKAGE::FROM-PACKAGE is NIL, which is not of type PACKAGE.
   [Condition of type SIMPLE-TYPE-ERROR]

Restarts:
 0: [STORE-VALUE] Supply a new value for UIOP/PACKAGE::FROM-PACKAGE.
 1: [RETRY] Retry compiling #<CL-SOURCE-FILE "plot/vega" "pkgdcl">.
 2: [ACCEPT] Continue, treating compiling #<CL-SOURCE-FILE "plot/vega" "pkgdcl"> as having been successful.
 3: [RETRY] Retry ASDF operation.
 4: [CLEAR-CONFIGURATION-AND-RETRY] Retry ASDF operation after resetting the configuration.
 5: [RETRY] Retry ASDF operation.
 --more--

Backtrace:
  0: (SB-KERNEL:CHECK-TYPE-ERROR UIOP/PACKAGE::FROM-PACKAGE NIL PACKAGE NIL)
  1: (UIOP/PACKAGE::ENSURE-IMPORT "DATA" #<PACKAGE "VEGA"> #<unavailable argument> #<HASH-TABLE :TEST EQUAL :COUNT 0 {1004A3A213}> #<HASH-TABLE :TEST EQUAL :COUNT 1 {1004A3A2B3}>)
  2: (UIOP/PACKAGE:ENSURE-PACKAGE #:VEGA :NICKNAMES NIL :DOCUMENTATION "A plotting backend for Plot based on Vega. The specification DSL, in PLIST format, is that of Vega-Lite.  The data output representat..
  3: ((LAMBDA NIL :IN "/home/hm/common-lisp/plot/src/vega/pkgdcl.lisp"))
  4: (SB-INT:SIMPLE-EVAL-IN-LEXENV (LET ((#1=#:G0 #)) (PROGN (SETF # #) #1#)) #<NULL-LEXENV>)
  5: (SB-INT:SIMPLE-EVAL-IN-LEXENV (PROGN (LET (#) (PROGN # #:G0))) #<NULL-LEXENV>)
  6: (EVAL-TLF (PROGN (LET (#) (PROGN # #:G0))) 0 #<NULL-LEXENV>)
  7: ((FLET SB-C::FROB :IN SB-C::EVAL-COMPILE-TOPLEVEL))
  8: (SB-C::EVAL-COMPILE-TOPLEVEL ((LET (#) (PROGN # #:G0))) ((LET (#) (PROGN #1=# #:G0)) #2=(PROG1 (FUNCALL # # :NICKNAMES # :DOCUMENTATION ...) #1#) #3=(EVAL-WHEN (:COMPILE-TOPLEVEL :LOAD-TOPLEVEL :EXECU..
  9: (SB-C::PROCESS-TOPLEVEL-FORM (LET ((#1=#:G0 #)) (PROGN (SETF # #) #1#)) (#1=(PROG1 (FUNCALL # # :NICKNAMES # :DOCUMENTATION ...) (SETF # #)) #2=(EVAL-WHEN (:COMPILE-TOPLEVEL :LOAD-TOPLEVEL :EXECUTE) #..
 10: (SB-C::PROCESS-TOPLEVEL-FORM (PROG1 (FUNCALL (QUOTE UIOP/PACKAGE:ENSURE-PACKAGE) (QUOTE #:VEGA) :NICKNAMES (QUOTE NIL) :DOCUMENTATION ...) (SETF (SB-IMPL::PACKAGE-SOURCE-LOCATION #) (SB-C:SOURCE-LOCAT..
 11: (SB-C::PROCESS-TOPLEVEL-PROGN ((PROG1 (FUNCALL # # :NICKNAMES # :DOCUMENTATION ...) (SETF # #))) (#1=(EVAL-WHEN (:COMPILE-TOPLEVEL :LOAD-TOPLEVEL :EXECUTE) (PROG1 # #)) (PROGN #1#) SB-C::ORIGINAL-SOUR..
 12: (SB-C::PROCESS-TOPLEVEL-FORM (EVAL-WHEN (:COMPILE-TOPLEVEL :LOAD-TOPLEVEL :EXECUTE) (PROG1 (FUNCALL # # :NICKNAMES # :DOCUMENTATION ...) (SETF # #))) ((PROGN (EVAL-WHEN # #)) SB-C::ORIGINAL-SOURCE-STA..
 13: (SB-C::PROCESS-TOPLEVEL-PROGN ((EVAL-WHEN (:COMPILE-TOPLEVEL :LOAD-TOPLEVEL :EXECUTE) (PROG1 # #))) ((PROGN (EVAL-WHEN # #)) SB-C::ORIGINAL-SOURCE-START 0 0) NIL)
 14: (SB-C::PROCESS-TOPLEVEL-FORM (PROGN (EVAL-WHEN (:COMPILE-TOPLEVEL :LOAD-TOPLEVEL :EXECUTE) (PROG1 # #))) (SB-C::ORIGINAL-SOURCE-START 0 0) NIL)
 15: (SB-C::PROCESS-TOPLEVEL-FORM (UIOP/PACKAGE:DEFINE-PACKAGE #:VEGA (:USE #:CL #:DFIO #:PLOT #:SELECT #:LET-PLUS ...) (:IMPORT-FROM #:SELECT #:SELECT) (:IMPORT-FROM #:LISP-STAT #:DATA) (:IMPORT-FROM #:DA..
 16: ((LAMBDA (SB-KERNEL:FORM &KEY :CURRENT-INDEX &ALLOW-OTHER-KEYS) :IN SB-C::SUB-COMPILE-FILE) (UIOP/PACKAGE:DEFINE-PACKAGE #:VEGA (:USE #:CL #:DFIO #:PLOT #:SELECT #:LET-PLUS ...) (:IMPORT-FROM #:SELECT..
 17: (SB-C::%DO-FORMS-FROM-INFO #<FUNCTION (LAMBDA (SB-KERNEL:FORM &KEY :CURRENT-INDEX &ALLOW-OTHER-KEYS) :IN SB-C::SUB-COMPILE-FILE) {52C2422B}> #<SB-C::SOURCE-INFO {100486AD23}> SB-C::INPUT-ERROR-IN-COMP..
 18: ((FLET "LAMBDA0" :IN "SYS:SRC;COMPILER;MAIN.LISP"))
 19: ((FLET SB-C::WITH-IT :IN SB-C::%WITH-COMPILATION-UNIT))
 --more--
Symbolics commented 2 years ago

This is looking more like a syntax/environment problem. It's now failing on the import of data from lisp-stat. Did system lisp-stat load successfully? The most recent release has data and the old one does not.

Next is to try two things:

  1. Clear out all your fasl files and rebuild everything. I just did a fresh checkout, removed all the fasl files and built and did not encounter any errors. If you've got all the dependencies already, (ql:quickload :plot/vega) should do this. You should see a lot of output as the system rebuilds everything. This can take a minute or two.
  2. If that doesn't work, bisect pkgdcl. Comment out all the forms except the package definition, i.e.:
(uiop:define-package #:vega
    (:use #:cl
      #:dfio
      #:plot
      #:select
      #:let-plus
      #:alexandria
      #:alexandria+
      #:data-frame))

This does nothing but define the package and tell it to use some other packages. Then, line by line, add the :import-from until an error occurs.

If you don't know about it, you can compile just that form (the define-package form) in emacs using C-c C-c. This makes it possible to rapidly try out these things, no need to asdf:load-system each time.

HM0880 commented 2 years ago

Background

Where are the .fasl files? I searched my quicklisp and common-lisp (and a quick web search), but I did not find a clear answer, so I am starting from the beginning.

I did these steps:

1) Deleted contents of ~/quicklisp/ and ~/common-lisp/. 2) Ran $ sbcl --load quicklisp.lisp and evaluated (quicklisp-quickstart:install). 3) Cloned the lisp-stat Git repos into ~/common-lisp/ (the repos data-frame, dfio, special-functions, numerical-utilities, documentation, plot, select, lisp-stat, and /Symbolics/alexandria-plus). 4) Opened a SLIME REPL from ~/common-lisp/ and ran (ql:quickload :lisp-stat). The command download many packages, but Lisp Stat did load correctly:

; SLIME 2.27
CL-USER> (ql:quickload :lisp-stat)
To load "lisp-stat":
  Load 1 ASDF system:
    lisp-stat
; Loading "lisp-stat"
To load "alexandria":
  Load 1 ASDF system:
    asdf
  Install 1 Quicklisp release:
    alexandria

<<lots of text removed here>>

[package num-utils.statistics]....................
[package num-utils.test-utilities]................
..................................................
............
(:LISP-STAT)
CL-USER>

5) (ql:quickload :plot/vega) fails with the error:

COMPILE-FILE-ERROR while
compiling #<CL-SOURCE-FILE "plot/vega" "pkgdcl">
   [Condition of type UIOP/LISP-BUILD:COMPILE-FILE-ERROR]

<<more text>>

Digging into pkgdcl.lisp

Steps

6) I had the following as pkgdcl.lisp:

(uiop:define-package #:vega
    (:use #:cl
    #:dfio
    #:plot
    #:select
    #:let-plus
    #:alexandria
    #:alexandria+
    #:data-frame))

7) I ran (ql:quickload :plot/vega), and I got the error "READ error during COMPILE-FILE: The symbol "WRITE-SPEC" is not external in the VEGA package." I fixed this error by uncommenting #WRITE-SPEC in pkgdcl.lisp.

8) I ran (ql:quickload :plot/vega), and I got the error "READ error during COMPILE-FILE: Package LT does not exist." I uncommented (:local-nicknames (:lt :local-time)).

9) Now the error is

CL-USER> (ql:quickload :plot/vega)
To load "plot/vega":
  Load 1 ASDF system:
    plot/vega
; Loading "plot/vega"

; file: /home/hm/common-lisp/plot/src/vega/pkgdcl.lisp
; in: UIOP/PACKAGE:DEFINE-PACKAGE #:VEGA
;     (UIOP/PACKAGE:DEFINE-PACKAGE #:VEGA
;                                  (:USE #:CL #:DFIO #:PLOT #:SELECT #:LET-PLUS
;                                   #:ALEXANDRIA #:ALEXANDRIA+ #:DATA-FRAME)
;                                  (:LOCAL-NICKNAMES (:LT :LOCAL-TIME))
;                                  (:EXPORT #:WRITE-SPEC))
;
; caught ERROR:
;   (during macroexpansion of (UIOP/PACKAGE:DEFINE-PACKAGE #:VEGA ...))
;   unrecognized define-package keyword :LOCAL-NICKNAMES
;
; compilation unit aborted
;   caught 1 fatal ERROR condition
;   caught 1 ERROR condition
; Evaluation aborted on #<UIOP/LISP-BUILD:COMPILE-FILE-ERROR {100563A913}>.

Current state of pkgdcl.lisp file (with bulk commented sections removed)

;;; -*- Mode: LISP; Base: 10; Syntax: ANSI-Common-Lisp; Package: CL-USER -*-
;;; Copyright (c) 2021-2022 by Symbolics Pte. Ltd. All rights reserved.

(uiop:define-package #:vega
    (:use #:cl
    #:dfio
    #:plot
    #:select
    #:let-plus
    #:alexandria
    #:alexandria+
    #:data-frame)

;;   (:import-from #:select #:select)
;;   (:import-from #:lisp-stat #:data)
;;   (:import-from #:data-frame #:defdf)
;;   (:import-from #:parenscript #:symbol-to-js-string)
;;   (:import-from #:dfio #:with-input-stream #:data-column #:data-column-add #:data-column-vector)
  (:local-nicknames (:lt :local-time))
;;   (:documentation "A plotting backend for Plot based on Vega. The specification DSL, in PLIST format, is that of Vega-Lite.  The data output representation is Vega.")

  (:export
   #:write-spec

))
Symbolics commented 2 years ago

The fasl file location varies depending on lisp implementation and OS. This page seems to suggest that on Linux it's in a ~/.cache directory.

There's something not quite right in the environment here. You should have everything you need for package-local-nickname to work, Let's try the simplest package definition possible:

(ql:quickload :local-time) ;make sure there are no errors!
(uiop:define-package #:foo
  (:use #:cl)
  (:local-nicknames (#:lt #:local-time)))

You could also try this example.

Let's also confirm you've got the most recent version of lisp-stat loaded:

(ql:quickload :lisp-stat)
(in-package :ls-user)
(data :mtcars)

If you can execute the above, we know you have the correct version of Lisp-Stat loaded.

HM0880 commented 2 years ago

Lisp Stat

I deleted everything in ~/.cache/common-lisp/ and then ran the second example:

; SLIME 2.27
CL-USER> (ql:quickload :lisp-stat)
(in-package :ls-user)
(data :mtcars)
To load "lisp-stat":
  Load 1 ASDF system:
    lisp-stat
; Loading "lisp-stat"
....................
WARNING: Missing column name was filled in
T
LS-USER> 

So Lisp-Stat seems fine.

Local nicknames

The first example fails:

(uiop:define-package #:foo
  (:use #:cl)
  (:local-nicknames (#:lt #:local-time)))
To load "local-time":
  Load 1 ASDF system:
    local-time
; Loading "local-time"
unrecognized define-package keyword :LOCAL-NICKNAMES
   [Condition of type SIMPLE-ERROR]

Restarts:
 0: [RETRY] Retry SLIME REPL evaluation request.
 1: [*ABORT] Return to SLIME's top level.
 2: [ABORT] abort thread (#<THREAD "repl-thread" RUNNING {1005C90003}>)

Backtrace:
  0: (UIOP/PACKAGE:PARSE-DEFINE-PACKAGE-FORM #:FOO ((:USE #:CL) (:LOCAL-NICKNAMES (#:LT #:LOCAL-TIME))))
  1: ((MACRO-FUNCTION UIOP/PACKAGE:DEFINE-PACKAGE) (UIOP/PACKAGE:DEFINE-PACKAGE #:FOO (:USE #:CL) (:LOCAL-NICKNAMES (#:LT #:LOCAL-TIME))) #<unused argument>)
  2: (MACROEXPAND-1 (UIOP/PACKAGE:DEFINE-PACKAGE #:FOO (:USE #:CL) (:LOCAL-NICKNAMES (#:LT #:LOCAL-TIME))) #<NULL-LEXENV>)
  3: (MACROEXPAND (UIOP/PACKAGE:DEFINE-PACKAGE #:FOO (:USE #:CL) (:LOCAL-NICKNAMES (#:LT #:LOCAL-TIME))) #<NULL-LEXENV>)
  4: (SB-INT:SIMPLE-EVAL-IN-LEXENV (UIOP/PACKAGE:DEFINE-PACKAGE #:FOO (:USE #:CL) (:LOCAL-NICKNAMES (#:LT #:LOCAL-TIME))) #<NULL-LEXENV>)
  5: (EVAL (UIOP/PACKAGE:DEFINE-PACKAGE #:FOO (:USE #:CL) (:LOCAL-NICKNAMES (#:LT #:LOCAL-TIME))))
 --more--
Symbolics commented 2 years ago

Okay, that's progress. Try this example: https://gist.github.com/phoe/2b63f33a2a4727a437403eceb7a6b4a3

If that fails, we'll know it's uiop:define-package.

Symbolics commented 2 years ago

Just thought I'd check in to see if we've confirmed that this is an ASDF bug. The code to confirm this, at the URL above, is:

(ql:quickload :alexandria)

(uiop:define-package my-package 
  (:use #:cl)
  (:local-nicknames (#:a #:alexandria.dev.0)))

If we're correct, that should fail, where:

(defpackage my-package 
  (:use #:cl)
  (:local-nicknames (#:a #:alexandria.dev.0)))

should succeed.

If this is the case, then the next step is to report it to the ASDF maintainers.

HM0880 commented 2 years ago

Thanks for the detailed code snippets; I wasn't sure what to run from Phoe.

Part 1 does fail

Code

(ql:quickload :alexandria)

(uiop:define-package my-package 
  (:use #:cl)
  (:local-nicknames (#:a #:alexandria.dev.0)))

Error

unrecognized define-package keyword :LOCAL-NICKNAMES
   [Condition of type SIMPLE-ERROR]

Restarts:
 0: [RETRY] Retry SLIME REPL evaluation request.
 1: [*ABORT] Return to SLIME's top level.
 2: [ABORT] abort thread (#<THREAD "repl-thread" RUNNING {1002E29763}>)

Backtrace:
  0: (UIOP/PACKAGE:PARSE-DEFINE-PACKAGE-FORM MY-PACKAGE ((:USE #:CL) (:LOCAL-NICKNAMES (#:A #:ALEXANDRIA.DEV.0))))
  1: ((MACRO-FUNCTION UIOP/PACKAGE:DEFINE-PACKAGE) (UIOP/PACKAGE:DEFINE-PACKAGE MY-PACKAGE (:USE #:CL) (:LOCAL-NICKNAMES (#:A #:ALEXANDRIA.DEV.0))) #<unused argument>)
  2: (MACROEXPAND-1 (UIOP/PACKAGE:DEFINE-PACKAGE MY-PACKAGE (:USE #:CL) (:LOCAL-NICKNAMES (#:A #:ALEXANDRIA.DEV.0))) #<NULL-LEXENV>)
  3: (MACROEXPAND (UIOP/PACKAGE:DEFINE-PACKAGE MY-PACKAGE (:USE #:CL) (:LOCAL-NICKNAMES (#:A #:ALEXANDRIA.DEV.0))) #<NULL-LEXENV>)
  4: (SB-INT:SIMPLE-EVAL-IN-LEXENV (UIOP/PACKAGE:DEFINE-PACKAGE MY-PACKAGE (:USE #:CL) (:LOCAL-NICKNAMES (#:A #:ALEXANDRIA.DEV.0))) #<NULL-LEXENV>)
  5: (EVAL (UIOP/PACKAGE:DEFINE-PACKAGE MY-PACKAGE (:USE #:CL) (:LOCAL-NICKNAMES (#:A #:ALEXANDRIA.DEV.0))))
 --more--

Part 2 also fails (on a fresh instance of SLIME)

Code

(defpackage my-package 
  (:use #:cl)
  (:local-nicknames (#:a #:alexandria.dev.0)))

Error

The name "ALEXANDRIA.DEV.0" does not designate any package.
   [Condition of type SB-KERNEL:SIMPLE-PACKAGE-ERROR]

Restarts:
 0: [RETRY] Retry SLIME REPL evaluation request.
 1: [*ABORT] Return to SLIME's top level.
 2: [ABORT] abort thread (#<THREAD "repl-thread" RUNNING {1002E41763}>)

Backtrace:
  0: (SB-IMPL::SIGNAL-PACKAGE-ERROR "MY-PACKAGE" "The name ~S does not designate any package." "ALEXANDRIA.DEV.0")
  1: (SB-IMPL::%ADD-PACKAGE-LOCAL-NICKNAME "A" "ALEXANDRIA.DEV.0" #<PACKAGE "MY-PACKAGE">)
  2: (SB-IMPL::UPDATE-PACKAGE #<PACKAGE "MY-PACKAGE"> NIL #S(SB-C:DEFINITION-SOURCE-LOCATION :NAMESTRING NIL :INDICES 0) NIL NIL (#<PACKAGE "COMMON-LISP">) NIL NIL NIL ("MY-PACKAGE") (("A" . "ALEXANDRIA.DE..
  3: ((FLET "WITHOUT-INTERRUPTS-BODY-11" :IN SB-THREAD::CALL-WITH-RECURSIVE-LOCK))
  4: (SB-THREAD::CALL-WITH-RECURSIVE-LOCK #<FUNCTION (FLET SB-THREAD::WITH-RECURSIVE-LOCK-THUNK :IN SB-IMPL::%DEFPACKAGE) {7F3C04F6DCFB}> #<SB-THREAD:MUTEX "Package Graph Lock" taken owner=repl-thread> T N..
  5: (SB-IMPL::%DEFPACKAGE "MY-PACKAGE" NIL NIL NIL NIL ("CL") NIL NIL NIL ("MY-PACKAGE") (("A" . "ALEXANDRIA.DEV.0")) NIL #S(SB-C:DEFINITION-SOURCE-LOCATION :NAMESTRING NIL :INDICES 0) NIL)
  6: (SB-INT:SIMPLE-EVAL-IN-LEXENV (SB-IMPL::%DEFPACKAGE "MY-PACKAGE" (QUOTE NIL) (QUOTE NIL) (QUOTE NIL) (QUOTE NIL) ...) #<NULL-LEXENV>)
  7: (SB-INT:SIMPLE-EVAL-IN-LEXENV (DEFPACKAGE MY-PACKAGE (:USE #:CL) (:LOCAL-NICKNAMES (#:A #:ALEXANDRIA.DEV.0))) #<NULL-LEXENV>)
  8: (EVAL (DEFPACKAGE MY-PACKAGE (:USE #:CL) (:LOCAL-NICKNAMES (#:A #:ALEXANDRIA.DEV.0))))
 --more--
Symbolics commented 2 years ago

Ah, right. It seems alexandria has changed since that gist was written. Try this one:

 (defpackage my-package
  (:use #:cl)
  (:local-nicknames (#:a #:alexandria-1)))

This works for me. If it works for you too, then we know the problem is in uiop:define-package.

HM0880 commented 2 years ago

Fails with code as written from the previous comment

Code

; SLIME 2.27
CL-USER>  (defpackage my-package
  (:use #:cl)
  (:local-nicknames (#:a #:alexandria-1)))

Error

The name "ALEXANDRIA-1" does not designate any package.
   [Condition of type SB-KERNEL:SIMPLE-PACKAGE-ERROR]

Restarts:
 0: [RETRY] Retry SLIME REPL evaluation request.
 1: [*ABORT] Return to SLIME's top level.
 2: [ABORT] abort thread (#<THREAD "repl-thread" RUNNING {1002E41523}>)

Backtrace:
  0: (SB-IMPL::SIGNAL-PACKAGE-ERROR "MY-PACKAGE" "The name ~S does not designate any package." "ALEXANDRIA-1")
  1: (SB-IMPL::%ADD-PACKAGE-LOCAL-NICKNAME "A" "ALEXANDRIA-1" #<PACKAGE "MY-PACKAGE">)
  2: (SB-IMPL::UPDATE-PACKAGE #<PACKAGE "MY-PACKAGE"> NIL #S(SB-C:DEFINITION-SOURCE-LOCATION :NAMESTRING NIL :INDICES 0) NIL NIL (#<PACKAGE "COMMON-LISP">) NIL NIL NIL ("MY-PACKAGE") (("A" . "ALEXANDRIA-1"..
  3: ((FLET "WITHOUT-INTERRUPTS-BODY-11" :IN SB-THREAD::CALL-WITH-RECURSIVE-LOCK))
  4: (SB-THREAD::CALL-WITH-RECURSIVE-LOCK #<FUNCTION (FLET SB-THREAD::WITH-RECURSIVE-LOCK-THUNK :IN SB-IMPL::%DEFPACKAGE) {7F78884A5CFB}> #<SB-THREAD:MUTEX "Package Graph Lock" taken owner=repl-thread> T N..
  5: (SB-IMPL::%DEFPACKAGE "MY-PACKAGE" NIL NIL NIL NIL ("CL") NIL NIL NIL ("MY-PACKAGE") (("A" . "ALEXANDRIA-1")) NIL #S(SB-C:DEFINITION-SOURCE-LOCATION :NAMESTRING NIL :INDICES 0) NIL)
  6: (SB-INT:SIMPLE-EVAL-IN-LEXENV (SB-IMPL::%DEFPACKAGE "MY-PACKAGE" (QUOTE NIL) (QUOTE NIL) (QUOTE NIL) (QUOTE NIL) ...) #<NULL-LEXENV>)
  7: (SB-INT:SIMPLE-EVAL-IN-LEXENV (DEFPACKAGE MY-PACKAGE (:USE #:CL) (:LOCAL-NICKNAMES (#:A #:ALEXANDRIA-1))) #<NULL-LEXENV>)
  8: (EVAL (DEFPACKAGE MY-PACKAGE (:USE #:CL) (:LOCAL-NICKNAMES (#:A #:ALEXANDRIA-1))))
 --more--

Running (ql:quickload :alexandria) does work though

CL-USER> (ql:quickload :alexandria)
To load "alexandria":
  Load 1 ASDF system:
    alexandria
; Loading "alexandria"

(:ALEXANDRIA)
CL-USER> (defpackage my-package
  (:use #:cl)
  (:local-nicknames (#:a #:alexandria-1)))
#<PACKAGE "MY-PACKAGE">
CL-USER>
Symbolics commented 2 years ago

Fantastic! Congratulations, you seem to have discovered a bug in UIOP. I'm happy to report this on your behalf, but I suggest that it might be a good learning experience for you to report it. There was a recent reddit post asking for people to give feedback, and you could report it there or on the gitlab issues page. I'll monitor and comment as required.

Now, back to Lisp-Stat. As a temporary measure, you should be able to change (uiop:define-package ... to (cl:defpackage ... in pkgdcl.lisp to work around the problem.

HM0880 commented 2 years ago
HM0880 commented 2 years ago

Bug report

Opened a bug report here: https://gitlab.common-lisp.net/asdf/asdf/-/issues/126

Work-around is not working

(Still a UIOP error?)

In ~/common-lisp/lisp-stat/pkgdcls.lisp, I changed:

;;; -*- Mode: LISP; Base: 10; Syntax: ANSI-Common-lisp; Package: CL-USER -*-
;;; Copyright (c) 2021 by Symbolics Pte. Ltd. All rights reserved.

;;(uiop:define-package #:lisp-stat  ;; <-- removed this
(cl:defpackage #:lisp-stat  ;; <-- added this

Quicklisp command

; SLIME 2.27
CL-USER> (ql:quickload :lisp-stat)
To load "lisp-stat":
  Load 1 ASDF system:
    lisp-stat
; Loading "lisp-stat"
..................................................
[package lisp-stat]

; file: /home/hm/common-lisp/lisp-stat/pkgdcls.lisp
; in: DEFPACKAGE #:LISP-STAT
;     (DEFPACKAGE #:LISP-STAT
;       (:NICKNAMES :LS)
;       (:DOCUMENTATION "Base functions for Lisp-Stat")
;       (:USE :COMMON-LISP)
;       (:IMPORT-FROM :LET-PLUS #:LET+)
;       (:SHADOWING-IMPORT-FROM :NUM-UTILS.STATISTICS #:MEAN #:VARIANCE #:MEDIAN)
;       (:SHADOWING-IMPORT-FROM :ARRAY-OPERATIONS #:FLATTEN)
;       (:USE-REEXPORT :ALEXANDRIA
;                      :ARRAY-OPERATIONS
;                      :DATA-FRAME
;                      :DFIO
;                      :NUM-UTILS.ARITHMETIC
;                      :NUM-UTILS.STATISTICS
;                      :NUM-UTILS.ELEMENTWISE
;                      :NUM-UTILS.UTILITIES
;                      :NUM-UTILS.PRINT-MATRIX
;                      :SELECT
;                      :SPLIT-SEQUENCE)
;       (:EXPORT #:VARIABLES
;                #:DATA
;                #:DEF
;                #:UNDEF-VAR
;                #:SAVEVAR
;                #:FIVENUM
;                #:INTERQUARTILE-RANGE
;                #:LOAD-TUTORIAL-DATA))
; 
; caught ERROR:
;   (during macroexpansion of (DEFPACKAGE #:LISP-STAT
;     ...))
;   bogus DEFPACKAGE option: (:USE-REEXPORT :ALEXANDRIA :ARRAY-OPERATIONS
;                             :DATA-FRAME :DFIO :NUM-UTILS.ARITHMETIC
;                             :NUM-UTILS.STATISTICS :NUM-UTILS.ELEMENTWISE
;                             :NUM-UTILS.UTILITIES :NUM-UTILS.PRINT-MATRIX :SELECT
;                             :SPLIT-SEQUENCE)

Error

COMPILE-FILE-ERROR while
compiling #<CL-SOURCE-FILE "lisp-stat" "pkgdcls">
   [Condition of type UIOP/LISP-BUILD:COMPILE-FILE-ERROR]

Restarts:
 0: [RETRY] Retry compiling #<CL-SOURCE-FILE "lisp-stat" "pkgdcls">.
 1: [ACCEPT] Continue, treating compiling #<CL-SOURCE-FILE "lisp-stat" "pkgdcls"> as having been successful.
 2: [RETRY] Retry ASDF operation.
 3: [CLEAR-CONFIGURATION-AND-RETRY] Retry ASDF operation after resetting the configuration.
 4: [RETRY] Retry ASDF operation.
 5: [CLEAR-CONFIGURATION-AND-RETRY] Retry ASDF operation after resetting the configuration.
 --more--

Backtrace:
  0: (UIOP/LISP-BUILD:CHECK-LISP-COMPILE-RESULTS NIL T T "~/asdf-action::format-action/" ((#<ASDF/LISP-ACTION:COMPILE-OP > . #<ASDF/LISP-ACTION:CL-SOURCE-FILE "lisp-stat" "pkgdcls">)))
  1: ((SB-PCL::EMF ASDF/ACTION:PERFORM) #<unused argument> #<unused argument> #<ASDF/LISP-ACTION:COMPILE-OP > #<ASDF/LISP-ACTION:CL-SOURCE-FILE "lisp-stat" "pkgdcls">)
  2: ((LAMBDA NIL :IN ASDF/ACTION:CALL-WHILE-VISITING-ACTION))
  3: ((:METHOD ASDF/ACTION:PERFORM-WITH-RESTARTS :AROUND (T T)) #<ASDF/LISP-ACTION:COMPILE-OP > #<ASDF/LISP-ACTION:CL-SOURCE-FILE "lisp-stat" "pkgdcls">) [fast-method]
  4: ((:METHOD ASDF/PLAN:PERFORM-PLAN (T)) #<ASDF/PLAN:SEQUENTIAL-PLAN {1002615E13}>) [fast-method]
  5: ((FLET SB-C::WITH-IT :IN SB-C::%WITH-COMPILATION-UNIT))
  6: ((:METHOD ASDF/PLAN:PERFORM-PLAN :AROUND (T)) #<ASDF/PLAN:SEQUENTIAL-PLAN {1002615E13}>) [fast-method]
  7: ((:METHOD ASDF/OPERATE:OPERATE (ASDF/OPERATION:OPERATION ASDF/COMPONENT:COMPONENT)) #<ASDF/LISP-ACTION:LOAD-OP > #<ASDF/SYSTEM:SYSTEM "lisp-stat"> :PLAN-CLASS NIL :PLAN-OPTIONS NIL) [fast-method]
  8: ((SB-PCL::EMF ASDF/OPERATE:OPERATE) #<unused argument> #<unused argument> #<ASDF/LISP-ACTION:LOAD-OP > #<ASDF/SYSTEM:SYSTEM "lisp-stat"> :VERBOSE NIL)
  9: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
 10: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) #<ASDF/LISP-ACTION:LOAD-OP > #<ASDF/SYSTEM:SYSTEM "lisp-stat"> :VERBOSE NIL) [fast-method]
 11: ((SB-PCL::EMF ASDF/OPERATE:OPERATE) #<unused argument> #<unused argument> ASDF/LISP-ACTION:LOAD-OP "lisp-stat" :VERBOSE NIL)
 12: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
 13: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) ASDF/LISP-ACTION:LOAD-OP "lisp-stat" :VERBOSE NIL) [fast-method]
 14: (ASDF/SESSION:CALL-WITH-ASDF-SESSION #<FUNCTION (LAMBDA NIL :IN ASDF/OPERATE:OPERATE) {10026126BB}> :OVERRIDE T :KEY NIL :OVERRIDE-CACHE T :OVERRIDE-FORCING NIL)
 15: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
 16: (ASDF/SESSION:CALL-WITH-ASDF-SESSION #<FUNCTION (LAMBDA NIL :IN ASDF/OPERATE:OPERATE) {10025A2F5B}> :OVERRIDE NIL :KEY NIL :OVERRIDE-CACHE NIL :OVERRIDE-FORCING NIL)
 17: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) ASDF/LISP-ACTION:LOAD-OP "lisp-stat" :VERBOSE NIL) [fast-method]
 18: (ASDF/OPERATE:LOAD-SYSTEM "lisp-stat" :VERBOSE NIL)
 19: (QUICKLISP-CLIENT::CALL-WITH-MACROEXPAND-PROGRESS #<FUNCTION (LAMBDA NIL :IN QUICKLISP-CLIENT::APPLY-LOAD-STRATEGY) {10025A207B}>)
 --more--
Symbolics commented 2 years ago

That change of uiop:define-package -> cl:defpackage should be in PLOT:SRC;VEGA;pkgdcl.lisp, not in Lisp-Stat.

HM0880 commented 2 years ago

That change of uiop:define-package -> cl:defpackage should be in PLOT:SRC;VEGA;pkgdcl.lisp, not in Lisp-Stat.

OK, I put cl:defpackage in correct file, and I can load the data! Very exciting!

HM0880 commented 2 years ago

Working through https://lisp-stat.dev/docs/getting-started/ now.

There is a small issue. Per the docs, I ran:

LS-USER> (vega:write-html hp-mpg)
#P"/tmp/plot/hp-mpg.html"

(vega:write-html hp-mpg) writes an HTML file to the path given, but (1) opening the file in the Brave browser shows nothing and (2) the command

LS-USER> (plot:plot-from-file (vega:write-html hp-mpg))

gives the error

Couldn't execute "chrome": No such file or directory
   [Condition of type SIMPLE-ERROR]

Restarts:
 0: [RETRY] Retry SLIME REPL evaluation request.
 1: [*ABORT] Return to SLIME's top level.
 2: [ABORT] abort thread (#<THREAD "repl-thread" RUNNING {1001838003}>)

Backtrace:
  0: (SB-EXT:RUN-PROGRAM "chrome" ("--user-data-dir=/tmp/plot/chrome-data-G680" "--window-size=800,600" "--app=file:///tmp/plot/hp-mpg.html") :ENV NIL :ENVIRONMENT NIL :WAIT NIL :SEARCH T :PTY NIL :INPUT N..
  1: (UIOP/LAUNCH-PROGRAM:LAUNCH-PROGRAM ("chrome" "--user-data-dir=/tmp/plot/chrome-data-G680" "--window-size=800,600" "--app=file:///tmp/plot/hp-mpg.html") :IGNORE-ERROR-STATUS T)
  2: (SB-INT:SIMPLE-EVAL-IN-LEXENV (PLOT:PLOT-FROM-FILE (VEGA:WRITE-HTML HP-MPG)) #<NULL-LEXENV>)
  3: (EVAL (PLOT:PLOT-FROM-FILE (VEGA:WRITE-HTML HP-MPG)))
 --more--

I have Brave as my default browser, and I do have Chrome on my system at /usr/bin/google-chrome-stable.

Symbolics commented 2 years ago

Does the written file have content when you open it in a text editor?

As for Brave, I don't have any experience with this browser. If the file has content, try opening it with another browser to see if that's the issue. Chrome is the safer bet. I use it for all my plotting (but I browse with Firefox).

This is really a documentation bug, IMO. We used to have documentation describing the configuration, but that got lost in the latest doc updates. To configure the system for a new browser, you need to update the values in browser.lisp. Typically this would happen in your ls-init.lisp initialisation file. You'll use alist functions to set the values.

If you figure this out for brave, it would be a huge help if you could also update the documentation by adding a 'configure the browser' section based on what we learn in this thread.

HM0880 commented 2 years ago

Does the written file have content when you open it in a text editor?

Yes, and the content looks sensible: a long line of JavaScript with keys like "origin," year," "milesPerGallon," etc.

Chrome is the safer bet. I use it for all my plotting (but I browse with Firefox).

I manually opened the HTML in Chrome and Firefox, and nothing is shown.

If you figure this out for brave [...]

Sounds good; I may have some time this weekend to look at the Brave config.

Symbolics commented 2 years ago

Are browser security options getting in the way? There's some information on debugging in the plotting tutorial.

snunez1 commented 2 years ago

@HM0880 have you got what you need?

nathanvy commented 2 years ago

The problem is that Quicklisp, the common lisp version of a package manager, hasn't been updated yet. It's usually done monthly.

As of the time of this writing, @quicklisp hasn't been updated in several months. I hope Zach's all right. As an interim measure, may I humbly suggest submitting lisp-stat to https://ultralisp.org/ which is much like Quicklisp but updates every few hours five minutes instead of every few months?

I have no affiliation with ultralisp, I just enjoy not having to manually download and manage dependencies.

snunez1 commented 1 year ago

@nathanvy, submitting to ultralisp is a good idea, thanks. I'm going to close this for now.