Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the xsubseq Reference Manual, version 0.1, generated automatically by Declt version 3.0 "Montgomery Scott" on Tue Dec 22 15:32:13 2020 GMT+0.
• Introduction | What xsubseq is all about | |
• Systems | The systems documentation | |
• Modules | The modules documentation | |
• Files | The files documentation | |
• Packages | The packages documentation | |
• Definitions | The symbols documentation | |
• Indexes | Concepts, functions, variables and data types |
XSubseq provides functions to be able to handle "subseq"s more effieiently. As Common Lisp's subseq
copies the data every time, "subseq" and "concatenate" code is very inefficient like the following code.
(let ((result (make-array 0 :element-type '(unsigned-byte 8))))
(lambda (data start end)
(setf result (concatenate '(simple-array (unsigned-byte 8) (*))
result
(subseq data start end)))
result))
XSubseq delays the copying until it is actually needed.
(defvar *data1* #(1 2 3))
(defvar *data2* #(4 5 6))
(xsubseq *data1* 0 1)
;=> #S(XSUBSEQ:XSUBSEQ :DATA #(1 2 3) :START 0 :END 1 :LEN 1)
(xnconc (xsubseq *data1* 0 1)
(xsubseq *data2* 2))
;=> #S(XSUBSEQ:CONCATENATED-XSUBSEQS
; :LEN 2
; :LAST (#S(XSUBSEQ:XSUBSEQ :DATA #(4 5 6) :START 2 :END 3 :LEN 1))
; :CHILDREN (#S(XSUBSEQ:XSUBSEQ :DATA #(1 2 3) :START 0 :END 1 :LEN 1)
; #S(XSUBSEQ:XSUBSEQ :DATA #(4 5 6) :START 2 :END 3 :LEN 1)))
(coerce-to-sequence
(xnconc (xsubseq *data1* 0 1)
(xsubseq *data2* 2)))
;=> #(1 6)
(with-xsubseqs (result)
(xnconcf result (xsubseq *data1* 0 1))
(xnconcf result (xsubseq *data2* 2)))
;=> #(1 6)
(ql:quickload :xsubseq)
Copyright (c) 2014 Eitaro Fukamachi (e.arrows@gmail.com)
Licensed under the BSD 2-Clause License.
Next: Modules, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The xsubseq system |
Eitaro Fukamachi
BSD 2-Clause
Efficient way to manage "subseq"s in Common Lisp
# XSubseq
XSubseq provides functions to be able to handle "subseq"s more effieiently. As Common Lisp’s ‘subseq‘ copies the data every time, "subseq" and "concatenate" code is very inefficient like the following code.
“‘common-lisp
(let ((result (make-array 0 :element-type ’(unsigned-byte 8))))
(lambda (data start end)
(setf result (concatenate ’(simple-array (unsigned-byte 8) (*))
result
(subseq data start end)))
result))
“‘
XSubseq delays the copying until it is actually needed.
## Usage
“‘common-lisp
(defvar *data1* #(1 2 3))
(defvar *data2* #(4 5 6))
(xsubseq *data1* 0 1)
;=> #S(XSUBSEQ:XSUBSEQ :DATA #(1 2 3) :START 0 :END 1 :LEN 1)
(xnconc (xsubseq *data1* 0 1)
(xsubseq *data2* 2))
;=> #S(XSUBSEQ:CONCATENATED-XSUBSEQS
; :LEN 2
; :LAST (#S(XSUBSEQ:XSUBSEQ :DATA #(4 5 6) :START 2 :END 3 :LEN 1))
; :CHILDREN (#S(XSUBSEQ:XSUBSEQ :DATA #(1 2 3) :START 0 :END 1 :LEN 1)
; #S(XSUBSEQ:XSUBSEQ :DATA #(4 5 6) :START 2 :END 3 :LEN 1)))
(coerce-to-sequence
(xnconc (xsubseq *data1* 0 1)
(xsubseq *data2* 2)))
;=> #(1 6)
(with-xsubseqs (result)
(xnconcf result (xsubseq *data1* 0 1))
(xnconcf result (xsubseq *data2* 2)))
;=> #(1 6)
“‘
## Installation
“‘common-lisp
(ql:quickload :xsubseq)
“‘
## Author
* Eitaro Fukamachi (e.arrows@gmail.com)
## Copyright
Copyright (c) 2014 Eitaro Fukamachi (e.arrows@gmail.com)
## License
Licensed under the BSD 2-Clause License.
0.1
sb-cltl2
xsubseq.asd (file)
src (module)
Modules are listed depth-first from the system components tree.
• The xsubseq/src module |
xsubseq (system)
src/
xsubseq.lisp (file)
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files |
• The xsubseq.asd file | ||
• The xsubseq/src/xsubseq.lisp file |
Next: The xsubseq/src/xsubseq․lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
xsubseq.asd
xsubseq (system)
Previous: The xsubseq․asd file, Up: Lisp files [Contents][Index]
src (module)
src/xsubseq.lisp
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The xsubseq-asd package | ||
• The xsubseq package |
Next: The xsubseq package, Previous: Packages, Up: Packages [Contents][Index]
xsubseq.asd
Previous: The xsubseq-asd package, Up: Packages [Contents][Index]
xsubseq.lisp (file)
common-lisp
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions | ||
• Internal definitions |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported macros | ||
• Exported compiler macros | ||
• Exported functions | ||
• Exported structures |
Next: Exported compiler macros, Previous: Exported definitions, Up: Exported definitions [Contents][Index]
xsubseq.lisp (file)
xsubseq.lisp (file)
Next: Exported functions, Previous: Exported macros, Up: Exported definitions [Contents][Index]
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
Next: Exported structures, Previous: Exported compiler macros, Up: Exported definitions [Contents][Index]
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
Previous: Exported functions, Up: Exported definitions [Contents][Index]
xsubseq.lisp (file)
structure-object (structure)
integer
0
concatenated-xsubseqs-len (function)
(setf concatenated-xsubseqs-len) (function)
list
concatenated-xsubseqs-last (function)
(setf concatenated-xsubseqs-last) (function)
list
concatenated-xsubseqs-children (function)
(setf concatenated-xsubseqs-children) (function)
xsubseq.lisp (file)
concatenated-xsubseqs (structure)
xsubseq.lisp (file)
concatenated-xsubseqs (structure)
xsubseq.lisp (file)
xsubseq (structure)
xsubseq.lisp (file)
concatenated-xsubseqs (structure)
xsubseq.lisp (file)
xsubseq (structure)
xsubseq.lisp (file)
structure-object (structure)
xsubseq-data (function)
(setf xsubseq-data) (function)
integer
0
xsubseq-start (function)
(setf xsubseq-start) (function)
integer
0
xsubseq-end (function)
(setf xsubseq-end) (function)
integer
0
xsubseq-len (function)
(setf xsubseq-len) (function)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal functions | ||
• Internal types |
Next: Internal types, Previous: Internal definitions, Up: Internal definitions [Contents][Index]
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
xsubseq.lisp (file)
Previous: Internal functions, Up: Internal definitions [Contents][Index]
xsubseq.lisp (file)
Previous: Definitions, Up: Top [Contents][Index]
• Concept index | ||
• Function index | ||
• Variable index | ||
• Data type index |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | F L M X |
---|
Jump to: | F L M X |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | %
(
C F M N O S W X |
---|
Jump to: | %
(
C F M N O S W X |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Jump to: | C D E L S |
---|
Jump to: | C D E L S |
---|
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | C N O P S T X |
---|
Jump to: | C N O P S T X |
---|