Thread: [q-lang-cvs] q/doc qdoc.texi,1.142,1.143 version.texi,1.96,1.97
Brought to you by:
agraef
From: Albert G. <ag...@us...> - 2008-01-22 12:41:41
|
Update of /cvsroot/q-lang/q/doc In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv7378 Modified Files: qdoc.texi version.texi Log Message: update documentation Index: qdoc.texi =================================================================== RCS file: /cvsroot/q-lang/q/doc/qdoc.texi,v retrieving revision 1.142 retrieving revision 1.143 diff -C2 -d -r1.142 -r1.143 *** qdoc.texi 18 Jan 2008 11:34:58 -0000 1.142 --- qdoc.texi 22 Jan 2008 12:41:38 -0000 1.143 *************** *** 11148,11160 **** which allow you to treat byte strings as mutable C vectors of signed/unsigned 8/16/32 bit integers or single/double precision floating ! point numbers. The following functions provide read/write access to the ! elements of such C vectors. Note that the given index argument @code{I} ! is interpreted relative to the corresponding element type. Thus, e.g., ! @code{get_int32 B I} returns the @code{I}th 32 bit integer rather than ! the integer at byte offset @code{I}. ! ! NOTE: Integer arguments must fit into machine integers, otherwise these ! operations will fail. Integers passed for floating point arguments will be ! coerced to floating point values automatically. @smallexample --- 11148,11153 ---- which allow you to treat byte strings as mutable C vectors of signed/unsigned 8/16/32 bit integers or single/double precision floating ! point numbers. The following functions provide read/write access to ! elements and slices of such C vectors: @smallexample *************** *** 11168,11171 **** --- 11161,11184 ---- @end smallexample + Note that the given index argument @code{I} is interpreted relative to + the corresponding element type. Thus, e.g., @code{get_int32 B I} returns + the @code{I}th 32 bit integer rather than the integer at byte offset + @code{I}. Also note that integer arguments must fit into machine + integers, otherwise these operations will fail. Integers passed for + floating point arguments will be coerced to floating point values + automatically. + + For the @code{get_xxx} functions, the index parameter may also be a pair + @code{(I,J)} to return a slice of the given byte string instead of a + single element (this works like @code{sub}/@code{bsub}, but interprets + indices relative to the element type). The @code{put_xxx} functions also + accept a byte string instead of an element as input, and will then + overwrite the corresponding slice of the target byte string @code{B} + with the given source byte string @code{X}. Similar to + @code{sub}/@code{bsub}, these variations of + @code{get_xxx}/@code{put_xxx} are ``safe'' in that they automatically + adjust the given indices to fit within the bounds of the target byte + string. + Moreover, the following convenience functions are provided to convert between byte strings and lists of integer/floating point elements. *************** *** 11323,11333 **** In order to facilitate the handling of C vectors of integers and floating point values, as of Q 7.11 @code{clib} offers a number of ! specialized operations which provide direct read/write access to the ! elements of numeric vectors, and allow you to convert between C vectors ! and Q lists of integer or floating point values. These operations are ! all implemented directly in C and will usually be much more efficient ! for manipulating numeric C vectors than the basic byte-oriented ! functions. Moreover, they allow you to modify the elements of a C vector ! in a direct fashion, turning byte strings into a mutable data structure. Different operations are provided to handle vectors of signed or --- 11336,11347 ---- In order to facilitate the handling of C vectors of integers and floating point values, as of Q 7.11 @code{clib} offers a number of ! specialized operations which provide direct read/write access to ! elements and slices of numeric vectors, and allow you to convert between ! C vectors and Q lists of integer or floating point values. These ! operations are all implemented directly in C and will usually be much ! more efficient for manipulating numeric C vectors than the basic ! byte-oriented functions. Moreover, they allow you to modify the elements ! of a C vector in a direct fashion, turning byte strings into a mutable ! data structure. Different operations are provided to handle vectors of signed or *************** *** 11360,11363 **** --- 11374,11395 ---- @end smallexample + Entire slices of byte strings can be retrieved and overwritten as + well. Note that, as with @code{sub}, the indices are adjusted + automatically to stay within the bounds of the target vector. + + @smallexample + ==> put_uint32 B (-2) (uint32_vect [90..94]) + () + + ==> uint32_list B + [92,93,94,103,104,105,106,107,108,109,110] + + ==> uint32_list $ get_uint32 B (-2,3) + [92,93,94,103] + + ==> uint32_list $ get_uint32 B (8,100) + [108,109,110] + @end smallexample + @node Extended File Functions, C-Style Formatted I/O, Byte Strings, Clib @section Extended File Functions Index: version.texi =================================================================== RCS file: /cvsroot/q-lang/q/doc/version.texi,v retrieving revision 1.96 retrieving revision 1.97 diff -C2 -d -r1.96 -r1.97 *** version.texi 18 Jan 2008 11:18:45 -0000 1.96 --- version.texi 22 Jan 2008 12:41:38 -0000 1.97 *************** *** 1,3 **** ! @set UPDATED 18 January 2008 @set UPDATED-MONTH January 2008 @set EDITION 7.11 --- 1,3 ---- ! @set UPDATED 22 January 2008 @set UPDATED-MONTH January 2008 @set EDITION 7.11 |