From 3e9b3635c353d09b26393d5d89cbf1c2d2cb4459 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 12 Jun 2017 19:43:36 -0700 Subject: doc: document bracket notation for carray and buf. * txr.1: Put carray and buf cases into the description of the indexing notation under the dwim operator. --- txr.1 | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/txr.1 b/txr.1 index 530bdba0..08b9c0ce 100644 --- a/txr.1 +++ b/txr.1 @@ -13826,7 +13826,31 @@ If this form is used as a place, then the object must support a .code lambda-set method. - +.meIP >> [ carray << index ] +.meIP >> [ carray << from-index..to-below-index ] +Element and range indexing is possible on object of type +.code carray +which manipulate arrays in a foreign ("C language") representation, +and are closely associated with the Foreign Function Interface (FFI). +Just like in the case of sequences, the semantics of referencing +.code carray +objects with the bracket notation is based on the functions +.codn ref , +.codn refset , +.code sub +and +.codn replace . +These, in turn, rely on the specialized functions. +.codn carray-ref , +.codn carray-refset , +.code carray-sub +and +.codn carray-replace . +.meIP >> [ buf << index ] +Indexing is supported for objects of type +.codn buf . +This provides a way to access and store the individual bytes +of a buffer. .RE .PP -- cgit v1.2.3