www.delorie.com/gnu/docs/guile/guile_454.html   search  
 
Buy GNU books!


Guile Reference Manual

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

39.5.1 SRFI-4 - Read Syntax

Homogeneous numeric vectors have an external representation (read syntax) similar to normal Scheme vectors, but with an additional tag telling the vector's type.

 
#u16(1 2 3)

denotes a homogeneous numeric vector of three elements, which are the values 1, 2 and 3, represented as 16-bit unsigned integers. Correspondingly,

 
#f64(3.1415 2.71)

denotes a vector of two elements, which are the values 3.1415 and 2.71, represented as floating-point values of 64 bit precision.

Please note that the read syntax for floating-point vectors conflicts with Standard Scheme, because there #f is defined to be the literal false value. That means, that with the loaded SRFI-4 module, it is not possible to enter some list like

 
'(1 #f3)

and hope that it will be parsed as a three-element list with the elements 1, #f and 3. In normal use, this should be no problem, because people tend to terminate tokens sensibly when writing Scheme expressions.


  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003