This is bigloo.info, produced by makeinfo version 4.5 from bigloo.texi.

  This file documents Bigloo, an implementation of an extended version
of the Scheme programming language.

  Copyright (C) 1992-99, 2000-02 Manuel Serrano

     This program is free software; you can redistribute it
     and/or modify it under the terms of the GNU General Public
     License as published by the Free Software Foundation; either
     version 2 of the License, or (at your option) any later version.
     
     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
     
     You should have received a copy of the GNU General Public
     License along with this program; if not, write to the Free
     Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
     MA 02111-1307, USA.

INFO-DIR-SECTION The Algorithmic Language Scheme
START-INFO-DIR-ENTRY
* bigloo: (bigloo).            The Bigloo Scheme compiler
END-INFO-DIR-ENTRY


File: bigloo.info,  Node: Equivalence Predicates,  Next: Pairs And Lists,  Prev: Booleans,  Up: Scheme Library

Equivalence predicates
----------------------

 - procedure: eqv? obj1 obj2
 - procedure: eq? obj1 obj2
     `eqv?' and `eq?' are equivalent in Bigloo.

          (eq? 'a 'a)                            =>  #t
          (eq? '(a) '(a))                        =>  _unspecified_
          (eq? (list 'a) (list 'a))              =>  #f
          (eq? "a" "a")                          =>  _unspecified_
          (eq? "" "")                            =>  _unspecified_
          (eq? '() '())                          =>  #t
          (eq? 2 2)                              =>  _unspecified_
          (eq? #\A #\A)                          =>  _unspecified_
          (eq? car car)                          =>  #t
          (let ((n (+ 2 3)))
            (eq? n n))                           =>  _unspecified_
          (let ((x '(a)))
            (eq? x x))                           =>  #t
          (let ((x '#()))
            (eq? x x))                           =>  #t
          (let ((p (lambda (x) x)))
            (eq? p p))                           =>  #t

     Since Bigloo implements `eqv?' as `eq?', the behavior is not
     always conforming to R5RS.
          (eqv? 'a 'a)                           =>  #t
          (eqv? 'a 'b)                           =>  #f
          (eqv? 2 2)                             =>  #t
          (eqv? '() '())                         =>  #t
          (eqv? 100000000 100000000)             =>  #t
          (eqv? (cons 1 2) (cons 1 2))           =>  #f
          (eqv? (lambda () 1)
                (lambda () 2))                   =>  #f
          (eqv? #f 'nil)                         =>  #f
          (let ((p (lambda (x) x)))
            (eqv? p p))                          =>  _unspecified_

     The following examples illustrate cases in which the above rules do
     not fully specify the behavior of `eqv?'.  All that can be said
     about such cases is that the value returned by `eqv?' must be a
     boolean.

          (eqv? "" "")                           =>  _unspecified_
          (eqv? '#() '#())                       =>  _unspecified_
          (eqv? (lambda (x) x)
                (lambda (x) x))                  =>  _unspecified_
          (eqv? (lambda (x) x)
                (lambda (y) y))                  =>  _unspecified_
          
          (define gen-counter
            (lambda ()
              (let ((n 0))
                (lambda () (set! n (+ n 1)) n))))
          (let ((g (gen-counter)))
            (eqv? g g))                          =>  #t
          (eqv? (gen-counter) (gen-counter))
                                                 =>  #f
          (define gen-loser
            (lambda ()
              (let ((n 0))
                (lambda () (set! n (+ n 1)) 27))))
          (let ((g (gen-loser)))
            (eqv? g g))                          =>  #t
          (eqv? (gen-loser) (gen-loser))
                                                 =>  _unspecified_
          
          (letrec ((f (lambda () (if (eqv? f g) 'both 'f)))
                   (g (lambda () (if (eqv? f g) 'both 'g))))
            (eqv? f g))
                                                 =>  _unspecified_
          
          (letrec ((f (lambda () (if (eqv? f g) 'f 'both)))
                   (g (lambda () (if (eqv? f g) 'g 'both))))
            (eqv? f g))
                                                 =>  #f
          (eqv? '(a) '(a))                       =>  _unspecified_
          (eqv? "a" "a")                         =>  _unspecified_
          (eqv? '(b) (cdr '(a b)))               =>  _unspecified_
          (let ((x '(a)))
            (eqv? x x))                          =>  #t


 - library procedure: equal? obj1 obj2
          (equal? 'a 'a)                         =>  #t
          (equal? '(a) '(a))                     =>  #t
          (equal? '(a (b) c)
                  '(a (b) c))                    =>  #t
          (equal? "abc" "abc")                   =>  #t
          (equal? 2 2)                           =>  #t
          (equal? (make-vector 5 'a)
                  (make-vector 5 'a))            =>  #t
          (equal? (lambda (x) x)
                  (lambda (y) y))                =>  _unspecified_

  *Note r5rs.info: (R5RS)Equivalence predicates, for more details.


File: bigloo.info,  Node: Pairs And Lists,  Next: Symbols,  Prev: Equivalence Predicates,  Up: Scheme Library

Pairs and lists
---------------

  The form `()' is _illegal_.

 - procedure: pair? obj

 - bigloo procedure: pair-or-null? obj
     Returns `#t' if OBJ is either a pair or the empty list. Otherwise
     it returns `#f'.

 - procedure: car pair
 - procedure: cdr pair
 - procedure: set-car! pair obj
 - procedure: set-cdr! pair obj

 - library procedure: caar pair
 - library procedure: cadr pair
     ...

 - library procedure: cdddar pair
 - library procedure: cddddr pair

 - library procedure: null? obj
 - library procedure: list? obj
 - library procedure: list obj ...
 - library procedure: length list
 - library procedure: append list ...
 - bigloo procedure: append! list ...
     A destructive append.

 - library procedure: reverse list
 - bigloo procedure: reverse! list
     A destructive reverse.

 - library procedure: list-ref list k
 - library procedure: list-tail list k
     Returns the sublist of LIST obtained by omitting the first K
     elements.

 - bigloo procedure: last-pair list
     Returns the last pair in the nonempty, possibly improper, LIST.

 - library procedure: memq obj list
 - library procedure: memv obj list
 - library procedure: member obj list
 - library procedure: assq obj alist
 - library procedure: assv obj alist
 - library procedure: assoc obj alist
 - bigloo procedure: remq obj list
     Returns a new list which is a copy of LIST with all items `eq?' to
     OBJ removed from it.

 - bigloo procedure: remq! obj list
     Same as `remq' but in a destructive way.

 - bigloo procedure: delete obj list
     Returns a new list which is a copy of LIST with all items `equal?'
     to OBJ deleted from it.

 - bigloo procedure: delete! obj list
     Same as `delete' but in a destructive way.

 - bigloo procedure: cons* obj ...
     Returns an object formed by consing all arguments together from
     right to left.  If only one OBJ is supplied, that OBJ is returned.

 - bigloo procedure: every? pred clist1 clist2 ...
     Applies the predicate across the lists, returning true if the
     predicate returns true on every application.

          (every < '(1 2 3) '(2 3 4))            => #t
          (every < '(1 2 3) '(2 3 0))            => #f

 - bigloo procedure: any? pred clist1 clist2 ...
     Applies the predicate across the lists, returning true if the
     predicate returns true for at least one application.

          (any < '(1 2 3) '(2 3 4))            => #t
          (any < '(1 2 3) '(2 3 0))            => #t

 - bigloo procedure: every fun clist1 clist2 ...
     Applies the function FUN across the lists, returning the last
     non-false if the function returns non-false on every application.
     If non-false, the result of `every' is the last value returned by
     the last application of FUN.

          (every < '(1 2 3) '(2 3 4))            => #t
          (every < '(1 2 3) '(2 3 0))            => #f

 - bigloo procedure: any fun clist1 clist2 ...
     Applies the function FUN across the lists, returning non-false if
     the function returns non-false for at least one application. If
     non-false, the result of `any' is the first non-false value
     returned by FUN.

          (any < '(1 2 3) '(2 3 4))            => #t
          (any < '(1 2 3) '(2 3 0))            => #t

 - bigloo procedure: make-list n [fill]
     Returns an N-element list, whose elements are all the value FILL.
     If the FILL argument is not given, the elements of the list may be
     arbitrary values.

          (make-list 4 'c)                     => (c c c c)

 - bigloo procedure: list-tabulate n init-proc
     Returns an N-element list. Element i of the list, where 0 <= i <
     N, is produced by `(init-proc i)'. No guarantee is made about the
     dynamic order in which INIT-PROC is applied to these indices.

          (list-tabulate 4 values) => (0 1 2 3)

 - bigloo procedure: iota count [start step]
     Returns a list containing the elements

          (start start+step ... start+(count-1)*step)

     The START and STEP parameters default to `0' and `1',
     respectively. This procedure takes its name from the APL primitive.

          (iota 5) => (0 1 2 3 4)
          (iota 5 0 -0.1) => (0 -0.1 -0.2 -0.3 -0.4)

  *Note r5rs.info: (R5RS)Pairs and lists, for more details.


File: bigloo.info,  Node: Symbols,  Next: Keywords,  Prev: Pairs And Lists,  Up: Scheme Library

Symbols
-------

  Symbols are case sensitive and the reader is case sensitive too. So:
     (eq? 'foo 'FOO) => #f
     (eq? (string->symbol "foo") (string->symbol "FOO")) => #f

  Symbols may contain special characters (such as #\Newline or #\Space).
Such symbols that have to be read must be written: `|[^]+|'. The
function `write' uses that notation when it encounters symbols
containing special characters.

     (write 'foo) => foo
     (write 'Foo) =>Foo
     (write '|foo bar|) => |foo bar|

 - procedure: symbol? obj
 - procedure: symbol->string symbol
     Returns the name of the symbol as a string. Modifying the string
     result of `symbol->string' could yield incoherent programs. It is
     better to copy the string before any physical update. For
     instance, don't write:
          (string-downcase! (symbol->string 'foo))

     *Note r5rs.info: (R5RS)Symbols, for more details.

     but prefer:
          (string-downcase (symbol->string 'foo))

 - procedure: string->symbol string
 - bigloo procedure: string->symbol-ci string
 - bigloo procedure: symbol-append symbol ...
     `String->symbol' returns a symbol whose name is STRING.
     `String->symbol' respects the case of STRING.  `String->symbol-ci'
     returns a symbol whose name is `(string-upcase STRING)'.
     `Symbol-append' returns a symbol whose name is the concatenation
     of all the SYMBOL's names.

 - bigloo procedure: gensym [obj]
     Returns a new fresh symbol. If OBJ is provided and is a string or
     a symbol, it is used as prefix for the new symbol.

 - bigloo procedure: symbol-plist symbol-or-keyword
     Returns the property-list associated with SYMBOL-OR-KEYWORD.

 - bigloo procedure: getprop symbol-or-keyword key
     Returns the value that has the key `eq?' to KEY from the
     SYMBOL-OR-KEYWORD's property list. If there is no value associated
     with KEY then `#f' is returned.

 - bigloo procedure: putprop! symbol-or-keyword key val
     Stores VAL using KEY on SYMBOL-OR-KEYWORD's property list.

 - bigloo procedure: remprop! symbol-or-keyword key
     Removes the value associated with KEY in the SYMBOL-OR-KEYWORD's
     property list. The result is unspecified.

  Here is an example of properties handling:

     (getprop 'a-sym 'a-key)       => #f
     (putprop! 'a-sym 'a-key 24)
     (getprop 'a-sym 'a-key)       => 24
     (putprop! 'a-sym 'a-key2 25)
     (getprop 'a-sym 'a-key)       => 24
     (getprop 'a-sym 'a-key2)      => 25
     (symbol-plist 'a-sym)         => (a-key2 25 a-key 24)
     (remprop! 'a-sym 'a-key)
     (symbol-plist 'a-sym)         => (a-key2 25)
     (putprop! 'a-sym 'a-key2 16)
     (symbol-plist 'a-sym)         => (a-key2 16)


File: bigloo.info,  Node: Keywords,  Next: Numbers,  Prev: Symbols,  Up: Scheme Library

Keywords
--------

  Keywords constitute an extension to Scheme required by Dsssl
[Dsssl96].  Keywords syntax is: `<ident>:'

  Keywords are autoquote and case insensitive. So
     (eq? toto: TOTO:) => #t

 - bigloo procedure: keyword? obj
 - bigloo procedure: keyword->string keyword
 - bigloo procedure: string->keyword string


File: bigloo.info,  Node: Numbers,  Next: Characters,  Prev: Keywords,  Up: Scheme Library

Numbers
-------

  Bigloo has only three kinds of numbers: fixnum, long fixnum and
flonum.  Operations on complexes and rationals are not implemented but
for compatibility purposes, the functions `complex?' and `rational?'
exist.  (In fact, `complex?' is the same as `number?' and `rational?'
is the same as `real?' in Bigloo.)  The binary radix is not implemented
so the only accepted prefixes are `#o', `#d' and `#x'. For each generic
arithmetic procedure, Bigloo provides two specialized procedures, one
for fixnums and one for flonums. The names of these two specialized
procedures is the name of the original one suffixed by `fx' or `fl'.  A
fixnum has the size of a C `integer' minus 2 bits.  A flonum has the
size of a C `double'.

 - procedure: number? obj
 - procedure: real? obj
 - procedure: integer? obj
 - bigloo procedure: complex? x
 - bigloo procedure: rational? x

 - bigloo procedure: fixnum? obj
 - bigloo procedure: flonum? obj
     These two procedures are type checkers on types `integer' and
     `real'.

 - bigloo procedure: elong? obj
 - bigloo procedure: llong? obj
     The `elong?' procedures is a type checker for "hardware" integers,
     that is integers that have the very same size has the host
     platform permits (e.g., 32 bits or 64 bits integers). The `llong?'
     procedure is a type checker for "hardware" long long integers.

 - bigloo procedure: make-elong int
     Create an exact fixnum integer from the fixnum value INT.

 - procedure: exact? z
 - procedure: inexact? z

 - library procedure: zero? z
 - library procedure: positive? z
 - library procedure: negative? z
 - library procedure: odd? n
 - library procedure: even? n

 - library procedure: max x1 x2 ...
 - library procedure: min x1 x2 ...

 - procedure: = z1 z2 z3 ...
 - bigloo procedure: =fx i1 i2
 - bigloo procedure: =fl r1 r2
 - procedure: < z1 z2 z3 ...
 - bigloo procedure: <fx i1 i2
 - bigloo procedure: <fl r1 r2
 - procedure: > z1 z2 z3 ...
 - bigloo procedure: >fx i1 i2
 - bigloo procedure: >fl r1 r2
 - procedure: <= z1 z2 z3 ...
 - bigloo procedure: <=fx i1 i2
 - bigloo procedure: <=fl r1 r2
 - procedure: >= z1 z2 z3 ...
 - bigloo procedure: >=fx i1 i2
 - bigloo procedure: >=fl r1 r2

 - procedure: + z ...
 - bigloo procedure: +fx i1 i2
 - bigloo procedure: +fl r1 r2
 - procedure: * z ...
 - bigloo procedure: *fx i1 i2
 - bigloo procedure: *fl r1 r2
 - procedure: - z
 - procedure: - z1 z2 ...
 - bigloo procedure: -fx i1 i2
 - bigloo procedure: -fl r1 r2
 - bigloo procedure: negfx i
 - bigloo procedure: negfl r
     These two functions implement the unary function `-'.

 - procedure: / z1 z2
 - procedure: / z1 z2 ...
 - bigloo procedure: /fx i1 i2
 - bigloo procedure: /fl r1 r2

 - library procedure: abs z
 - procedure: quotient z1 z2
 - procedure: remainder z1 z2
 - procedure: modulo z1 z2
 - procedure: gcd z ...
 - procedure: lcm z ...
 - procedure: floor z
 - procedure: ceiling z
 - procedure: truncate z
 - procedure: round z

 - procedure: exp z
 - procedure: log z
 - procedure: sin z
 - procedure: cos z
 - procedure: tan z
 - procedure: asin z
 - procedure: acos z
 - procedure: atan z1 z2
 - procedure: sqrt z
 - procedure: expt z1 x2

 - procedure: exact->inexact z
 - procedure: inexact->exact z
 - procedure: number->string z
 - bigloo procedure: integer->string i
 - bigloo procedure: integer->string i radix
 - bigloo procedure: elong->string i
 - bigloo procedure: elong->string i radix
 - bigloo procedure: llong->string i
 - bigloo procedure: llong->string i radix
 - bigloo procedure: real->string z

 - procedure: string->number string
 - procedure: string->number string radix
 - procedure: string->elong string radix
 - procedure: string->llong string radix
     Bigloo implements a restricted version of `string->number'. If
     STRING denotes a floating point number then, the only radix `10'
     may be send to `string->number'. That is:

          (string->number "1243" 16)          => 4675
          (string->number "1243.0" 16)        -|
          # *** ERROR:bigloo:string->number
          # Only radix `10' is legal for floating point number -- 16
          (string->elong "234456353")         => #e234456353

     In addition, `string->number' does not support radix encoded inside
     STRING. That is:

          (string->number "#x1243")          => #f

 - bigloo procedure: string->integer string
 - bigloo procedure: string->integer string radix
 - bigloo procedure: string->real string
 - bigloo procedure: fixnum->flonum i
 - bigloo procedure: flonum->fixnum r
 - bigloo procedure: elong->flonum i
 - bigloo procedure: flonum->elong r
 - bigloo procedure: llong->flonum i
 - bigloo procedure: flonum->llong r
     These last procedures implement the natural translation from
     fixnum to flonum and vice versa.

  *Note r5rs.info: (R5RS)Numerical operations, for more details.


File: bigloo.info,  Node: Characters,  Next: UCS-2 Characters,  Prev: Numbers,  Up: Scheme Library

Characters
----------

  Bigloo knows one more named character `#\tab' in addition to the
`#\space' and `#\newline' of R5RS.

  A new alternate syntax exists for characters: `#a<ascii-code>' where
`<ascii-code>' is the three digit decimal ascii number of the character
to be read. Thus, for instance, the character `#\space' can be written
`#a032'.

 - procedure: char? obj

 - procedure: char=? char1 char2
 - procedure: char<? char1 char2
 - procedure: char>? char1 char2
 - procedure: char<=? char1 char2
 - procedure: char>=? char1 char2
 - library procedure: char-ci=? char1 char2
 - library procedure: char-ci<? char1 char2
 - library procedure: char-ci>? char1 char2
 - library procedure: char-ci<=? char1 char2
 - library procedure: char-ci>=? char1 char2

 - library procedure: char-alphabetic? char
 - library procedure: char-numeric? char
 - library procedure: char-whitespace? char
 - library procedure: char-upper-case? char
 - library procedure: char-lower-case? char

 - procedure: char->integer char
 - procedure: integer->char i

 - library procedure: char-upcase char
 - library procedure: char-downcase char


File: bigloo.info,  Node: UCS-2 Characters,  Next: Strings,  Prev: Characters,  Up: Scheme Library

UCS-2 Characters
----------------

  UCS-2 Characters are two byte encoded characters. They can be read
with the syntax: `#u<unicode>' where `<unicode>' is the four digit
hexadecimal unicode value of the character to be read. Thus, for
instance, the character `#\space' can be written `#u0020'.

 - bigloo procedure: ucs2? obj

 - bigloo procedure: ucs2=? ucs2a ucs2b
 - bigloo procedure: ucs2<? ucs2a ucs2b
 - bigloo procedure: ucs2>? ucs2a ucs2b
 - bigloo procedure: ucs2<=? ucs2a ucs2b
 - bigloo procedure: ucs2>=? ucs2a ucs2b
 - bigloo procedure: ucs2-ci=? ucs2a ucs2b
 - bigloo procedure: ucs2-ci<? ucs2a ucs2b
 - bigloo procedure: ucs2-ci>? ucs2a ucs2b
 - bigloo procedure: ucs2-ci<=? ucs2a ucs2b
 - bigloo procedure: ucs2-ci>=? ucs2a ucs2b

 - bigloo procedure: ucs2-alphabetic? ucs2
 - bigloo procedure: ucs2-numeric? ucs2
 - bigloo procedure: ucs2-whitespace? ucs2
 - bigloo procedure: ucs2-upper-case? ucs2
 - bigloo procedure: ucs2-lower-case? ucs2

 - bigloo procedure: ucs2->integer ucs2
 - bigloo procedure: integer->ucs2 i

 - bigloo procedure: ucs2->char ucs2
 - bigloo procedure: char->ucs2 char

 - bigloo procedure: ucs2-upcase ucs2
 - bigloo procedure: ucs2-downcase ucs2


File: bigloo.info,  Node: Strings,  Next: Unicode (UCS-2) Strings,  Prev: UCS-2 Characters,  Up: Scheme Library

Strings
-------

  There are three different syntaxes for strings in Bigloo: traditional,
foreign or Unicode. The traditional syntax for strings may conform to
the Revised Report, see *Note r5rs.info: (R5RS)Lexical structure.  With
the foreign syntax, C escape sequences are interpreted as specified by
ISO-C. In addition, Bigloo's reader evaluate `\x??' sequence as an
hexadecimal escape character. For Unicode syntax, see *Note Unicode
(UCS-2) Strings::. Only the reader distinguishes between these three
appearances of strings; i.e., there is only one type of string at
evaluation-time. The regular expression describing the syntax for
foreign string is: `#"([^"]|\")*"'.

 - variable: *bigloo-strict-r5rs-strings*
     Traditional syntax conforms to the Revised Report if the variable
     `*bigloo-strict-r5rs-strings*' is not `#f'. Otherwise constant
     strings specified by the `"([^"]|\")*"' are considered as foreign
     strings.

     For example, after reading the expression `"1\n23\t4\"5"', the
     following string is built, which is equal to `(string #\1 #\n #\2
     #\3 #\t #\4 #\" #\5)' if `*bigloo-strict-r5rs-strings*' is not
     `#f'. It is `(string #\1 #\n #\2 #\3 #\tab #\4 #\" #\5)' otherwise.

     Printing this string will produce: `1n23t4"5'.

     The new foreign syntax allows C escape sequences to be recognized.
     For example, the expression `#"1\n23\t4\"5"' builds a string equal
     to:

     `(string #\1 #\newline #\2 #\3 #\t #\4 #\" #\5)'

     and printing this string will then produce:
          1
          23    4"5

  The library functions for string processing are:

 - procedure: string? obj

 - procedure: make-string k
 - procedure: make-string k char
 - library procedure: string char ...

 - procedure: string-length string
 - procedure: string-ref string k
 - procedure: string-set! string k char

 - library procedure: string=? string1 string2
 - bigloo procedure: substring=? string1 string2 len
     This function returns `#t' if STRING1 and STRING2 have a common
     prefix of size LEN.

          (substring=? "abcdef" "ab9989898" 2)
             => #t
          (substring=? "abcdef" "ab9989898" 3)
             => #f

 - library procedure: string-ci=? string1 string2
 - library procedure: string<? string1 string2
 - library procedure: string>? string1 string2
 - library procedure: string<=? string1 string2
 - library procedure: string>=? string1 string2
 - library procedure: string-ci<? string1 string2
 - library procedure: string-ci>? string1 string2
 - library procedure: string-ci<=? string1 string2
 - library procedure: string-ci>=? string1 string2

 - bigloo procedure: string-compare3 string1 string2
 - bigloo procedure: string-compare3-ci string1 string2
     This function compares STRING1 and STRING2. It returns a negative
     integer if STRING1 < STRING2. It returns zero if the STRING1 equal
     STRING2. It returns a positive integer if STRING1 > STRING2.

 - library procedure: substring string start end
     STRING must be a string, and START and END must be exact integers
     satisfying:

            0 <= START <= END <= (string-length STRING)

     `substring' returns a newly allocated string formed from the
     characters of STRING beginning with index START (inclusive) and
     ending with index END (exclusive).

          (substring "abcdef" 0 5)
             => "abcde"
          (substring "abcdef" 1 5)
             => "bcde"

 - library procedure: string-shrink! string end
     STRING must be a string, and END must be an exact integers
     satisfying:

            0 <= END <= (string-length STRING)

     `string-shrink!' returns a newly allocated string formed from the
     characters of STRING beginning with index 0 (inclusive) and ending
     with index END (exclusive). As much as possible `string-shrink!'
     changes the argument STRING. That is, as much as possible, and for
     the back-ends that enable it, STRING-SHRINK!  operate a side
     effect on its argument.

          (let ((s (string #\a #\b #\c #\d #\e)))
             (set! s (string-shrink! s 3))
             s)
             => "abc"

 - library procedure: string-append string ...
 - library procedure: string->list string
 - library procedure: list->string list
 - library procedure: string-copy string

 - bigloo procedure: string-fill! string char
     Stores CHAR in every element of the given STRING and returns an
     unspecified value.

 - bigloo procedure: string-downcase string
     Returns a newly allocated version of string where each upper case
     letter is replaced by its lower case equivalent.

 - bigloo procedure: string-upcase string
     Returns a newly allocated version of string where each lower case
     letter is replaced by its upper case equivalent.

 - bigloo procedure: string-capitalize string
     Builds a newly allocated capitalized string.

 - bigloo procedure: string-downcase! string
     Physically downcases the STRING argument.

 - bigloo procedure: string-upcase! string
     Physically upcases the STRING argument.

 - bigloo procedure: string-capitalize! string
     Physically capitalized the STRING argument.

 - bigloo procedure: string-for-read string
     Returns a copy of STRING with each special character replaced by
     an escape sequence.

 - bigloo procedure: blit-string! string1 o1 string2 o2 len
     Fill string S2 starting at position O2 with LEN characters taken
     out of string S1 from position O1.

          (let ((s (make-string 20 #\-)))
          	(blit-string! "toto" 0 s 16 4)
          	s)
             => "----------------toto"


File: bigloo.info,  Node: Unicode (UCS-2) Strings,  Next: Vectors,  Prev: Strings,  Up: Scheme Library

Unicode (UCS-2) Strings
-----------------------

  UCS-2 strings cannot be read by the standard reader but UTF-8 strings
can. The special syntax for UTF-8 is described by the regular
expression: `#u"([^]|\")*"'.

  The library functions for Unicode string processing are:

 - bigloo procedure: ucs2-string? obj

 - bigloo procedure: make-ucs2-string k
 - bigloo procedure: make-ucs2-string k char
 - bigloo procedure: ucs2-string k ...

 - bigloo procedure: ucs2-string-length s-ucs2
 - bigloo procedure: ucs2-string-ref s-ucs2 k
 - bigloo procedure: ucs2-string-set! s-ucs2 k char

 - bigloo procedure: ucs2-string=? s-ucs2a s-ucs2b
 - bigloo procedure: ucs2-string-ci=? s-ucs2a s-ucs2b
 - bigloo procedure: ucs2-string<? s-ucs2a s-ucs2b
 - bigloo procedure: ucs2-string>? s-ucs2a s-ucs2b
 - bigloo procedure: ucs2-string<=? s-ucs2a s-ucs2b
 - bigloo procedure: ucs2-string>=? s-ucs2a s-ucs2b
 - bigloo procedure: ucs2-string-ci<? s-ucs2a s-ucs2b
 - bigloo procedure: ucs2-string-ci>? s-ucs2a s-ucs2b
 - bigloo procedure: ucs2-string-ci<=? s-ucs2a s-ucs2b
 - bigloo procedure: ucs2-string-ci>=? s-ucs2a s-ucs2b

 - bigloo procedure: subucs2-string s-ucs2 start end
 - bigloo procedure: ucs2-string-append s-ucs2 ...
 - bigloo procedure: ucs2-string->list s-ucs2
 - bigloo procedure: list->ucs2-string chars
 - bigloo procedure: ucs2-string-copy s-ucs2

 - bigloo procedure: ucs2-string-fill! s-ucs2 char
     Stores CHAR in every element of the given s-ucs2 and returns an
     unspecified value.

 - bigloo procedure: ucs2-string-downcase s-ucs2
     Builds a newly allocated ucs2-string with lower case letters.

 - bigloo procedure: ucs2-string-upcase s-ucs2
     Builds a new allocated ucs2-string with upper case letters.

 - bigloo procedure: ucs2-string-downcase! s-ucs2
     Physically downcases the S-UCS2 argument.

 - bigloo procedure: ucs2-string-upcase! s-ucs2
     Physically upcases the S-UCS2 argument.

 - bigloo procedure: ucs2-string->utf8-string s-ucs2
 - bigloo procedure: utf8-string->ucs2-string STRING
     Convert UCS-2 strings to (or from) UTF-8 encoded ascii strings.


File: bigloo.info,  Node: Vectors,  Next: Control Features,  Prev: Unicode (UCS-2) Strings,  Up: Scheme Library

Vectors
-------

  Vectors are not autoquoted objects.

 - procedure: vector? obj

 - procedure: make-vector k
 - procedure: make-vector k obj
 - library procedure: vector obj ...

 - procedure: vector-length vector
 - procedure: vector-ref vector k
 - procedure: vector-set! vector k obj

 - library procedure: vector->list vector
 - library procedure: list->vector list

 - library procedure: vector-fill! vector obj
     Stores  OBJ in every element of VECTOR. For instance:

          (let ((v (make-vector 5 #f)))
             (vector-fill! v #t)
             v)

 - bigloo procedure: copy-vector vector len
     Allocate a new vector of size LEN and fills it with the first LEN
     element of VECTOR. The new length LEN might be bigger than the old
     vector length.

 - bigloo procedure: vector-copy vector start end
     VECTOR must be a vector, and START and END must be exact integers
     satisfying:

            0 <= START <= END <= (vector-length VECTOR)

     `vector-copy' returns a newly allocated vector formed from the
     elements of VECTOR beginning with index START (inclusive) and
     ending with index END (exclusive).

          (vector-copy '#(1 2 3 4) 0 4)
             => '#(1 2 3 4)
          (vector-copy '#(1 2 3 4) 1 3)
             => '#(2 3)

  *Note r5rs.info: Vectors, for more details.


File: bigloo.info,  Node: Control Features,  Prev: Vectors,  Up: Scheme Library

Control features
----------------

 - procedure: procedure? obj

 - procedure: apply proc arg1 ... args

 - library procedure: map proc list1 list2 ...
 - library procedure: for-each proc list1 list2 ...

 - library procedure: filter pred list ...
 - library procedure: filter! pred list ...
     Strip out all elements of LIST for which the predicate PRED is not
     true. The second version `filter!' is destructive:

          (filter number? '(1 2 #\a "foo" foo 3)) => (1 2 3)
          (let ((l (list 1 2 #\a "foo" 'foo 3)))
             (set! l (filter! number? l))
             l)                                   => (1 2 3)


 - bigloo procedure: sort obj proc
     Sorts OBJ according to PROC test. The argument OBJ can either be a
     vector or a list. In either case, a copy of the argument is
     returned. For instance:

          (let ((l '(("foo" 5) ("bar" 6) ("hux" 1) ("gee" 4))))
             (sort l (lambda (x y) (string<? (car x) (car y)))))
             => ((bar 6) (foo 5) (gee 4) (hux 1))

 - library procedure: force promise

 - bigloo procedure: call/cc proc
     This function is the same as the `call-with-current-continuation'
     function of the R5RS, see *Note r5rs.info:
     (R5RS)call-with-current-continuation, but it is necessary to
     compile the module with the `-call/cc' option to use it, see
     Section *Note The Bigloo command line: Compiler Description.

     Note: Since `call/cc' is difficult to compile efficiently, one
     might consider using `bind-exit' instead.  For this reason, we
     decided to enable `call/cc' only with a compiler option.

 - bigloo syntax: bind-exit escape body
     This form provides an escape operator facility. `bind-exit'
     evaluates the BODY, which may refer to the variable ESCAPE which
     will denote an "escape function" of one argument: when called,
     this escape function will return from the `bind-exit' form with
     the given argument as the value of the `bind-exit' form. The
     ESCAPE can only be used while in the dynamic extent of the form.
     Bindings introduced by `bind-exit' are immutable.

          (bind-exit (exit)
           (for-each (lambda (x)
                       (if (negative? x)
                           (exit x)))
                     '(54 0 37 -3 245 19))
           #t)                                  => -3
          
          (define list-length
            (lambda (obj)
              (bind-exit (return)
               (letrec ((r (lambda (obj)
                              (cond ((null? obj) 0)
                                    ((pair? obj)
                                     (+ (r (cdr obj)) 1))
                                    (else (return #f))))))
                    (r obj)))))
          
          (list-length '(1 2 3 4))               => 4
          (list-length '(a b . c))               => #f

 - bigloo syntax: unwind-protect expr protect
     This form provides protections. Expression EXPR is evaluated. If
     this evaluation requires the invocation of an escape procedure (a
     procedure bounded by the `bind-exit' special form), PROTECT is
     evaluated before the control jump to the exit procedure. If EXPR
     does not raise any exit procedure, `unwind-protect' has the same
     behaviour as the `begin' special form except that the value of the
     form is always the value of EXPR.

          (define (my-open f)
             (if (file-exists? f)
                 (let ((port (open-input-file f)))
                    (if (input-port? port)
                        (unwind-protect
                           (bar port)
                           (close-input-port port))))))

 - procedure: dynamic-wind before thunk after
     Calls THUNK without arguments, returning the result(s) of this
     call.  BEFORE and AFTER are called, also without arguments, as
     required by the following rules (note that in the absence of calls
     to continuations captured using `call/cc' the three arguments are
     called once each, in order).  BEFORE is called whenever execution
     enters the dynamic extent of the call to THUNK and AFTER is called
     whenever it exits that dynamic extent.  The dynamic extent of a
     procedure call is the period between when the call is initiated
     and when it returns.  In Scheme, because of `call/cc', the dynamic
     extent of a call may not be a single, connected time period.  It
     is defined as follows:

        * The dynamic extent is entered when execution of the body of
          the called procedure begins.

        * The dynamic extent is also entered when execution is not
          within the dynamic extent and a continuation is invoked that
          was captured (using `call/cc') during the dynamic extent.

        * It is exited when the called procedure returns.

        * It is also exited when execution is within the dynamic extent
          and a continuation is invoked that was captured while not
          within the dynamic extent.


     If a second call to `dynamic-wind' occurs within the dynamic
     extent of the call to THUNK and then a continuation is invoked in
     such a way that the AFTERs from these two invocations of
     `dynamic-wind' are both to be called, then the AFTER associated
     with the second (inner) call to `dynamic-wind' is called first.

     If a second call to `dynamic-wind' occurs within the dynamic
     extent of the call to THUNK and then a continuation is invoked in
     such a way that the BEFOREs from these two invocations of
     `dynamic-wind' are both to be called, then the BEFORE associated
     with the first (outer) call to `dynamic-wind' is called first.

     If invoking a continuation requires calling the BEFORE from one
     call to `dynamic-wind' and the AFTER from another, then the AFTER
     is called first.

     The effect of using a captured continuation to enter or exit the
     dynamic extent of a call to BEFORE or AFTER is undefined.

          (let ((path '())
                (c #f))
            (let ((add (lambda (s)
                         (set! path (cons s path)))))
              (dynamic-wind
                (lambda () (add 'connect))
                (lambda ()
                  (add (call/cc
                         (lambda (c0)
                           (set! c c0)
                           'talk1))))
                (lambda () (add 'disconnect)))
              (if (< (length path) 4)
                  (c 'talk2)
                  (reverse path))))
          
             => (connect talk1 disconnect connect talk2 disconnect)


 - bigloo procedure: unspecified
     Returns the _unspecified_ (noted as `#unspecified') object with no
     specific property.

 - bigloo syntax: try exp handler
     This form is documented in Section *Note Errors and Assertions::.

 - procedure: values obj ...
     Delivers all of its arguments to its continuation.  Except for
     continuations created by the `call-with-values' procedure, all
     continuations take exactly one value.  Values might be defined as
     follows:

          (define (values . things)
            (call/cc
              (lambda (cont) (apply cont things))))


 - procedure: call-with-values producer consumer
     Calls its PRODUCER argument with no values and a continuation
     that, when passed some values, calls the CONSUMER procedure with
     those values as arguments.  The continuation for the call to
     CONSUMER is the continuation of the call to call-with-values.

          (call-with-values (lambda () (values 4 5))
                            (lambda (a b) b))
              => 5
          (call-with-values * -)
              => -1


 - bigloo syntax: multiple-value-bind (var ...) producer exp ...
 - bigloo syntax: receive (var ...) producer exp ...
     Evaluates EXP ... in a environment where VAR ... are bound from
     the evaluation of PRODUCER. The result of PRODUCER must be a call
     to `values' where the number of argument is the number of bound
     variables.
          (define (bar a)
             (values (modulo a 5) (quotient a 5)))
          
          (define (foo a)
             (multiple-value-bind (x y)
                (bar a)
                (print x " " y)))
          
          (foo 354)
             -| 4 70

