Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the big-string Reference Manual, generated automatically by Declt version 3.0 "Montgomery Scott" on Sun May 15 03:22:34 2022 GMT+0.
• Introduction | What big-string is all about | |
• Systems | The systems documentation | |
• Files | The files documentation | |
• Packages | The packages documentation | |
• Definitions | The symbols documentation | |
• Indexes | Concepts, functions, variables and data types |
BIG-STRING ========== By Robert Smith INTRODUCTION & USAGE -------------------- BIG-STRING is a library for working with big strings. Despite the name, BIG-STRING is also useful for general collections of strings. It is very much like Java's StringBuilder class. Care has been taken to make most operations linear in time at worst. The usual trick to concatenate many strings together in (probably) linear time is to use WITH-OUTPUT-TO-STRING: CL-USER> (let ((strings '("this " "is " "a " "collection " "of " "strings."))) (with-output-to-string (*standard-output*) (dolist (string strings) (princ string)))) "this is a collection of strings." Depending on how WITH-OUTPUT-TO-STRING is implemented, this might not be linear, and could be inefficient (the standard makes no complexity guarantee). BIG-STRING encapsulates this idea in a data structure: BIG-STRING> (let* ((strings '("this " "is " "a " "collection " "of " "strings.")) (bs (make-big-string))) (dolist (string strings bs) (big-string-append bs string))) #We can convert this into a string in guaranteed linear time: BIG-STRING> (string-of-big-string *) "this is a collection of strings." It is possble to do an analogous operation by creating a new string stream using MAKE-STRING-OUTPUT-STRING, writing to the resulting stream, and the obtaining the string using GET-OUTPUT-STREAM-STRING. In a sense, we are building a string lazily. But more interestingly, we can operate on it as if itself was a string. BIG-STRING> (list (big-string-length **) (big-string-char ** 10) (big-string-substring ** 8 20)) (32 #\c "a collection") LIMITATIONS ----------- Right now, a few operations are slightly inefficient. Also, some more string-like functions should be implemented. The implementation right now takes about twice the time than SBCL takes with string streams. However, with some type tweaking, BIG-STRING goes at the same speed or faster, with about half the memory.
Next: Files, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The big-string system |
Robert Smith <quad@symbo1ics.com>
BSD 3-clause (see LICENSE)
Big strings, similar to Java’s StringBuilder.
big-string.asd (file)
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files |
• The big-string.asd file | ||
• The big-string/package.lisp file | ||
• The big-string/big-string.lisp file |
Next: The big-string/package․lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
big-string.asd
big-string (system)
Next: The big-string/big-string․lisp file, Previous: The big-string․asd file, Up: Lisp files [Contents][Index]
big-string (system)
package.lisp
Previous: The big-string/package․lisp file, Up: Lisp files [Contents][Index]
package.lisp (file)
big-string (system)
big-string.lisp
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The big-string package |
package.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 functions | ||
• Exported structures |
Next: Exported structures, Previous: Exported definitions, Up: Exported definitions [Contents][Index]
Destructively append the string STRING to the big string BS.
Time complexity: O(1) [amortized]
big-string.lisp (file)
Find the Nth char in the big string BS.
Time complexity: O(log n)
big-string.lisp (file)
Return the total length of the big string BS.
Time complexity: O(1)
big-string.lisp (file)
big-string.lisp (file)
Compute the substring from the big string BS from the index START
to before the index END.
Time complexity: with n = end - start, O(n log n)
big-string.lisp (file)
big-string.lisp (file)
big-string.lisp (file)
Build a string from the big string BS.
Time complexity: O(size(bs))
big-string.lisp (file)
Previous: Exported functions, Up: Exported definitions [Contents][Index]
big-string.lisp (file)
structure-object (structure)
print-object (method)
big-string::big-string-size
0
big-string-tracked-length (function)
(setf big-string-tracked-length) (function)
(and (vector big-string::big-string-size) (not simple-array))
(make-array 10 :element-type (quote big-string::big-string-size) :initial-element 0 :adjustable t :fill-pointer 0)
big-string-cumulative-lengths (function)
(setf big-string-cumulative-lengths) (function)
(and (vector simple-string) (not simple-array))
(make-array 10 :element-type (quote simple-string) :initial-element "" :adjustable t :fill-pointer 0)
big-string-strings (function)
(setf big-string-strings) (function)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal functions | ||
• Internal types |
Next: Internal types, Previous: Internal definitions, Up: Internal definitions [Contents][Index]
big-string.lisp (file)
big-string.lisp (file)
big-string.lisp (file)
Find the least value in the array ARRAY greater than N. Return NIL if N is negative or no such number is found.
big-string.lisp (file)
Previous: Internal functions, Up: Internal definitions [Contents][Index]
Possible size of an array.
big-string.lisp (file)
Possible size of a big string.
big-string.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: | B F L |
---|
Jump to: | B F L |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | (
B C F M S |
---|
Jump to: | (
B C F M S |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Jump to: | C S T |
---|
Jump to: | C S T |
---|
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | A B P S T |
---|
Jump to: | A B P S T |
---|