Skip to content

Commit

Permalink
[fix] use peltadot-traits-library
Browse files Browse the repository at this point in the history
  • Loading branch information
digikar99 committed Mar 31, 2024
1 parent e8ab222 commit 70c0807
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
5 changes: 3 additions & 2 deletions abstract-arrays.asd
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
(defsystem "abstract-arrays"
:author "Shubhamkar B. Ayare (shubhamayare@yahoo.co.in)"
:version "0.3.1"
:version "0.3.2"
:description "Julia's AbstractArray like abstraction for Common Lisp."
:licence "MIT"
:depends-on ("alexandria"
"closer-mop"
"peltadot")
"peltadot"
"peltadot-traits-library")
:serial t
:components ((:file "pre-package")
(:file "package")
Expand Down
3 changes: 2 additions & 1 deletion package.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
#.(cons :shadow (export-symbols))
#.(cons :export (export-symbols))
(:local-nicknames
(:polymorphic-functions #:peltadot/polymorphic-functions)))
(:polymorphic-functions #:peltadot/polymorphic-functions)
(:traits #:peltadot-traits-library)))
14 changes: 7 additions & 7 deletions remaining-protocol.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,16 @@ This is SETFable, and a wrapper around COL-MAJOR-AREF."
`(array-storage-set ,@(nthcdr 2 form))
(print form)))

(define-trait-implementation container abstract-array (t t)
(defun at (arr &rest idx)
(define-trait-implementation traits:container abstract-array (t t)
(defun traits:at (arr &rest idx)
(apply #'aref arr idx))
(define-compiler-macro at (arr &rest idx)
(define-compiler-macro traits:at (arr &rest idx)
`(aref ,arr ,@idx))
(defun (setf at) (new-val arr &rest idx)
(defun (setf traits:at) (new-val arr &rest idx)
(apply #'(setf aref) new-val arr idx))
(define-compiler-macro (setf at) (new-val arr &rest idx)
(define-compiler-macro (setf traits:at) (new-val arr &rest idx)
`(funcall #'(setf aref) ,new-val ,arr ,@idx))
(defun size (arr)
(defun traits:size (arr)
(array-total-size arr))
(defun capacity (arr)
(defun traits:capacity (arr)
(array-total-size arr)))

0 comments on commit 70c0807

Please sign in to comment.