From: rtoy <rt...@us...> - 2024-10-01 21:45:25
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Maxima CAS". The branch, master has been updated via 82002f803288b7198c0fe4f268cf2152140ac427 (commit) from bd60a262c555650f94cf1b43c24a7184ac30b299 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 82002f803288b7198c0fe4f268cf2152140ac427 Author: Raymond Toy <toy...@gm...> Date: Tue Oct 1 14:42:12 2024 -0700 Reduce code duplication in print-directories A minor update to [bd60a2] to reduce the code duplication, ensuring we're consistent for each variable. We can just iterate over a list of all the variables that name directories. This works because the printed name is the same as the variable (without "*"). diff --git a/src/init-cl.lisp b/src/init-cl.lisp index d38d87112..8cc6e6bb1 100644 --- a/src/init-cl.lisp +++ b/src/init-cl.lisp @@ -45,22 +45,27 @@ (merror (intl:gettext "assignment: must assign a string to ~:M; found: ~M") var value)))) (defun print-directories () - (format t "~25a~a~%" "maxima-prefix:" *maxima-prefix*) - (format t "~25a~a~%" "maxima-topdir:" *maxima-topdir*) - (format t "~25a~a~%" "maxima-imagesdir:" *maxima-imagesdir*) - (format t "~25a~a~%" "maxima-sharedir:" *maxima-sharedir*) - (format t "~25a~a~%" "maxima-srcdir:" *maxima-srcdir*) - (format t "~25a~a~%" "maxima-demodir:" *maxima-demodir*) - (format t "~25a~a~%" "maxima-testsdir:" *maxima-testsdir*) - (format t "~25a~a~%" "maxima-docdir:" *maxima-docdir*) - (format t "~25a~a~%" "maxima-infodir:" *maxima-infodir*) - (format t "~25a~a~%" "maxima-htmldir:" *maxima-htmldir*) - (format t "~25a~a~%" "maxima-plotdir:" *maxima-plotdir*) - (format t "~25a~a~%" "maxima-layout-autotools:" *maxima-layout-autotools*) - (format t "~25a~a~%" "maxima-userdir:" *maxima-userdir*) - (format t "~25a~a~%" "maxima-tempdir:" *maxima-tempdir*) - (format t "~25a~a~%" "maxima-lang-subdir:" *maxima-lang-subdir*) - (format t "~25a~a~%" "maxima-objdir:" *maxima-objdir*)) + (dolist (var '(*maxima-prefix* + *maxima-topdir* + *maxima-imagesdir* + *maxima-sharedir* + *maxima-srcdir* + *maxima-demodir* + *maxima-testsdir* + *maxima-docdir* + *maxima-infodir* + *maxima-htmldir* + *maxima-plotdir* + *maxima-layout-autotools* + *maxima-userdir* + *maxima-tempdir* + *maxima-lang-subdir* + *maxima-objdir*)) + ;; Neatly print out the name of the variable (sans *) and the + ;; corresponding value. + (format t "~a:~25t~a~%" + (string-trim "*" (string-downcase var)) + (symbol-value var)))) (defvar *maxima-lispname* #+clisp "clisp" ----------------------------------------------------------------------- Summary of changes: src/init-cl.lisp | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) hooks/post-receive -- Maxima CAS |