(index ("make-callable-alist" 0) ("callable-alist?" 1034) ("make-callable-hash-table" 1216) ("callable-hash-table?" 2300) ("make-callable-list" 2497) ("callable-list?" 2939) ("make-callable-string" 3118) ("callable-string?" 3524) ("make-callable-vector" 3709) ("callable-vector?" 4139))
(def (sig (procedure "(make-callable-alist #!optional (alist '()) #!key (test eqv?))" (id make-callable-alist))) (p "Return a callable alist object.  The initial alist is optional if the " (tt "test") " keyword parameter is not given.") (p "The " (tt "test") " keyword parameter specifies the key comparison procedure (default: " (tt "eqv?") ").") (p "Besides the alist key, the callable alist object accepts the " (tt "default") " keyword parameter, which specifies the default value for when the given key doesn't exist (default: " (tt "#f") ").") (p "Examples:") (highlight scheme "#;1> (use callable-alists)\n#;2> (define symbols (make-callable-alist))\n#;3> symbols\n#<procedure callable-alist>\n#;4> (symbols)\n()\n#;5> (set! (symbols 'foo) 42)\n#;6> (symbols 'foo)\n42\n#;7> (symbols)\n((foo . 42))\n#;8> (define strings (make-callable-alist '() test: equal?))\n#;9> strings\n#<procedure callable-alist>\n#;10> (strings)\n()\n#;11> (set! (strings \"foo\") 42)\n#;12> (strings \"foo\")\n42\n#;13> (strings)\n((\"foo\" . 42))"))
(def (sig (procedure "(callable-alist? obj)" (id callable-alist?))) (p "Type predicate.  Return " (tt "#t") " if " (tt "obj") " is a callable alist or " (tt "#f") " if it is not."))
(def (sig (procedure "(make-callable-hash-table . args)" (id make-callable-hash-table))) (p "Return a callable hash table object.  The initial value is an alist, and it is optional if no other keyword parameter is provided.") (p "All the keyword parameters for " (link "http://wiki.call-cc.org/man/4/Unit%20srfi-69#make-hash-table" ((tt "make-hash-table"))) " are valid for " (tt "make-callable-hash-table") ".") (p "Examples:") (highlight scheme "#;1> (use callable-hash-tables)\n#;2> (define hash-table (make-callable-hash-table))\n#;3> hash-table\n#<procedure callable-hash-table>\n#;4> (hash-table)\n#<hash-table (0)>\n#;5> (set! (hash-table 'foo) 42)\n#;6> (hash-table 'foo)\n42") (highlight scheme "#;1> (use callable-hash-tables)\n#;2> (define hash-table (make-callable-hash-table '((foo . 42) (bar . 0))))\n#;3> (hash-table 'foo)\n42\n#;4> (hash-table 'bar)\n0") (highlight scheme "#;1> (use callable-hash-tables)\n#;2> (define hash-table (make-callable-hash-table '((\"foo\" . 42) (\"bar\" . 0)) test: equal?))\n#;3> (hash-table \"foo\")\n42\n#;4> (hash-table \"bar\")\n0"))
(def (sig (procedure "(callable-hash-table? obj)" (id callable-hash-table?))) (p "Type predicate.  Return " (tt "#t") " if " (tt "obj") " is a callable hash table or " (tt "#f") " if it is not."))
(def (sig (procedure "(make-callable-list . items)" (id make-callable-list))) (p "Return a callable list object.  It accepts an arbitrary number if items.") (p "Example:") (highlight scheme "#;1> (use callable-lists)\n#;2> (define l (make-callable-list \"foo\" \"bar\" \"baz\"))\n#;3> l\n#<procedure callable-list>\n#;4> (l)\n(\"foo\" \"bar\" \"baz\")\n#;5> (l 2)\n\"baz\"\n#;6> (set! (l 1) \"quux\")\n#;7> (l)\n(\"foo\" \"quux\" \"baz\")"))
(def (sig (procedure "(callable-list? obj)" (id callable-list?))) (p "Type predicate.  Return " (tt "#t") " if " (tt "obj") " is a callable list or " (tt "#f") " if it is not."))
(def (sig (procedure "(make-callable-string . chars)" (id make-callable-string))) (p "Return a callable string object.  It accepts an arbitrary number of characters.") (p "Example:") (highlight scheme "#;1> (use callable-strings)\n#;2> (define s (make-callable-string #\\f #\\o #\\o))\n#;3> s\n#<procedure callable-string>\n#;4> (s)\n\"foo\"\n#;5> (s 1)\n#\\o\n#;6> (set! (s 0) #\\d)\n#;7> (s)\n\"doo\""))
(def (sig (procedure "(callable-string? obj)" (id callable-string?))) (p "Type predicate.  Return " (tt "#t") " if " (tt "obj") " is a callable string or " (tt "#f") " if it is not."))
(def (sig (procedure "(make-callable-vector . items)" (id make-callable-vector))) (p "Return a callable vector object.  It accepts an arbitrary number of items.") (p "Example:") (highlight scheme "#;1> (use callable-vectors)\n#;2> (define v (make-callable-vector 'foo \"bar\" 42))\n#;3> v\n#<procedure callable-vector>\n#;4> (v)\n#(foo \"bar\" 42)\n#;5> (v 1)\n\"bar\"\n#;6> (set! (v 1) \"quux\")\n#;7> (v)\n#(foo \"quux\" 42)"))
(def (sig (procedure "(callable-vector? obj)" (id callable-vector?))) (p "Type predicate.  Return " (tt "#t") " if " (tt "obj") " is a callable vector or " (tt "#f") " if it is not."))
