Skip to content

Improve loading the system in sbclb#7

Closed
keram wants to merge 3 commits into
Lisp-Stat:masterfrom
keram:fix-load
Closed

Improve loading the system in sbclb#7
keram wants to merge 3 commits into
Lisp-Stat:masterfrom
keram:fix-load

Conversation

@keram

@keram keram commented Jun 5, 2026

Copy link
Copy Markdown

Thank you for getting together this project.
When trying to use it I encounter few minor issues so far that I try to address in this PR.

  1. UNBOUND-VARIABLE IQR
 (ql:quickload :lisp-stat)
; Loading "lisp-stat"
............
; Debugger entered on #<UNBOUND-VARIABLE IQR {12055BD0A3}>

This is due to missing definition of defalias macro(function) in sbcl.

  1. No package named :STATISTICS
(ql:quickload :statistics)
debugger invoked on a ORG.TFEB.CONDUIT-PACKAGES::CONDUIT-ERROR in thread
  No package named :STATISTICS
  1. missing definitions of exported variance and mean fn in statistics package

I guess this is left from some larger changes and their export could be removed.
To avoid breaking changes I decided for time being import them from :stat-generics

keram added 3 commits June 5, 2026 17:42
nonexisting `defalias` function in sbcl
Before:
```
* (ql:quickload :lisp-stat)
debugger invoked on a ORG.TFEB.CONDUIT-PACKAGES::CONDUIT-ERROR in thread
  No package named :STATISTICS
```

same error happen when trying `(ql:quickload :statistics)`

After:

All `(ql:quickload :lisp-stat)`, `(ql:quickload :statistics)` or
`(ql:quickload "statistics")` work without errors.
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@keram

keram commented Jun 5, 2026

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Jun 5, 2026
@snunez1

snunez1 commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

I think these issues are due to a stale version of the libraries in Quicklisp. Will you please try downloading stat-generics and statistics into a directory that quicklisp knows about (like ~/quicklisp/local-projects) and then load. That should fix these problems.

@keram

keram commented Jun 6, 2026

Copy link
Copy Markdown
Author

Hi, Thank you for response!

I think these issues are due to a stale version of the libraries in Quicklisp. Will you please try downloading stat-generics and statistics into a directory that quicklisp knows about (like ~/quicklisp/local-projects) and then load. That should fix these problems.

I double checked and already had cloned stat-generics and statistics locally. I missed the lisp-stat which was loaded from quicklisp but even after cloning this repository the issues persisted.

* (asdf:system-source-directory :lisp-stat)
#P"/home/m/sources/common-lisp/lisp-stat/"
* (asdf:system-source-directory :statistics)
#P"/home/m/sources/common-lisp/statistics/"
* (asdf:system-source-directory :stat-generics)
#P"/home/m/sources/common-lisp/stat-generics/"```

for clarity here is fuller output from repl

* (ql:quickload :lisp-stat)
; Loading "lisp-stat"
.....
debugger invoked on a UNBOUND-VARIABLE @1203FA7196 in thread
#<THREAD tid=34748 "main thread" RUNNING {1200C50183}>:
  The variable IQR is unbound.
                                     loading FASL for #<CL-SOURCE-FILE "statistics/batch" "batch">.
  5: [ACCEPT                       ] Continue, treating
                                     loading FASL for #<CL-SOURCE-FILE "statistics/batch" "batch">
                                     as having been successful.
   source: (DEFALIAS IQR INTERQUARTILE-RANGE)
0] 5
.............................................
[package lisp-stat]...............................
[package ls-user]
(:LISP-STAT)

This is fixed by the first commit 6d1349b

With first commit applied we get rid of the IQR error but

* (ql:quickload :statistics)
; Loading "statistics"
..........
(:STATISTICS)
* (statistics:mean '(1 2 3))

debugger invoked on a SB-INT:SIMPLE-READER-PACKAGE-ERROR in thread
  Package STATISTICS does not exist.

This is addressed by the second commit 263c40b

Lastly also with second commit applied:

* (ql:quickload :statistics)
(:STATISTICS)
* (statistics:mean '(1 2 3))
; in: STATISTICS:MEAN '(1 2 3)
; caught STYLE-WARNING:
;   undefined function: STATISTICS:MEAN
The function STATISTICS:MEAN is undefined.
("undefined function" (1 2 3))

This is addressed by the last commit 8cd260f

* (ql:quickload :statistics)
(:STATISTICS)
* (statistics:mean '(1 2 3))
2

Also my setup:

$ ros config
setup.time=3989736208
sbcl-bin.version=2.6.5
default.lisp=sbcl-bin

$ ros --version
roswell 24.10.115(NO-GIT-REVISION)

@snunez1

snunez1 commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Try this:

  1. checkout alexandria+ into ~/quicklisp/local-projects/
  2. Don't use (statistics;mean ...). Use the generic function mean and let dispatch happen on the object you're passing, e.g. (mean '(1 2 3))

That should get you going.

Actually, what would be very helpful would be if you could help document these new user experiences, either in a 'blog or github tutorial on your own or in the lisp-stat documentation. It's easy to miss these things after you've been a user for a while and capturing the problems newcomers face is valuable.

@keram

keram commented Jun 7, 2026

Copy link
Copy Markdown
Author

Try this:

1. checkout `alexandria+` into `~/quicklisp/local-projects/`

Indeed this solves the issue with IQR alias. 👍🏻
Seems like the alexandria+ in quicklisp is too old and may require to have new version released in order to fix this issue without having it to clone locally for others.
(without clone)

* (asdf:system-source-directory :alexandria+)
#P"/home/m/.roswell/lisp/quicklisp/dists/quicklisp/software/alexandria-plus-20250622-git/"

I'm happy to close this PR without merge as the other two things feel just cosmetic things. Although it still surprises me to see the existing export of mean and variance in
https://github.com/Lisp-Stat/statistics/blob/master/src/pkgdcl.lisp#L8

(in-package :org.tfeb.clc-user)

(uiop:define-package "statistics"
  (:use #:cl #:let-plus)
  (:export #:mean
	   #:variance))

Is that by purpose or just some kind of leftover?

Ad 2.

Yeah, I'm still in exploratory phase of the whole lisp-stat system :)
I encounter quite few issues with plotting but that's different story and will address separately in future.

Thanks for the feedback so far!

@snunez1

snunez1 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

You raise a good point in the exports. I have removed them from batch.lisp in the latest commit.

One thing to note as you explore lisp-stat in mid 2026: the code is ahead of the documentation. There are complete tests though, and those are probably the best 'how to' sources at the moment. In particular with plot the 'quickplot' functionality has been merged into the mainline code and is no longer a stand-alone system.

@snunez1 snunez1 closed this Jun 8, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants