This is misc-extn.egg.info, produced by makeinfo version 4.7 from
eggdoc-output.texi.

INFO-DIR-SECTION The Algorithmic Language Scheme
START-INFO-DIR-ENTRY
* misc-extn.egg: (misc-extn.egg).		Provides miscellaneous useful stuff.
END-INFO-DIR-ENTRY


File: misc-extn.egg.info,  Node: Top,  Next: About this egg,  Up: (dir)

misc-extn egg
*************

Provides miscellaneous useful stuff.

Written by Kon Lovett (mailto:klovett@pacbell.net)

   This manual corresponds to version 1.9 of the misc-extn extension
library for Chicken Scheme.

* Menu:

* About this egg::
* Documentation::
* Contributions::
* Examples::
* License::
* Index::


File: misc-extn.egg.info,  Node: About this egg,  Next: Documentation,  Prev: Top,  Up: Top

1 About this egg
****************

* Menu:

* Version history::
* Usage::


File: misc-extn.egg.info,  Node: Version history,  Next: Usage,  Up: About this egg

1.1 Version history
===================

`1.9'
     Rename ++f* -> f*++, remove mu & nu; me stupid

`1.8'
     Moved procedures to own extension

`1.7'
     Exports, additions

`1.6'
     More stuff, rename fp++, etc -> ++fp

`1.5'
     Added alist-delete-first

`1.4'
     Added mu, nu, moved looping constructs to miscmacros

`1.3'
     Removed use of define-syntax

`1.2'
     Added assure, nl, rename set*! to stiff-set!, fp++, etc.

`1.1'
     Added plain repeat, assoc macros signal errors

`1.0'
     Initial release


File: misc-extn.egg.info,  Node: Usage,  Prev: Version history,  Up: About this egg

1.2 Usage
=========

Load this egg like so:

   `(require-extension misc-extn)'


File: misc-extn.egg.info,  Node: Documentation,  Next: Contributions,  Prev: About this egg,  Up: Top

2 Documentation
***************

To access the procedures do: `(require-extension     	misc-extn-procs)'.

* Menu:

* Record::
* Control::
* Lists::
* Arithmetic::
* Association List::
* Symbol::
* Output::
* Argument List Processing::


File: misc-extn.egg.info,  Node: Record,  Next: Control,  Up: Documentation

2.1 Record
==========

 -- macro: define-unchecked-record-type
          (define-unchecked-record-type T CTOR PRED [SLOT ...]))

     SRFI-9 '(define-record-type T CTOR PRED [SLOT ...])',
     except no checks are made for correct record type before slot
     access, and the record type symbol is not defined.

     For use when slot access is attempted _only_ after
     determining the correct record type explicitly. Do _not_ make
     constructed slot access procedures part of a public 					API.


File: misc-extn.egg.info,  Node: Control,  Next: Lists,  Prev: Record,  Up: Documentation

2.2 Control
===========

 -- macro: errorf
          (errorf [ID] FORMAT ARGS ...)

     Same as '(error [ID] (sprintf FORMAT ARGS ...))'.

 -- macro: swap-set!
          (swap-set! VAR1 VAR2)

     Swap settings of `VAR1' & `VAR2'.

 -- macro: fluid-set!
          (fluid-set! VAR VAL ...)

     Set each variable `VAR' to the value `VAL' in parallel.

 -- macro: stiff-set!
          (stiff-set! VAR VAL ...)

     Set each variable `VAR' to the value `VAL' in series.

 -- macro: (hash-let (([VAR | (VAR KEY)] ...) HASH-TABLE) BODY ...)
     Decompose `HASH-TABLE' entries into variable           bindings.
     Should the `KEY' not be symbol, or the           desired variable
     name `VAR' should not be the key,           the '(VAR KEY)' form
     can be used. The `BODY ...' is           evaluated with the
     specified bindings.

 -- macro: set-op!
          (set-op! VAR OP ARG ...)

     Sets `VAR' to the value `(OP VAR ARG           ...)'.

 -- macro: assure
          (assure EXPRESSION ERROR-ARGUMENT ...)

     When `EXPRESSION' yields `#f' invoke `(error ERROR-ARGUMENT ...)'.


File: misc-extn.egg.info,  Node: Lists,  Next: Arithmetic,  Prev: Control,  Up: Documentation

2.3 Lists
=========

 -- macro: length=0?
          (length=0? LIST)

     List of length zero?

 -- macro: length=1?
          (length=1? LIST)

     List of length one?

 -- macro: length>1?
          (length>1? LIST)

     List of length greater than one?


File: misc-extn.egg.info,  Node: Arithmetic,  Next: Association List,  Prev: Lists,  Up: Documentation

2.4 Arithmetic
==============

 -- macro: ++
          (++ VAL)

     Read-only increment.

 -- macro: -
          (-- VAL)

     Read-only decrement.

 -- macro: fx++
          (fx++ VAL)

     Read-only fixnum increment.

 -- macro: fx-
          (fx-- VAL)

     Read-only fixnum decrement.

 -- macro: fp++
          (fp++ VAL)

     Read-only flonum increment.

 -- macro: fp-
          (fp-- VAL)

     Read-only flonum decrement.

 -- macro: ++!
          (++! VAR)

     Mutable increment.

 -- macro: -!
          (--! VAR)

     Mutable decrement.

 -- macro: fx++!
          (fx++! VAR)

     Mutable fixnum increment.

 -- macro: fx-!
          (fx--! VAR)

     Mutable fixnum decrement.

 -- macro: fp++!
          (fp++! VAR)

     Mutable flonum increment.

 -- macro: fp-!
          (fp--! VAR)

     Mutable flonum decrement.

 -- procedure: make-log-function
          (make-log-function BASE)

     Returns a procedure of one argument, the logarithm
     function for the `BASE'.


File: misc-extn.egg.info,  Node: Association List,  Next: Symbol,  Prev: Arithmetic,  Up: Documentation

2.5 Association List
====================

 -- macro: assoc-def
          (assoc-def KEY ALIST [TEST] [DEFAULT])

     The assoc procedure with an optional test and default
     value. An error is signaled when not found.

 -- macro: assv-def
          (assv-def KEY ALIST [DEFAULT])

     The assv procedure with a default value. An error is
     signaled when not found.

 -- macro: assq-def
          (assq-def KEY ALIST [DEFAULT])

     The assq procedure with a default value. An error is
     signaled when not found.

 -- procedure: alist-inverse-ref
          (alist-inverse-ref VALUE ALIST [EQUALITY? eqv?] [DEFAULT #f])

     Returns the first key associated with `VALUE' in 					the `ALIST' using
     the `EQUALITY?' predicate, 					else `DEFAULT'.

 -- procedure: alist-delete-first
          (alist-delete-first KEY ALIST [EQUALITY? equal?])

     Deletes the first association from alist `ALIST' 					with the given
     key `KEY', using key-comparison 					procedure `EQUALITY?'. The dynamic
     order in which the 					various applications of equality are
     made is from the alist 					head to the tail.

     Return values may share common tails with the alist
     argument. The alist is not disordered - elements that appear 					in
     the result alist occur in the same order as they occur in
     the argument alist.

     The equality procedure is used to compare the element
     keys, 'key[i: 0 <= i < (length ALIST)]', of the alist's
     entries to the key parameter in this way: '(EQUALITY? KEY
     key[i])'.


File: misc-extn.egg.info,  Node: Symbol,  Next: Output,  Prev: Association List,  Up: Documentation

2.6 Symbol
==========

 -- procedure: defined?
          (defined? SYMBOL [ENVIRONMENT interaction-environment])

     Is the `SYMBOL' is defined in the `ENVIRONMENT'?

 -- procedure: make-qualified-symbol
          (make-qualified-symbol NAMESPACE SYMBOL)

     Returns the Chicken namespace qualified `SYMBOL'           for the
     `NAMESPACE'.


File: misc-extn.egg.info,  Node: Output,  Next: Argument List Processing,  Prev: Symbol,  Up: Documentation

2.7 Output
==========

 -- procedure: cout
          (cout EXPR ...)

     Like cout << arguments << args where argument can be any
     Scheme object. If it's a procedure (without args) it's
     executed rather than printed (like newline).

 -- procedure: cerr
          (cerr EXPR ...)

     Like cerr << arguments << args where argument can be any
     Scheme object. If it's a procedure (without args) it's
     executed rather than printed (like newline).

 -- procedure: nl
          (nl)

     Returns a string form of the newline character.

 -- procedure: identify-error
          (identify-error [CALLER] MSG ARGS ...)

     Prints a message like `(error ...)' to `(current-error-port)' but
     does not throw an exception.


File: misc-extn.egg.info,  Node: Argument List Processing,  Prev: Output,  Up: Documentation

2.8 Argument List Processing
============================

 -- procedure: filter-rest-argument
          (filter-rest-argument REST-LIST [PREDICATE])

     Remove any keywords & keyword+value items from a #!rest
     argument list.

     When the optional predicate is supplied & it returns #t       		then
     the item is kept, otherwise the default processing
     occurs.

     The optional predicate takes the current item & a flag
     indicating if the previous item was a keyword.


File: misc-extn.egg.info,  Node: Contributions,  Next: Examples,  Prev: Documentation,  Up: Top

3 Contributions
***************

William Annis - hash-let.

   Oleg Kiselyov's Standard Scheme "Prelude" - ++, ...


File: misc-extn.egg.info,  Node: Examples,  Next: License,  Prev: Contributions,  Up: Top

4 Examples
**********


(use misc-extn)

(hash-let ([name (foo "wow")] some-hashtable)
  (print name " " foo #\newline))

(stiff-set! x 1 y 2)	; x = 1 y = 2
(fluid-set! x y y x)	; x = 2 y = 1
(swap-set! x y)				; x = 1 y = 2


File: misc-extn.egg.info,  Node: License,  Next: Index,  Prev: Examples,  Up: Top

5 License
*********


Copyright (c) 2006, Kon Lovett.  All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the Software),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ASIS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.


File: misc-extn.egg.info,  Node: Index,  Prev: License,  Up: Top

Index
*****

 [index ]
* Menu:

* (hash-let (([VAR | (VAR KEY)] ...) HASH-TABLE) BODY ...): Control.
                                                               (line 27)
* ++:                                    Arithmetic.           (line  7)
* ++!:                                   Arithmetic.           (line 37)
* --:                                    Arithmetic.           (line 12)
* --!:                                   Arithmetic.           (line 42)
* alist-delete-first:                    Association List.     (line 31)
* alist-inverse-ref:                     Association List.     (line 25)
* assoc-def:                             Association List.     (line  7)
* assq-def:                              Association List.     (line 19)
* assure:                                Control.              (line 39)
* assv-def:                              Association List.     (line 13)
* cerr:                                  Output.               (line 14)
* cout:                                  Output.               (line  7)
* define-unchecked-record-type:          Record.               (line  7)
* defined?:                              Symbol.               (line  7)
* errorf:                                Control.              (line  7)
* filter-rest-argument:                  Argument List Processing.
                                                               (line  7)
* fluid-set!:                            Control.              (line 17)
* fp++:                                  Arithmetic.           (line 27)
* fp++!:                                 Arithmetic.           (line 57)
* fp--:                                  Arithmetic.           (line 32)
* fp--!:                                 Arithmetic.           (line 62)
* fx++:                                  Arithmetic.           (line 17)
* fx++!:                                 Arithmetic.           (line 47)
* fx--:                                  Arithmetic.           (line 22)
* fx--!:                                 Arithmetic.           (line 52)
* identify-error:                        Output.               (line 26)
* length=0?:                             Lists.                (line  7)
* length=1?:                             Lists.                (line 12)
* length>1?:                             Lists.                (line 17)
* make-log-function:                     Arithmetic.           (line 67)
* make-qualified-symbol:                 Symbol.               (line 12)
* nl:                                    Output.               (line 21)
* set-op!:                               Control.              (line 34)
* stiff-set!:                            Control.              (line 22)
* swap-set!:                             Control.              (line 12)



Tag Table:
Node: Top249
Node: About this egg641
Node: Version history811
Node: Usage1423
Node: Documentation1591
Node: Record1933
Node: Control2515
Node: Lists3706
Node: Arithmetic4063
Node: Association List5170
Node: Symbol6822
Node: Output7274
Node: Argument List Processing8122
Node: Contributions8708
Node: Examples8923
Node: License9242
Node: Index10423

End Tag Table
