Lisp-Stat / documentation

Documentation for Lisp-Stat

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`plot-from-file` passes faulty args to uiop:launch-program because of back-quote comma-splice (,@)

mirkov opened this issue · comments

commented

This is on CentOS 7,

LS> (lisp-implementation-type)
"SBCL"
LS> (lisp-implementation-version)
"2.0.7"

It is related to a previously submitted Issue.

Running:
LS> (plot:plot-from-file #P"/tmp/plot/cars-scatter-plot.html" :browser :default)

ends up in the debugger:

The value
  "/tmp/plot/cars-scatter-plot.html"
is not of type
  LIST
   [Condition of type TYPE-ERROR]

I can fix that if, in plot/plot.lisp by removing the @ from the back-quote. Here is the offending code:

(defun plot-from-file (filespec &key (browser *default-browser-command*) (browser-options *default-browser-options*))
  "Open plot specification FILESPEC"
  (let ((plot-file (namestring (truename filespec))))
    #+windows (setf plot-file (concatenate 'string "file:///" plot-file))
    (uiop:launch-program
     `(,(alexandria:assoc-value plot:*browser-commands* browser)
                         ;; Remove the `@' for uiop:launch-program & sp-ext:run-program to execute property
			 ,@(case browser  
			     (:chrome (if (assoc "app" browser-options :test 'string=)
					              (setf (cdr (assoc "app" browser-options :test 'string=)) plot-file))
			      (encode-chrome-options browser-options))
			     (:default plot-file)))
		 :ignore-error-status t)))

I created a minimal example to illustrate the effects of the ,@:

LS> (let ((browser :default))
      `(abc ,@(case browser (:chrome nil) (:default t))))
(ABC . T)
commented

OP here - let me debug this a bit more ... On Windows, I am getting a plot window as expected ... So please wait for an update from me

commented

This is not an issue - I will close it.
On my CentOS, quicklisp downloaded an old version of the library, 20211020. On windows, it downloaded version 20220331.
The problem was on my side.