For the moment we stick to Ultralisp because we are moving faster than the stability of quicklisp.
;;; An attempt was made to include the enumeration function natively at ;;; https://github.com/quicklisp/quicklisp-client/pull/206 ;;; but it was rejected, so we do this: (defun ql-dist::dist-name-pathname (name) "Return the pathname that would be used for an installed dist with the given NAME." (ql-dist::qmerge (make-pathname :directory (list* :relative "dists" (uiop:split-string name :separator "/"))))) (defun digikar99-dist-enumeration-function () "The default function used for producing a list of dist objects." (loop for file in (directory (ql-dist::qmerge "dists/digikar99/*/distinfo.txt")) collect (ql-dist::make-dist-from-file file))) (push 'digikar99-dist-enumeration-function ql::*dist-enumeration-functions*)
Once the function is pushed, install the dist:
;;; See https://ultralisp.org/dists/digikar99/specialized-array-dispatch for related projects (ql-dist:install-dist "http://dist.ultralisp.org/digikar99/specialized-array-dispatch.txt" :prompt nil) ;;; If the install-dist step gives a "can't create directory" error, manually ;;; create the directory $QUICKLISP_HOME/dists/digikar99 (ql:update-dist "digikar99/specialized-array-dispatch") (ql:quickload "dense-numericals") ; or "numericals" (asdf:test-system "dense-numericals") ; or "numericals"
Post that, we are ready to begin:
CL-USER> (uiop:define-package :dn-user (:mix :dense-numericals :dense-arrays-plus-lite :cl)) #<PACKAGE "DN-USER"> CL-USER> (in-package :dn-user) #<PACKAGE "DN-USER"> DN-USER> (setq *array-element-type* 'single-float) SINGLE-FLOAT DN-USER> (setq *default-float-format* 'single-float) SINGLE-FLOAT DN-USER> (+ 2 3) 5 DN-USER> (+ 2 '(1 2 3)) #<STANDARD-DENSE-ARRAY :ROW-MAJOR 3 SINGLE-FLOAT 3.000 4.000 5.000 {10431597F3}> DN-USER> (asarray '(1 2 3)) #<STANDARD-DENSE-ARRAY :ROW-MAJOR 3 SINGLE-FLOAT 1.000 2.000 3.000 {1046EA2653}> DN-USER> (sin '(1 2 3)) #<STANDARD-DENSE-ARRAY :ROW-MAJOR 3 SINGLE-FLOAT 0.841 0.909 0.141 {10435CF5B3}> DN-USER> (sin '(1 2 3) :out (zeros 3)) #<STANDARD-DENSE-ARRAY :ROW-MAJOR 3 SINGLE-FLOAT 0.841 0.909 0.141 {1044146793}> DN-USER> (sin '(1 2 3) :out (zeros 3 :type 'double-float)) #<STANDARD-DENSE-ARRAY :ROW-MAJOR 3 DOUBLE-FLOAT 0.841 0.909 0.141 {104502EE13}> DN-USER> (sin! (asarray '(1 2 3) :type 'double-float)) ; in-place operator #<STANDARD-DENSE-ARRAY :ROW-MAJOR 3 DOUBLE-FLOAT 0.841 0.909 0.141 {1046626D73}>