summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-05-09 21:45:27 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-05-09 21:45:27 -0700
commit1d86e714a30686db5dbd4828a2c069acc891365a (patch)
treed260f1d2ce24ea52b81449af8b44eee865a2f365
parentf0ef11bf160678d1e39a7fb1624409d474601306 (diff)
downloadtxr-1d86e714a30686db5dbd4828a2c069acc891365a.tar.gz
txr-1d86e714a30686db5dbd4828a2c069acc891365a.tar.bz2
txr-1d86e714a30686db5dbd4828a2c069acc891365a.zip
doc: relocate and rewrite buffer literal description.
* txr.1: Buffer literals are now described much earlier in the document under Additional Syntax rather than in the Buffers section.
-rw-r--r--txr.137
1 files changed, 25 insertions, 12 deletions
diff --git a/txr.1 b/txr.1
index 1dfa9ab0..c8376132 100644
--- a/txr.1
+++ b/txr.1
@@ -11152,6 +11152,31 @@ and
.code from
fields are the objects denoted by these expressions.
+.NP* Buffer Literals
+
+.meIP <> #b' hex-data '
+
+The notation
+.code #b'
+introduces a buffer object: a data representation for a
+block of bytes. This
+.code #b'
+prefix must be followed
+by a data section and a closing quote.
+The data section consists of hexadecimal digits, among which
+may be interspersed whitespace: tabs, spaces and newlines.
+There must be an even number of digits, or else the
+notation is ill-formed. The whitespace is ignored, and
+pairs of successive hex digits specify bytes.
+If there are no hex digits, then a zero length buffer
+is specified.
+
+Buffers may be constructed by the
+.code make-buffer
+function, and other means such as the
+.code ffi-get
+function.
+
.coNP The @ .. notation
In \*(TL, there is a special "dotdot" notation consisting of a pair of dots.
This can be written between successive atoms or compound expressions, and is a
@@ -52086,18 +52111,6 @@ Buffers are vector-like objects specialized for holding binary data. Buffers
support operations specialized toward the encoding of Lisp values into
machine-oriented data types, and decoding such data types into Lisp values.
-Buffers are of type
-.code buf
-and, have a printed representation consisting of a
-.code #b'
-("hash b quote")
-prefix, immediately followed by data, followed by a closing quote.
-The data consists of hexadecimal digits, which may be separated by
-whitespace: newlines, tabs and spaces.
-If no hexadecimal digits occur, the notation denotes a zero-length buffer.
-There must be an even number of hexadecimal digits; if there is an odd number,
-the notation is ill-formed. Successive pairs of hex digits denote bytes.
-
Buffers are particularly useful in conjunction with the Foreign Function
Interface (FFI), since they can be used to prepare arbitrary data which
can be passed into and out of a function by pointer. They are also useful for