Merge branch 'ossau-gds-dev'
[bpt/guile.git] / doc / maint / guile.texi
1
2 \facons
3 @c snarfed from alist.c:36
4 @deffn {Scheme Procedure} acons key value alist
5 @deffnx {C Function} scm_acons (key, value, alist)
6 Add a new key-value pair to @var{alist}. A new pair is
7 created whose car is @var{key} and whose cdr is @var{value}, and the
8 pair is consed onto @var{alist}, and the new list is returned. This
9 function is @emph{not} destructive; @var{alist} is not modified.
10 @end deffn
11
12 \fsloppy-assq
13 @c snarfed from alist.c:50
14 @deffn {Scheme Procedure} sloppy-assq key alist
15 @deffnx {C Function} scm_sloppy_assq (key, alist)
16 Behaves like @code{assq} but does not do any error checking.
17 Recommended only for use in Guile internals.
18 @end deffn
19
20 \fsloppy-assv
21 @c snarfed from alist.c:68
22 @deffn {Scheme Procedure} sloppy-assv key alist
23 @deffnx {C Function} scm_sloppy_assv (key, alist)
24 Behaves like @code{assv} but does not do any error checking.
25 Recommended only for use in Guile internals.
26 @end deffn
27
28 \fsloppy-assoc
29 @c snarfed from alist.c:86
30 @deffn {Scheme Procedure} sloppy-assoc key alist
31 @deffnx {C Function} scm_sloppy_assoc (key, alist)
32 Behaves like @code{assoc} but does not do any error checking.
33 Recommended only for use in Guile internals.
34 @end deffn
35
36 \fassq
37 @c snarfed from alist.c:113
38 @deffn {Scheme Procedure} assq key alist
39 @deffnx {Scheme Procedure} assv key alist
40 @deffnx {Scheme Procedure} assoc key alist
41 @deffnx {C Function} scm_assq (key, alist)
42 Fetch the entry in @var{alist} that is associated with @var{key}. To
43 decide whether the argument @var{key} matches a particular entry in
44 @var{alist}, @code{assq} compares keys with @code{eq?}, @code{assv}
45 uses @code{eqv?} and @code{assoc} uses @code{equal?}. If @var{key}
46 cannot be found in @var{alist} (according to whichever equality
47 predicate is in use), then return @code{#f}. These functions
48 return the entire alist entry found (i.e. both the key and the value).
49 @end deffn
50
51 \fassv
52 @c snarfed from alist.c:134
53 @deffn {Scheme Procedure} assv key alist
54 @deffnx {C Function} scm_assv (key, alist)
55 Behaves like @code{assq} but uses @code{eqv?} for key comparison.
56 @end deffn
57
58 \fassoc
59 @c snarfed from alist.c:155
60 @deffn {Scheme Procedure} assoc key alist
61 @deffnx {C Function} scm_assoc (key, alist)
62 Behaves like @code{assq} but uses @code{equal?} for key comparison.
63 @end deffn
64
65 \fassq-ref
66 @c snarfed from alist.c:199
67 @deffn {Scheme Procedure} assq-ref alist key
68 @deffnx {Scheme Procedure} assv-ref alist key
69 @deffnx {Scheme Procedure} assoc-ref alist key
70 @deffnx {C Function} scm_assq_ref (alist, key)
71 Like @code{assq}, @code{assv} and @code{assoc}, except that only the
72 value associated with @var{key} in @var{alist} is returned. These
73 functions are equivalent to
74
75 @lisp
76 (let ((ent (@var{associator} @var{key} @var{alist})))
77 (and ent (cdr ent)))
78 @end lisp
79
80 where @var{associator} is one of @code{assq}, @code{assv} or @code{assoc}.
81 @end deffn
82
83 \fassv-ref
84 @c snarfed from alist.c:216
85 @deffn {Scheme Procedure} assv-ref alist key
86 @deffnx {C Function} scm_assv_ref (alist, key)
87 Behaves like @code{assq-ref} but uses @code{eqv?} for key comparison.
88 @end deffn
89
90 \fassoc-ref
91 @c snarfed from alist.c:233
92 @deffn {Scheme Procedure} assoc-ref alist key
93 @deffnx {C Function} scm_assoc_ref (alist, key)
94 Behaves like @code{assq-ref} but uses @code{equal?} for key comparison.
95 @end deffn
96
97 \fassq-set!
98 @c snarfed from alist.c:262
99 @deffn {Scheme Procedure} assq-set! alist key val
100 @deffnx {Scheme Procedure} assv-set! alist key value
101 @deffnx {Scheme Procedure} assoc-set! alist key value
102 @deffnx {C Function} scm_assq_set_x (alist, key, val)
103 Reassociate @var{key} in @var{alist} with @var{value}: find any existing
104 @var{alist} entry for @var{key} and associate it with the new
105 @var{value}. If @var{alist} does not contain an entry for @var{key},
106 add a new one. Return the (possibly new) alist.
107
108 These functions do not attempt to verify the structure of @var{alist},
109 and so may cause unusual results if passed an object that is not an
110 association list.
111 @end deffn
112
113 \fassv-set!
114 @c snarfed from alist.c:280
115 @deffn {Scheme Procedure} assv-set! alist key val
116 @deffnx {C Function} scm_assv_set_x (alist, key, val)
117 Behaves like @code{assq-set!} but uses @code{eqv?} for key comparison.
118 @end deffn
119
120 \fassoc-set!
121 @c snarfed from alist.c:298
122 @deffn {Scheme Procedure} assoc-set! alist key val
123 @deffnx {C Function} scm_assoc_set_x (alist, key, val)
124 Behaves like @code{assq-set!} but uses @code{equal?} for key comparison.
125 @end deffn
126
127 \fassq-remove!
128 @c snarfed from alist.c:322
129 @deffn {Scheme Procedure} assq-remove! alist key
130 @deffnx {Scheme Procedure} assv-remove! alist key
131 @deffnx {Scheme Procedure} assoc-remove! alist key
132 @deffnx {C Function} scm_assq_remove_x (alist, key)
133 Delete the first entry in @var{alist} associated with @var{key}, and return
134 the resulting alist.
135 @end deffn
136
137 \fassv-remove!
138 @c snarfed from alist.c:338
139 @deffn {Scheme Procedure} assv-remove! alist key
140 @deffnx {C Function} scm_assv_remove_x (alist, key)
141 Behaves like @code{assq-remove!} but uses @code{eqv?} for key comparison.
142 @end deffn
143
144 \fassoc-remove!
145 @c snarfed from alist.c:354
146 @deffn {Scheme Procedure} assoc-remove! alist key
147 @deffnx {C Function} scm_assoc_remove_x (alist, key)
148 Behaves like @code{assq-remove!} but uses @code{equal?} for key comparison.
149 @end deffn
150
151 \fmake-arbiter
152 @c snarfed from arbiters.c:99
153 @deffn {Scheme Procedure} make-arbiter name
154 @deffnx {C Function} scm_make_arbiter (name)
155 Return an arbiter object, initially unlocked. Currently
156 @var{name} is only used for diagnostic output.
157 @end deffn
158
159 \ftry-arbiter
160 @c snarfed from arbiters.c:116
161 @deffn {Scheme Procedure} try-arbiter arb
162 @deffnx {C Function} scm_try_arbiter (arb)
163 If @var{arb} is unlocked, then lock it and return @code{#t}.
164 If @var{arb} is already locked, then do nothing and return
165 @code{#f}.
166 @end deffn
167
168 \frelease-arbiter
169 @c snarfed from arbiters.c:142
170 @deffn {Scheme Procedure} release-arbiter arb
171 @deffnx {C Function} scm_release_arbiter (arb)
172 If @var{arb} is locked, then unlock it and return @code{#t}.
173 If @var{arb} is already unlocked, then do nothing and return
174 @code{#f}.
175
176 Typical usage is for the thread which locked an arbiter to
177 later release it, but that's not required, any thread can
178 release it.
179 @end deffn
180
181 \fasync
182 @c snarfed from async.c:97
183 @deffn {Scheme Procedure} async thunk
184 @deffnx {C Function} scm_async (thunk)
185 Create a new async for the procedure @var{thunk}.
186 @end deffn
187
188 \fasync-mark
189 @c snarfed from async.c:106
190 @deffn {Scheme Procedure} async-mark a
191 @deffnx {C Function} scm_async_mark (a)
192 Mark the async @var{a} for future execution.
193 @end deffn
194
195 \frun-asyncs
196 @c snarfed from async.c:117
197 @deffn {Scheme Procedure} run-asyncs list_of_a
198 @deffnx {C Function} scm_run_asyncs (list_of_a)
199 Execute all thunks from the asyncs of the list @var{list_of_a}.
200 @end deffn
201
202 \fsystem-async
203 @c snarfed from async.c:180
204 @deffn {Scheme Procedure} system-async thunk
205 @deffnx {C Function} scm_system_async (thunk)
206 This function is deprecated. You can use @var{thunk} directly
207 instead of explicitly creating an async object.
208
209 @end deffn
210
211 \fsystem-async-mark
212 @c snarfed from async.c:296
213 @deffn {Scheme Procedure} system-async-mark proc [thread]
214 @deffnx {C Function} scm_system_async_mark_for_thread (proc, thread)
215 Mark @var{proc} (a procedure with zero arguments) for future execution
216 in @var{thread}. If @var{proc} has already been marked for
217 @var{thread} but has not been executed yet, this call has no effect.
218 If @var{thread} is omitted, the thread that called
219 @code{system-async-mark} is used.
220
221 This procedure is not safe to be called from C signal handlers. Use
222 @code{scm_sigaction} or @code{scm_sigaction_for_thread} to install
223 signal handlers.
224 @end deffn
225
226 \fnoop
227 @c snarfed from async.c:335
228 @deffn {Scheme Procedure} noop . args
229 @deffnx {C Function} scm_noop (args)
230 Do nothing. When called without arguments, return @code{#f},
231 otherwise return the first argument.
232 @end deffn
233
234 \funmask-signals
235 @c snarfed from async.c:350
236 @deffn {Scheme Procedure} unmask-signals
237 @deffnx {C Function} scm_unmask_signals ()
238 Unmask signals. The returned value is not specified.
239 @end deffn
240
241 \fmask-signals
242 @c snarfed from async.c:370
243 @deffn {Scheme Procedure} mask-signals
244 @deffnx {C Function} scm_mask_signals ()
245 Mask signals. The returned value is not specified.
246 @end deffn
247
248 \fcall-with-blocked-asyncs
249 @c snarfed from async.c:404
250 @deffn {Scheme Procedure} call-with-blocked-asyncs proc
251 @deffnx {C Function} scm_call_with_blocked_asyncs (proc)
252 Call @var{proc} with no arguments and block the execution
253 of system asyncs by one level for the current thread while
254 it is running. Return the value returned by @var{proc}.
255
256 @end deffn
257
258 \fcall-with-unblocked-asyncs
259 @c snarfed from async.c:430
260 @deffn {Scheme Procedure} call-with-unblocked-asyncs proc
261 @deffnx {C Function} scm_call_with_unblocked_asyncs (proc)
262 Call @var{proc} with no arguments and unblock the execution
263 of system asyncs by one level for the current thread while
264 it is running. Return the value returned by @var{proc}.
265
266 @end deffn
267
268 \fdisplay-error
269 @c snarfed from backtrace.c:303
270 @deffn {Scheme Procedure} display-error stack port subr message args rest
271 @deffnx {C Function} scm_display_error (stack, port, subr, message, args, rest)
272 Display an error message to the output port @var{port}.
273 @var{stack} is the saved stack for the error, @var{subr} is
274 the name of the procedure in which the error occurred and
275 @var{message} is the actual error message, which may contain
276 formatting instructions. These will format the arguments in
277 the list @var{args} accordingly. @var{rest} is currently
278 ignored.
279 @end deffn
280
281 \fdisplay-application
282 @c snarfed from backtrace.c:425
283 @deffn {Scheme Procedure} display-application frame [port [indent]]
284 @deffnx {C Function} scm_display_application (frame, port, indent)
285 Display a procedure application @var{frame} to the output port
286 @var{port}. @var{indent} specifies the indentation of the
287 output.
288 @end deffn
289
290 \fdisplay-backtrace
291 @c snarfed from backtrace.c:740
292 @deffn {Scheme Procedure} display-backtrace stack port [first [depth [highlights]]]
293 @deffnx {C Function} scm_display_backtrace_with_highlights (stack, port, first, depth, highlights)
294 Display a backtrace to the output port @var{port}. @var{stack}
295 is the stack to take the backtrace from, @var{first} specifies
296 where in the stack to start and @var{depth} how much frames
297 to display. Both @var{first} and @var{depth} can be @code{#f},
298 which means that default values will be used.
299 When @var{highlights} is given,
300 it should be a list and all members of it are highligthed in
301 the backtrace.
302 @end deffn
303
304 \fbacktrace
305 @c snarfed from backtrace.c:776
306 @deffn {Scheme Procedure} backtrace [highlights]
307 @deffnx {C Function} scm_backtrace_with_highlights (highlights)
308 Display a backtrace of the stack saved by the last error
309 to the current output port. When @var{highlights} is given,
310 it should be a list and all members of it are highligthed in
311 the backtrace.
312 @end deffn
313
314 \fnot
315 @c snarfed from boolean.c:33
316 @deffn {Scheme Procedure} not x
317 @deffnx {C Function} scm_not (x)
318 Return @code{#t} iff @var{x} is @code{#f}, else return @code{#f}.
319 @end deffn
320
321 \fboolean?
322 @c snarfed from boolean.c:43
323 @deffn {Scheme Procedure} boolean? obj
324 @deffnx {C Function} scm_boolean_p (obj)
325 Return @code{#t} iff @var{obj} is either @code{#t} or @code{#f}.
326 @end deffn
327
328 \fchar?
329 @c snarfed from chars.c:33
330 @deffn {Scheme Procedure} char? x
331 @deffnx {C Function} scm_char_p (x)
332 Return @code{#t} iff @var{x} is a character, else @code{#f}.
333 @end deffn
334
335 \fchar=?
336 @c snarfed from chars.c:42
337 @deffn {Scheme Procedure} char=? x y
338 Return @code{#t} iff @var{x} is the same character as @var{y}, else @code{#f}.
339 @end deffn
340
341 \fchar<?
342 @c snarfed from chars.c:55
343 @deffn {Scheme Procedure} char<? x y
344 Return @code{#t} iff @var{x} is less than @var{y} in the ASCII sequence,
345 else @code{#f}.
346 @end deffn
347
348 \fchar<=?
349 @c snarfed from chars.c:67
350 @deffn {Scheme Procedure} char<=? x y
351 Return @code{#t} iff @var{x} is less than or equal to @var{y} in the
352 ASCII sequence, else @code{#f}.
353 @end deffn
354
355 \fchar>?
356 @c snarfed from chars.c:79
357 @deffn {Scheme Procedure} char>? x y
358 Return @code{#t} iff @var{x} is greater than @var{y} in the ASCII
359 sequence, else @code{#f}.
360 @end deffn
361
362 \fchar>=?
363 @c snarfed from chars.c:91
364 @deffn {Scheme Procedure} char>=? x y
365 Return @code{#t} iff @var{x} is greater than or equal to @var{y} in the
366 ASCII sequence, else @code{#f}.
367 @end deffn
368
369 \fchar-ci=?
370 @c snarfed from chars.c:103
371 @deffn {Scheme Procedure} char-ci=? x y
372 Return @code{#t} iff @var{x} is the same character as @var{y} ignoring
373 case, else @code{#f}.
374 @end deffn
375
376 \fchar-ci<?
377 @c snarfed from chars.c:115
378 @deffn {Scheme Procedure} char-ci<? x y
379 Return @code{#t} iff @var{x} is less than @var{y} in the ASCII sequence
380 ignoring case, else @code{#f}.
381 @end deffn
382
383 \fchar-ci<=?
384 @c snarfed from chars.c:127
385 @deffn {Scheme Procedure} char-ci<=? x y
386 Return @code{#t} iff @var{x} is less than or equal to @var{y} in the
387 ASCII sequence ignoring case, else @code{#f}.
388 @end deffn
389
390 \fchar-ci>?
391 @c snarfed from chars.c:139
392 @deffn {Scheme Procedure} char-ci>? x y
393 Return @code{#t} iff @var{x} is greater than @var{y} in the ASCII
394 sequence ignoring case, else @code{#f}.
395 @end deffn
396
397 \fchar-ci>=?
398 @c snarfed from chars.c:151
399 @deffn {Scheme Procedure} char-ci>=? x y
400 Return @code{#t} iff @var{x} is greater than or equal to @var{y} in the
401 ASCII sequence ignoring case, else @code{#f}.
402 @end deffn
403
404 \fchar-alphabetic?
405 @c snarfed from chars.c:163
406 @deffn {Scheme Procedure} char-alphabetic? chr
407 @deffnx {C Function} scm_char_alphabetic_p (chr)
408 Return @code{#t} iff @var{chr} is alphabetic, else @code{#f}.
409
410 @end deffn
411
412 \fchar-numeric?
413 @c snarfed from chars.c:172
414 @deffn {Scheme Procedure} char-numeric? chr
415 @deffnx {C Function} scm_char_numeric_p (chr)
416 Return @code{#t} iff @var{chr} is numeric, else @code{#f}.
417
418 @end deffn
419
420 \fchar-whitespace?
421 @c snarfed from chars.c:181
422 @deffn {Scheme Procedure} char-whitespace? chr
423 @deffnx {C Function} scm_char_whitespace_p (chr)
424 Return @code{#t} iff @var{chr} is whitespace, else @code{#f}.
425
426 @end deffn
427
428 \fchar-upper-case?
429 @c snarfed from chars.c:192
430 @deffn {Scheme Procedure} char-upper-case? chr
431 @deffnx {C Function} scm_char_upper_case_p (chr)
432 Return @code{#t} iff @var{chr} is uppercase, else @code{#f}.
433
434 @end deffn
435
436 \fchar-lower-case?
437 @c snarfed from chars.c:202
438 @deffn {Scheme Procedure} char-lower-case? chr
439 @deffnx {C Function} scm_char_lower_case_p (chr)
440 Return @code{#t} iff @var{chr} is lowercase, else @code{#f}.
441
442 @end deffn
443
444 \fchar-is-both?
445 @c snarfed from chars.c:213
446 @deffn {Scheme Procedure} char-is-both? chr
447 @deffnx {C Function} scm_char_is_both_p (chr)
448 Return @code{#t} iff @var{chr} is either uppercase or lowercase, else @code{#f}.
449
450 @end deffn
451
452 \fchar->integer
453 @c snarfed from chars.c:228
454 @deffn {Scheme Procedure} char->integer chr
455 @deffnx {C Function} scm_char_to_integer (chr)
456 Return the number corresponding to ordinal position of @var{chr} in the
457 ASCII sequence.
458 @end deffn
459
460 \finteger->char
461 @c snarfed from chars.c:240
462 @deffn {Scheme Procedure} integer->char n
463 @deffnx {C Function} scm_integer_to_char (n)
464 Return the character at position @var{n} in the ASCII sequence.
465 @end deffn
466
467 \fchar-upcase
468 @c snarfed from chars.c:250
469 @deffn {Scheme Procedure} char-upcase chr
470 @deffnx {C Function} scm_char_upcase (chr)
471 Return the uppercase character version of @var{chr}.
472 @end deffn
473
474 \fchar-downcase
475 @c snarfed from chars.c:261
476 @deffn {Scheme Procedure} char-downcase chr
477 @deffnx {C Function} scm_char_downcase (chr)
478 Return the lowercase character version of @var{chr}.
479 @end deffn
480
481 \fwith-continuation-barrier
482 @c snarfed from continuations.c:412
483 @deffn {Scheme Procedure} with-continuation-barrier proc
484 @deffnx {C Function} scm_with_continuation_barrier (proc)
485 Call @var{proc} and return its result. Do not allow the invocation of
486 continuations that would leave or enter the dynamic extent of the call
487 to @code{with-continuation-barrier}. Such an attempt causes an error
488 to be signaled.
489
490 Throws (such as errors) that are not caught from within @var{proc} are
491 caught by @code{with-continuation-barrier}. In that case, a short
492 message is printed to the current error port and @code{#f} is returned.
493
494 Thus, @code{with-continuation-barrier} returns exactly once.
495
496 @end deffn
497
498 \fdebug-options-interface
499 @c snarfed from debug.c:54
500 @deffn {Scheme Procedure} debug-options-interface [setting]
501 @deffnx {C Function} scm_debug_options (setting)
502 Option interface for the debug options. Instead of using
503 this procedure directly, use the procedures @code{debug-enable},
504 @code{debug-disable}, @code{debug-set!} and @code{debug-options}.
505 @end deffn
506
507 \fwith-traps
508 @c snarfed from debug.c:101
509 @deffn {Scheme Procedure} with-traps thunk
510 @deffnx {C Function} scm_with_traps (thunk)
511 Call @var{thunk} with traps enabled.
512 @end deffn
513
514 \fmemoized?
515 @c snarfed from debug.c:139
516 @deffn {Scheme Procedure} memoized? obj
517 @deffnx {C Function} scm_memoized_p (obj)
518 Return @code{#t} if @var{obj} is memoized.
519 @end deffn
520
521 \funmemoize-expr
522 @c snarfed from debug.c:271
523 @deffn {Scheme Procedure} unmemoize-expr m
524 @deffnx {C Function} scm_i_unmemoize_expr (m)
525 Unmemoize the memoized expression @var{m},
526 @end deffn
527
528 \fmemoized-environment
529 @c snarfed from debug.c:281
530 @deffn {Scheme Procedure} memoized-environment m
531 @deffnx {C Function} scm_memoized_environment (m)
532 Return the environment of the memoized expression @var{m}.
533 @end deffn
534
535 \fprocedure-name
536 @c snarfed from debug.c:291
537 @deffn {Scheme Procedure} procedure-name proc
538 @deffnx {C Function} scm_procedure_name (proc)
539 Return the name of the procedure @var{proc}
540 @end deffn
541
542 \fprocedure-source
543 @c snarfed from debug.c:317
544 @deffn {Scheme Procedure} procedure-source proc
545 @deffnx {C Function} scm_procedure_source (proc)
546 Return the source of the procedure @var{proc}.
547 @end deffn
548
549 \fprocedure-environment
550 @c snarfed from debug.c:374
551 @deffn {Scheme Procedure} procedure-environment proc
552 @deffnx {C Function} scm_procedure_environment (proc)
553 Return the environment of the procedure @var{proc}.
554 @end deffn
555
556 \flocal-eval
557 @c snarfed from debug.c:406
558 @deffn {Scheme Procedure} local-eval exp [env]
559 @deffnx {C Function} scm_local_eval (exp, env)
560 Evaluate @var{exp} in its environment. If @var{env} is supplied,
561 it is the environment in which to evaluate @var{exp}. Otherwise,
562 @var{exp} must be a memoized code object (in which case, its environment
563 is implicit).
564 @end deffn
565
566 \fdebug-object?
567 @c snarfed from debug.c:493
568 @deffn {Scheme Procedure} debug-object? obj
569 @deffnx {C Function} scm_debug_object_p (obj)
570 Return @code{#t} if @var{obj} is a debug object.
571 @end deffn
572
573 \fissue-deprecation-warning
574 @c snarfed from deprecation.c:99
575 @deffn {Scheme Procedure} issue-deprecation-warning . msgs
576 @deffnx {C Function} scm_issue_deprecation_warning (msgs)
577 Output @var{msgs} to @code{(current-error-port)} when this is the first call to @code{issue-deprecation-warning} with this specific @var{msgs}. Do nothing otherwise. The argument @var{msgs} should be a list of strings; they are printed in turn, each one followed by a newline.
578 @end deffn
579
580 \finclude-deprecated-features
581 @c snarfed from deprecation.c:144
582 @deffn {Scheme Procedure} include-deprecated-features
583 @deffnx {C Function} scm_include_deprecated_features ()
584 Return @code{#t} iff deprecated features should be included in public interfaces.
585 @end deffn
586
587 \fsubstring-move-left!
588 @c snarfed from deprecated.c:73
589 @deffn {Scheme Procedure} substring-move-left!
590 implemented by the C function "scm_substring_move_x"
591 @end deffn
592
593 \fsubstring-move-right!
594 @c snarfed from deprecated.c:75
595 @deffn {Scheme Procedure} substring-move-right!
596 implemented by the C function "scm_substring_move_x"
597 @end deffn
598
599 \fc-registered-modules
600 @c snarfed from deprecated.c:178
601 @deffn {Scheme Procedure} c-registered-modules
602 @deffnx {C Function} scm_registered_modules ()
603 Return a list of the object code modules that have been imported into
604 the current Guile process. Each element of the list is a pair whose
605 car is the name of the module, and whose cdr is the function handle
606 for that module's initializer function. The name is the string that
607 has been passed to scm_register_module_xxx.
608 @end deffn
609
610 \fc-clear-registered-modules
611 @c snarfed from deprecated.c:199
612 @deffn {Scheme Procedure} c-clear-registered-modules
613 @deffnx {C Function} scm_clear_registered_modules ()
614 Destroy the list of modules registered with the current Guile process.
615 The return value is unspecified. @strong{Warning:} this function does
616 not actually unlink or deallocate these modules, but only destroys the
617 records of which modules have been loaded. It should therefore be used
618 only by module bookkeeping operations.
619 @end deffn
620
621 \fclose-all-ports-except
622 @c snarfed from deprecated.c:342
623 @deffn {Scheme Procedure} close-all-ports-except . ports
624 @deffnx {C Function} scm_close_all_ports_except (ports)
625 [DEPRECATED] Close all open file ports used by the interpreter
626 except for those supplied as arguments. This procedure
627 was intended to be used before an exec call to close file descriptors
628 which are not needed in the new process. However it has the
629 undesirable side effect of flushing buffers, so it's deprecated.
630 Use port-for-each instead.
631 @end deffn
632
633 \fvariable-set-name-hint!
634 @c snarfed from deprecated.c:359
635 @deffn {Scheme Procedure} variable-set-name-hint! var hint
636 @deffnx {C Function} scm_variable_set_name_hint (var, hint)
637 Do not use this function.
638 @end deffn
639
640 \fbuiltin-variable
641 @c snarfed from deprecated.c:372
642 @deffn {Scheme Procedure} builtin-variable name
643 @deffnx {C Function} scm_builtin_variable (name)
644 Do not use this function.
645 @end deffn
646
647 \fsloppy-memq
648 @c snarfed from deprecated.c:446
649 @deffn {Scheme Procedure} sloppy-memq x lst
650 @deffnx {C Function} scm_sloppy_memq (x, lst)
651 This procedure behaves like @code{memq}, but does no type or error checking.
652 Its use is recommended only in writing Guile internals,
653 not for high-level Scheme programs.
654 @end deffn
655
656 \fsloppy-memv
657 @c snarfed from deprecated.c:466
658 @deffn {Scheme Procedure} sloppy-memv x lst
659 @deffnx {C Function} scm_sloppy_memv (x, lst)
660 This procedure behaves like @code{memv}, but does no type or error checking.
661 Its use is recommended only in writing Guile internals,
662 not for high-level Scheme programs.
663 @end deffn
664
665 \fsloppy-member
666 @c snarfed from deprecated.c:486
667 @deffn {Scheme Procedure} sloppy-member x lst
668 @deffnx {C Function} scm_sloppy_member (x, lst)
669 This procedure behaves like @code{member}, but does no type or error checking.
670 Its use is recommended only in writing Guile internals,
671 not for high-level Scheme programs.
672 @end deffn
673
674 \fread-and-eval!
675 @c snarfed from deprecated.c:508
676 @deffn {Scheme Procedure} read-and-eval! [port]
677 @deffnx {C Function} scm_read_and_eval_x (port)
678 Read a form from @var{port} (standard input by default), and evaluate it
679 (memoizing it in the process) in the top-level environment. If no data
680 is left to be read from @var{port}, an @code{end-of-file} error is
681 signalled.
682 @end deffn
683
684 \fstring->obarray-symbol
685 @c snarfed from deprecated.c:825
686 @deffn {Scheme Procedure} string->obarray-symbol o s [softp]
687 @deffnx {C Function} scm_string_to_obarray_symbol (o, s, softp)
688 Intern a new symbol in @var{obarray}, a symbol table, with name
689 @var{string}.
690
691 If @var{obarray} is @code{#f}, use the default system symbol table. If
692 @var{obarray} is @code{#t}, the symbol should not be interned in any
693 symbol table; merely return the pair (@var{symbol}
694 . @var{#<undefined>}).
695
696 The @var{soft?} argument determines whether new symbol table entries
697 should be created when the specified symbol is not already present in
698 @var{obarray}. If @var{soft?} is specified and is a true value, then
699 new entries should not be added for symbols not already present in the
700 table; instead, simply return @code{#f}.
701 @end deffn
702
703 \fintern-symbol
704 @c snarfed from deprecated.c:863
705 @deffn {Scheme Procedure} intern-symbol o s
706 @deffnx {C Function} scm_intern_symbol (o, s)
707 Add a new symbol to @var{obarray} with name @var{string}, bound to an
708 unspecified initial value. The symbol table is not modified if a symbol
709 with this name is already present.
710 @end deffn
711
712 \funintern-symbol
713 @c snarfed from deprecated.c:905
714 @deffn {Scheme Procedure} unintern-symbol o s
715 @deffnx {C Function} scm_unintern_symbol (o, s)
716 Remove the symbol with name @var{string} from @var{obarray}. This
717 function returns @code{#t} if the symbol was present and @code{#f}
718 otherwise.
719 @end deffn
720
721 \fsymbol-binding
722 @c snarfed from deprecated.c:950
723 @deffn {Scheme Procedure} symbol-binding o s
724 @deffnx {C Function} scm_symbol_binding (o, s)
725 Look up in @var{obarray} the symbol whose name is @var{string}, and
726 return the value to which it is bound. If @var{obarray} is @code{#f},
727 use the global symbol table. If @var{string} is not interned in
728 @var{obarray}, an error is signalled.
729 @end deffn
730
731 \fsymbol-bound?
732 @c snarfed from deprecated.c:1003
733 @deffn {Scheme Procedure} symbol-bound? o s
734 @deffnx {C Function} scm_symbol_bound_p (o, s)
735 Return @code{#t} if @var{obarray} contains a symbol with name
736 @var{string} bound to a defined value. This differs from
737 @var{symbol-interned?} in that the mere mention of a symbol
738 usually causes it to be interned; @code{symbol-bound?}
739 determines whether a symbol has been given any meaningful
740 value.
741 @end deffn
742
743 \fsymbol-set!
744 @c snarfed from deprecated.c:1030
745 @deffn {Scheme Procedure} symbol-set! o s v
746 @deffnx {C Function} scm_symbol_set_x (o, s, v)
747 Find the symbol in @var{obarray} whose name is @var{string}, and rebind
748 it to @var{value}. An error is signalled if @var{string} is not present
749 in @var{obarray}.
750 @end deffn
751
752 \fgentemp
753 @c snarfed from deprecated.c:1063
754 @deffn {Scheme Procedure} gentemp [prefix [obarray]]
755 @deffnx {C Function} scm_gentemp (prefix, obarray)
756 Create a new symbol with a name unique in an obarray.
757 The name is constructed from an optional string @var{prefix}
758 and a counter value. The default prefix is @code{t}. The
759 @var{obarray} is specified as a second optional argument.
760 Default is the system obarray where all normal symbols are
761 interned. The counter is increased by 1 at each
762 call. There is no provision for resetting the counter.
763 @end deffn
764
765 \fmake-keyword-from-dash-symbol
766 @c snarfed from discouraged.c:161
767 @deffn {Scheme Procedure} make-keyword-from-dash-symbol symbol
768 @deffnx {C Function} scm_make_keyword_from_dash_symbol (symbol)
769 Make a keyword object from a @var{symbol} that starts with a dash.
770 @end deffn
771
772 \fkeyword-dash-symbol
773 @c snarfed from discouraged.c:183
774 @deffn {Scheme Procedure} keyword-dash-symbol keyword
775 @deffnx {C Function} scm_keyword_dash_symbol (keyword)
776 Return the dash symbol for @var{keyword}.
777 This is the inverse of @code{make-keyword-from-dash-symbol}.
778 @end deffn
779
780 \fdynamic-link
781 @c snarfed from dynl.c:149
782 @deffn {Scheme Procedure} dynamic-link filename
783 @deffnx {C Function} scm_dynamic_link (filename)
784 Find the shared object (shared library) denoted by
785 @var{filename} and link it into the running Guile
786 application. The returned
787 scheme object is a ``handle'' for the library which can
788 be passed to @code{dynamic-func}, @code{dynamic-call} etc.
789
790 Searching for object files is system dependent. Normally,
791 if @var{filename} does have an explicit directory it will
792 be searched for in locations
793 such as @file{/usr/lib} and @file{/usr/local/lib}.
794 @end deffn
795
796 \fdynamic-object?
797 @c snarfed from dynl.c:168
798 @deffn {Scheme Procedure} dynamic-object? obj
799 @deffnx {C Function} scm_dynamic_object_p (obj)
800 Return @code{#t} if @var{obj} is a dynamic object handle,
801 or @code{#f} otherwise.
802 @end deffn
803
804 \fdynamic-unlink
805 @c snarfed from dynl.c:182
806 @deffn {Scheme Procedure} dynamic-unlink dobj
807 @deffnx {C Function} scm_dynamic_unlink (dobj)
808 Unlink a dynamic object from the application, if possible. The
809 object must have been linked by @code{dynamic-link}, with
810 @var{dobj} the corresponding handle. After this procedure
811 is called, the handle can no longer be used to access the
812 object.
813 @end deffn
814
815 \fdynamic-func
816 @c snarfed from dynl.c:207
817 @deffn {Scheme Procedure} dynamic-func name dobj
818 @deffnx {C Function} scm_dynamic_func (name, dobj)
819 Return a ``handle'' for the function @var{name} in the
820 shared object referred to by @var{dobj}. The handle
821 can be passed to @code{dynamic-call} to actually
822 call the function.
823
824 Regardless whether your C compiler prepends an underscore
825 @samp{_} to the global names in a program, you should
826 @strong{not} include this underscore in @var{name}
827 since it will be added automatically when necessary.
828 @end deffn
829
830 \fdynamic-call
831 @c snarfed from dynl.c:253
832 @deffn {Scheme Procedure} dynamic-call func dobj
833 @deffnx {C Function} scm_dynamic_call (func, dobj)
834 Call a C function in a dynamic object. Two styles of
835 invocation are supported:
836
837 @itemize @bullet
838 @item @var{func} can be a function handle returned by
839 @code{dynamic-func}. In this case @var{dobj} is
840 ignored
841 @item @var{func} can be a string with the name of the
842 function to call, with @var{dobj} the handle of the
843 dynamic object in which to find the function.
844 This is equivalent to
845 @smallexample
846
847 (dynamic-call (dynamic-func @var{func} @var{dobj}) #f)
848 @end smallexample
849 @end itemize
850
851 In either case, the function is passed no arguments
852 and its return value is ignored.
853 @end deffn
854
855 \fdynamic-args-call
856 @c snarfed from dynl.c:285
857 @deffn {Scheme Procedure} dynamic-args-call func dobj args
858 @deffnx {C Function} scm_dynamic_args_call (func, dobj, args)
859 Call the C function indicated by @var{func} and @var{dobj},
860 just like @code{dynamic-call}, but pass it some arguments and
861 return its return value. The C function is expected to take
862 two arguments and return an @code{int}, just like @code{main}:
863 @smallexample
864 int c_func (int argc, char **argv);
865 @end smallexample
866
867 The parameter @var{args} must be a list of strings and is
868 converted into an array of @code{char *}. The array is passed
869 in @var{argv} and its size in @var{argc}. The return value is
870 converted to a Scheme number and returned from the call to
871 @code{dynamic-args-call}.
872 @end deffn
873
874 \fdynamic-wind
875 @c snarfed from dynwind.c:97
876 @deffn {Scheme Procedure} dynamic-wind in_guard thunk out_guard
877 @deffnx {C Function} scm_dynamic_wind (in_guard, thunk, out_guard)
878 All three arguments must be 0-argument procedures.
879 @var{in_guard} is called, then @var{thunk}, then
880 @var{out_guard}.
881
882 If, any time during the execution of @var{thunk}, the
883 continuation of the @code{dynamic_wind} expression is escaped
884 non-locally, @var{out_guard} is called. If the continuation of
885 the dynamic-wind is re-entered, @var{in_guard} is called. Thus
886 @var{in_guard} and @var{out_guard} may be called any number of
887 times.
888 @lisp
889 (define x 'normal-binding)
890 @result{} x
891 (define a-cont (call-with-current-continuation
892 (lambda (escape)
893 (let ((old-x x))
894 (dynamic-wind
895 ;; in-guard:
896 ;;
897 (lambda () (set! x 'special-binding))
898
899 ;; thunk
900 ;;
901 (lambda () (display x) (newline)
902 (call-with-current-continuation escape)
903 (display x) (newline)
904 x)
905
906 ;; out-guard:
907 ;;
908 (lambda () (set! x old-x)))))))
909
910 ;; Prints:
911 special-binding
912 ;; Evaluates to:
913 @result{} a-cont
914 x
915 @result{} normal-binding
916 (a-cont #f)
917 ;; Prints:
918 special-binding
919 ;; Evaluates to:
920 @result{} a-cont ;; the value of the (define a-cont...)
921 x
922 @result{} normal-binding
923 a-cont
924 @result{} special-binding
925 @end lisp
926 @end deffn
927
928 \fenvironment?
929 @c snarfed from environments.c:106
930 @deffn {Scheme Procedure} environment? obj
931 @deffnx {C Function} scm_environment_p (obj)
932 Return @code{#t} if @var{obj} is an environment, or @code{#f}
933 otherwise.
934 @end deffn
935
936 \fenvironment-bound?
937 @c snarfed from environments.c:117
938 @deffn {Scheme Procedure} environment-bound? env sym
939 @deffnx {C Function} scm_environment_bound_p (env, sym)
940 Return @code{#t} if @var{sym} is bound in @var{env}, or
941 @code{#f} otherwise.
942 @end deffn
943
944 \fenvironment-ref
945 @c snarfed from environments.c:132
946 @deffn {Scheme Procedure} environment-ref env sym
947 @deffnx {C Function} scm_environment_ref (env, sym)
948 Return the value of the location bound to @var{sym} in
949 @var{env}. If @var{sym} is unbound in @var{env}, signal an
950 @code{environment:unbound} error.
951 @end deffn
952
953 \fenvironment-fold
954 @c snarfed from environments.c:202
955 @deffn {Scheme Procedure} environment-fold env proc init
956 @deffnx {C Function} scm_environment_fold (env, proc, init)
957 Iterate over all the bindings in @var{env}, accumulating some
958 value.
959 For each binding in @var{env}, apply @var{proc} to the symbol
960 bound, its value, and the result from the previous application
961 of @var{proc}.
962 Use @var{init} as @var{proc}'s third argument the first time
963 @var{proc} is applied.
964 If @var{env} contains no bindings, this function simply returns
965 @var{init}.
966 If @var{env} binds the symbol sym1 to the value val1, sym2 to
967 val2, and so on, then this procedure computes:
968 @lisp
969 (proc sym1 val1
970 (proc sym2 val2
971 ...
972 (proc symn valn
973 init)))
974 @end lisp
975 Each binding in @var{env} will be processed exactly once.
976 @code{environment-fold} makes no guarantees about the order in
977 which the bindings are processed.
978 Here is a function which, given an environment, constructs an
979 association list representing that environment's bindings,
980 using environment-fold:
981 @lisp
982 (define (environment->alist env)
983 (environment-fold env
984 (lambda (sym val tail)
985 (cons (cons sym val) tail))
986 '()))
987 @end lisp
988 @end deffn
989
990 \fenvironment-define
991 @c snarfed from environments.c:237
992 @deffn {Scheme Procedure} environment-define env sym val
993 @deffnx {C Function} scm_environment_define (env, sym, val)
994 Bind @var{sym} to a new location containing @var{val} in
995 @var{env}. If @var{sym} is already bound to another location
996 in @var{env} and the binding is mutable, that binding is
997 replaced. The new binding and location are both mutable. The
998 return value is unspecified.
999 If @var{sym} is already bound in @var{env}, and the binding is
1000 immutable, signal an @code{environment:immutable-binding} error.
1001 @end deffn
1002
1003 \fenvironment-undefine
1004 @c snarfed from environments.c:263
1005 @deffn {Scheme Procedure} environment-undefine env sym
1006 @deffnx {C Function} scm_environment_undefine (env, sym)
1007 Remove any binding for @var{sym} from @var{env}. If @var{sym}
1008 is unbound in @var{env}, do nothing. The return value is
1009 unspecified.
1010 If @var{sym} is already bound in @var{env}, and the binding is
1011 immutable, signal an @code{environment:immutable-binding} error.
1012 @end deffn
1013
1014 \fenvironment-set!
1015 @c snarfed from environments.c:291
1016 @deffn {Scheme Procedure} environment-set! env sym val
1017 @deffnx {C Function} scm_environment_set_x (env, sym, val)
1018 If @var{env} binds @var{sym} to some location, change that
1019 location's value to @var{val}. The return value is
1020 unspecified.
1021 If @var{sym} is not bound in @var{env}, signal an
1022 @code{environment:unbound} error. If @var{env} binds @var{sym}
1023 to an immutable location, signal an
1024 @code{environment:immutable-location} error.
1025 @end deffn
1026
1027 \fenvironment-cell
1028 @c snarfed from environments.c:326
1029 @deffn {Scheme Procedure} environment-cell env sym for_write
1030 @deffnx {C Function} scm_environment_cell (env, sym, for_write)
1031 Return the value cell which @var{env} binds to @var{sym}, or
1032 @code{#f} if the binding does not live in a value cell.
1033 The argument @var{for-write} indicates whether the caller
1034 intends to modify the variable's value by mutating the value
1035 cell. If the variable is immutable, then
1036 @code{environment-cell} signals an
1037 @code{environment:immutable-location} error.
1038 If @var{sym} is unbound in @var{env}, signal an
1039 @code{environment:unbound} error.
1040 If you use this function, you should consider using
1041 @code{environment-observe}, to be notified when @var{sym} gets
1042 re-bound to a new value cell, or becomes undefined.
1043 @end deffn
1044
1045 \fenvironment-observe
1046 @c snarfed from environments.c:378
1047 @deffn {Scheme Procedure} environment-observe env proc
1048 @deffnx {C Function} scm_environment_observe (env, proc)
1049 Whenever @var{env}'s bindings change, apply @var{proc} to
1050 @var{env}.
1051 This function returns an object, token, which you can pass to
1052 @code{environment-unobserve} to remove @var{proc} from the set
1053 of procedures observing @var{env}. The type and value of
1054 token is unspecified.
1055 @end deffn
1056
1057 \fenvironment-observe-weak
1058 @c snarfed from environments.c:395
1059 @deffn {Scheme Procedure} environment-observe-weak env proc
1060 @deffnx {C Function} scm_environment_observe_weak (env, proc)
1061 This function is the same as environment-observe, except that
1062 the reference @var{env} retains to @var{proc} is a weak
1063 reference. This means that, if there are no other live,
1064 non-weak references to @var{proc}, it will be
1065 garbage-collected, and dropped from @var{env}'s
1066 list of observing procedures.
1067 @end deffn
1068
1069 \fenvironment-unobserve
1070 @c snarfed from environments.c:431
1071 @deffn {Scheme Procedure} environment-unobserve token
1072 @deffnx {C Function} scm_environment_unobserve (token)
1073 Cancel the observation request which returned the value
1074 @var{token}. The return value is unspecified.
1075 If a call @code{(environment-observe env proc)} returns
1076 @var{token}, then the call @code{(environment-unobserve token)}
1077 will cause @var{proc} to no longer be called when @var{env}'s
1078 bindings change.
1079 @end deffn
1080
1081 \fmake-leaf-environment
1082 @c snarfed from environments.c:1017
1083 @deffn {Scheme Procedure} make-leaf-environment
1084 @deffnx {C Function} scm_make_leaf_environment ()
1085 Create a new leaf environment, containing no bindings.
1086 All bindings and locations created in the new environment
1087 will be mutable.
1088 @end deffn
1089
1090 \fleaf-environment?
1091 @c snarfed from environments.c:1040
1092 @deffn {Scheme Procedure} leaf-environment? object
1093 @deffnx {C Function} scm_leaf_environment_p (object)
1094 Return @code{#t} if object is a leaf environment, or @code{#f}
1095 otherwise.
1096 @end deffn
1097
1098 \fmake-eval-environment
1099 @c snarfed from environments.c:1405
1100 @deffn {Scheme Procedure} make-eval-environment local imported
1101 @deffnx {C Function} scm_make_eval_environment (local, imported)
1102 Return a new environment object eval whose bindings are the
1103 union of the bindings in the environments @var{local} and
1104 @var{imported}, with bindings from @var{local} taking
1105 precedence. Definitions made in eval are placed in @var{local}.
1106 Applying @code{environment-define} or
1107 @code{environment-undefine} to eval has the same effect as
1108 applying the procedure to @var{local}.
1109 Note that eval incorporates @var{local} and @var{imported} by
1110 reference:
1111 If, after creating eval, the program changes the bindings of
1112 @var{local} or @var{imported}, those changes will be visible
1113 in eval.
1114 Since most Scheme evaluation takes place in eval environments,
1115 they transparently cache the bindings received from @var{local}
1116 and @var{imported}. Thus, the first time the program looks up
1117 a symbol in eval, eval may make calls to @var{local} or
1118 @var{imported} to find their bindings, but subsequent
1119 references to that symbol will be as fast as references to
1120 bindings in finite environments.
1121 In typical use, @var{local} will be a finite environment, and
1122 @var{imported} will be an import environment
1123 @end deffn
1124
1125 \feval-environment?
1126 @c snarfed from environments.c:1442
1127 @deffn {Scheme Procedure} eval-environment? object
1128 @deffnx {C Function} scm_eval_environment_p (object)
1129 Return @code{#t} if object is an eval environment, or @code{#f}
1130 otherwise.
1131 @end deffn
1132
1133 \feval-environment-local
1134 @c snarfed from environments.c:1452
1135 @deffn {Scheme Procedure} eval-environment-local env
1136 @deffnx {C Function} scm_eval_environment_local (env)
1137 Return the local environment of eval environment @var{env}.
1138 @end deffn
1139
1140 \feval-environment-set-local!
1141 @c snarfed from environments.c:1464
1142 @deffn {Scheme Procedure} eval-environment-set-local! env local
1143 @deffnx {C Function} scm_eval_environment_set_local_x (env, local)
1144 Change @var{env}'s local environment to @var{local}.
1145 @end deffn
1146
1147 \feval-environment-imported
1148 @c snarfed from environments.c:1490
1149 @deffn {Scheme Procedure} eval-environment-imported env
1150 @deffnx {C Function} scm_eval_environment_imported (env)
1151 Return the imported environment of eval environment @var{env}.
1152 @end deffn
1153
1154 \feval-environment-set-imported!
1155 @c snarfed from environments.c:1502
1156 @deffn {Scheme Procedure} eval-environment-set-imported! env imported
1157 @deffnx {C Function} scm_eval_environment_set_imported_x (env, imported)
1158 Change @var{env}'s imported environment to @var{imported}.
1159 @end deffn
1160
1161 \fmake-import-environment
1162 @c snarfed from environments.c:1825
1163 @deffn {Scheme Procedure} make-import-environment imports conflict_proc
1164 @deffnx {C Function} scm_make_import_environment (imports, conflict_proc)
1165 Return a new environment @var{imp} whose bindings are the union
1166 of the bindings from the environments in @var{imports};
1167 @var{imports} must be a list of environments. That is,
1168 @var{imp} binds a symbol to a location when some element of
1169 @var{imports} does.
1170 If two different elements of @var{imports} have a binding for
1171 the same symbol, the @var{conflict-proc} is called with the
1172 following parameters: the import environment, the symbol and
1173 the list of the imported environments that bind the symbol.
1174 If the @var{conflict-proc} returns an environment @var{env},
1175 the conflict is considered as resolved and the binding from
1176 @var{env} is used. If the @var{conflict-proc} returns some
1177 non-environment object, the conflict is considered unresolved
1178 and the symbol is treated as unspecified in the import
1179 environment.
1180 The checking for conflicts may be performed lazily, i. e. at
1181 the moment when a value or binding for a certain symbol is
1182 requested instead of the moment when the environment is
1183 created or the bindings of the imports change.
1184 All bindings in @var{imp} are immutable. If you apply
1185 @code{environment-define} or @code{environment-undefine} to
1186 @var{imp}, Guile will signal an
1187 @code{environment:immutable-binding} error. However,
1188 notice that the set of bindings in @var{imp} may still change,
1189 if one of its imported environments changes.
1190 @end deffn
1191
1192 \fimport-environment?
1193 @c snarfed from environments.c:1854
1194 @deffn {Scheme Procedure} import-environment? object
1195 @deffnx {C Function} scm_import_environment_p (object)
1196 Return @code{#t} if object is an import environment, or
1197 @code{#f} otherwise.
1198 @end deffn
1199
1200 \fimport-environment-imports
1201 @c snarfed from environments.c:1865
1202 @deffn {Scheme Procedure} import-environment-imports env
1203 @deffnx {C Function} scm_import_environment_imports (env)
1204 Return the list of environments imported by the import
1205 environment @var{env}.
1206 @end deffn
1207
1208 \fimport-environment-set-imports!
1209 @c snarfed from environments.c:1878
1210 @deffn {Scheme Procedure} import-environment-set-imports! env imports
1211 @deffnx {C Function} scm_import_environment_set_imports_x (env, imports)
1212 Change @var{env}'s list of imported environments to
1213 @var{imports}, and check for conflicts.
1214 @end deffn
1215
1216 \fmake-export-environment
1217 @c snarfed from environments.c:2145
1218 @deffn {Scheme Procedure} make-export-environment private signature
1219 @deffnx {C Function} scm_make_export_environment (private, signature)
1220 Return a new environment @var{exp} containing only those
1221 bindings in private whose symbols are present in
1222 @var{signature}. The @var{private} argument must be an
1223 environment.
1224
1225 The environment @var{exp} binds symbol to location when
1226 @var{env} does, and symbol is exported by @var{signature}.
1227
1228 @var{signature} is a list specifying which of the bindings in
1229 @var{private} should be visible in @var{exp}. Each element of
1230 @var{signature} should be a list of the form:
1231 (symbol attribute ...)
1232 where each attribute is one of the following:
1233 @table @asis
1234 @item the symbol @code{mutable-location}
1235 @var{exp} should treat the
1236 location bound to symbol as mutable. That is, @var{exp}
1237 will pass calls to @code{environment-set!} or
1238 @code{environment-cell} directly through to private.
1239 @item the symbol @code{immutable-location}
1240 @var{exp} should treat
1241 the location bound to symbol as immutable. If the program
1242 applies @code{environment-set!} to @var{exp} and symbol, or
1243 calls @code{environment-cell} to obtain a writable value
1244 cell, @code{environment-set!} will signal an
1245 @code{environment:immutable-location} error. Note that, even
1246 if an export environment treats a location as immutable, the
1247 underlying environment may treat it as mutable, so its
1248 value may change.
1249 @end table
1250 It is an error for an element of signature to specify both
1251 @code{mutable-location} and @code{immutable-location}. If
1252 neither is specified, @code{immutable-location} is assumed.
1253
1254 As a special case, if an element of signature is a lone
1255 symbol @var{sym}, it is equivalent to an element of the form
1256 @code{(sym)}.
1257
1258 All bindings in @var{exp} are immutable. If you apply
1259 @code{environment-define} or @code{environment-undefine} to
1260 @var{exp}, Guile will signal an
1261 @code{environment:immutable-binding} error. However,
1262 notice that the set of bindings in @var{exp} may still change,
1263 if the bindings in private change.
1264 @end deffn
1265
1266 \fexport-environment?
1267 @c snarfed from environments.c:2180
1268 @deffn {Scheme Procedure} export-environment? object
1269 @deffnx {C Function} scm_export_environment_p (object)
1270 Return @code{#t} if object is an export environment, or
1271 @code{#f} otherwise.
1272 @end deffn
1273
1274 \fexport-environment-private
1275 @c snarfed from environments.c:2190
1276 @deffn {Scheme Procedure} export-environment-private env
1277 @deffnx {C Function} scm_export_environment_private (env)
1278 Return the private environment of export environment @var{env}.
1279 @end deffn
1280
1281 \fexport-environment-set-private!
1282 @c snarfed from environments.c:2202
1283 @deffn {Scheme Procedure} export-environment-set-private! env private
1284 @deffnx {C Function} scm_export_environment_set_private_x (env, private)
1285 Change the private environment of export environment @var{env}.
1286 @end deffn
1287
1288 \fexport-environment-signature
1289 @c snarfed from environments.c:2224
1290 @deffn {Scheme Procedure} export-environment-signature env
1291 @deffnx {C Function} scm_export_environment_signature (env)
1292 Return the signature of export environment @var{env}.
1293 @end deffn
1294
1295 \fexport-environment-set-signature!
1296 @c snarfed from environments.c:2298
1297 @deffn {Scheme Procedure} export-environment-set-signature! env signature
1298 @deffnx {C Function} scm_export_environment_set_signature_x (env, signature)
1299 Change the signature of export environment @var{env}.
1300 @end deffn
1301
1302 \feq?
1303 @c snarfed from eq.c:81
1304 @deffn {Scheme Procedure} eq? x y
1305 Return @code{#t} if @var{x} and @var{y} are the same object,
1306 except for numbers and characters. For example,
1307
1308 @example
1309 (define x (vector 1 2 3))
1310 (define y (vector 1 2 3))
1311
1312 (eq? x x) @result{} #t
1313 (eq? x y) @result{} #f
1314 @end example
1315
1316 Numbers and characters are not equal to any other object, but
1317 the problem is they're not necessarily @code{eq?} to themselves
1318 either. This is even so when the number comes directly from a
1319 variable,
1320
1321 @example
1322 (let ((n (+ 2 3)))
1323 (eq? n n)) @result{} *unspecified*
1324 @end example
1325
1326 Generally @code{eqv?} should be used when comparing numbers or
1327 characters. @code{=} or @code{char=?} can be used too.
1328
1329 It's worth noting that end-of-list @code{()}, @code{#t},
1330 @code{#f}, a symbol of a given name, and a keyword of a given
1331 name, are unique objects. There's just one of each, so for
1332 instance no matter how @code{()} arises in a program, it's the
1333 same object and can be compared with @code{eq?},
1334
1335 @example
1336 (define x (cdr '(123)))
1337 (define y (cdr '(456)))
1338 (eq? x y) @result{} #t
1339
1340 (define x (string->symbol "foo"))
1341 (eq? x 'foo) @result{} #t
1342 @end example
1343 @end deffn
1344
1345 \feqv?
1346 @c snarfed from eq.c:116
1347 @deffn {Scheme Procedure} eqv? x y
1348 Return @code{#t} if @var{x} and @var{y} are the same object, or
1349 for characters and numbers the same value.
1350
1351 On objects except characters and numbers, @code{eqv?} is the
1352 same as @code{eq?}, it's true if @var{x} and @var{y} are the
1353 same object.
1354
1355 If @var{x} and @var{y} are numbers or characters, @code{eqv?}
1356 compares their type and value. An exact number is not
1357 @code{eqv?} to an inexact number (even if their value is the
1358 same).
1359
1360 @example
1361 (eqv? 3 (+ 1 2)) @result{} #t
1362 (eqv? 1 1.0) @result{} #f
1363 @end example
1364 @end deffn
1365
1366 \fequal?
1367 @c snarfed from eq.c:212
1368 @deffn {Scheme Procedure} equal? x y
1369 Return @code{#t} if @var{x} and @var{y} are the same type, and
1370 their contents or value are equal.
1371
1372 For a pair, string, vector or array, @code{equal?} compares the
1373 contents, and does so using using the same @code{equal?}
1374 recursively, so a deep structure can be traversed.
1375
1376 @example
1377 (equal? (list 1 2 3) (list 1 2 3)) @result{} #t
1378 (equal? (list 1 2 3) (vector 1 2 3)) @result{} #f
1379 @end example
1380
1381 For other objects, @code{equal?} compares as per @code{eqv?},
1382 which means characters and numbers are compared by type and
1383 value (and like @code{eqv?}, exact and inexact numbers are not
1384 @code{equal?}, even if their value is the same).
1385
1386 @example
1387 (equal? 3 (+ 1 2)) @result{} #t
1388 (equal? 1 1.0) @result{} #f
1389 @end example
1390
1391 Hash tables are currently only compared as per @code{eq?}, so
1392 two different tables are not @code{equal?}, even if their
1393 contents are the same.
1394
1395 @code{equal?} does not support circular data structures, it may
1396 go into an infinite loop if asked to compare two circular lists
1397 or similar.
1398
1399 New application-defined object types (Smobs) have an
1400 @code{equalp} handler which is called by @code{equal?}. This
1401 lets an application traverse the contents or control what is
1402 considered @code{equal?} for two such objects. If there's no
1403 handler, the default is to just compare as per @code{eq?}.
1404 @end deffn
1405
1406 \fscm-error
1407 @c snarfed from error.c:82
1408 @deffn {Scheme Procedure} scm-error key subr message args data
1409 @deffnx {C Function} scm_error_scm (key, subr, message, args, data)
1410 Raise an error with key @var{key}. @var{subr} can be a string
1411 naming the procedure associated with the error, or @code{#f}.
1412 @var{message} is the error message string, possibly containing
1413 @code{~S} and @code{~A} escapes. When an error is reported,
1414 these are replaced by formatting the corresponding members of
1415 @var{args}: @code{~A} (was @code{%s} in older versions of
1416 Guile) formats using @code{display} and @code{~S} (was
1417 @code{%S}) formats using @code{write}. @var{data} is a list or
1418 @code{#f} depending on @var{key}: if @var{key} is
1419 @code{system-error} then it should be a list containing the
1420 Unix @code{errno} value; If @var{key} is @code{signal} then it
1421 should be a list containing the Unix signal number; If
1422 @var{key} is @code{out-of-range} or @code{wrong-type-arg},
1423 it is a list containing the bad value; otherwise
1424 it will usually be @code{#f}.
1425 @end deffn
1426
1427 \fstrerror
1428 @c snarfed from error.c:129
1429 @deffn {Scheme Procedure} strerror err
1430 @deffnx {C Function} scm_strerror (err)
1431 Return the Unix error message corresponding to @var{err}, which
1432 must be an integer value.
1433 @end deffn
1434
1435 \fapply:nconc2last
1436 @c snarfed from eval.c:4686
1437 @deffn {Scheme Procedure} apply:nconc2last lst
1438 @deffnx {C Function} scm_nconc2last (lst)
1439 Given a list (@var{arg1} @dots{} @var{args}), this function
1440 conses the @var{arg1} @dots{} arguments onto the front of
1441 @var{args}, and returns the resulting list. Note that
1442 @var{args} is a list; thus, the argument to this function is
1443 a list whose last element is a list.
1444 Note: Rather than do new consing, @code{apply:nconc2last}
1445 destroys its argument, so use with care.
1446 @end deffn
1447
1448 \fforce
1449 @c snarfed from eval.c:5598
1450 @deffn {Scheme Procedure} force promise
1451 @deffnx {C Function} scm_force (promise)
1452 If the promise @var{x} has not been computed yet, compute and
1453 return @var{x}, otherwise just return the previously computed
1454 value.
1455 @end deffn
1456
1457 \fpromise?
1458 @c snarfed from eval.c:5621
1459 @deffn {Scheme Procedure} promise? obj
1460 @deffnx {C Function} scm_promise_p (obj)
1461 Return true if @var{obj} is a promise, i.e. a delayed computation
1462 (@pxref{Delayed evaluation,,,r5rs.info,The Revised^5 Report on Scheme}).
1463 @end deffn
1464
1465 \fcons-source
1466 @c snarfed from eval.c:5633
1467 @deffn {Scheme Procedure} cons-source xorig x y
1468 @deffnx {C Function} scm_cons_source (xorig, x, y)
1469 Create and return a new pair whose car and cdr are @var{x} and @var{y}.
1470 Any source properties associated with @var{xorig} are also associated
1471 with the new pair.
1472 @end deffn
1473
1474 \fcopy-tree
1475 @c snarfed from eval.c:5790
1476 @deffn {Scheme Procedure} copy-tree obj
1477 @deffnx {C Function} scm_copy_tree (obj)
1478 Recursively copy the data tree that is bound to @var{obj}, and return a
1479 the new data structure. @code{copy-tree} recurses down the
1480 contents of both pairs and vectors (since both cons cells and vector
1481 cells may point to arbitrary objects), and stops recursing when it hits
1482 any other object.
1483 @end deffn
1484
1485 \fprimitive-eval
1486 @c snarfed from eval.c:5878
1487 @deffn {Scheme Procedure} primitive-eval exp
1488 @deffnx {C Function} scm_primitive_eval (exp)
1489 Evaluate @var{exp} in the top-level environment specified by
1490 the current module.
1491 @end deffn
1492
1493 \feval
1494 @c snarfed from eval.c:5922
1495 @deffn {Scheme Procedure} eval exp module_or_state
1496 @deffnx {C Function} scm_eval (exp, module_or_state)
1497 Evaluate @var{exp}, a list representing a Scheme expression,
1498 in the top-level environment specified by
1499 @var{module_or_state}.
1500 While @var{exp} is evaluated (using @code{primitive-eval}),
1501 @var{module_or_state} is made the current module when
1502 it is a module, or the current dynamic state when it is
1503 a dynamic state.Example: (eval '(+ 1 2) (interaction-environment))
1504 @end deffn
1505
1506 \feval-options-interface
1507 @c snarfed from eval.c:3086
1508 @deffn {Scheme Procedure} eval-options-interface [setting]
1509 @deffnx {C Function} scm_eval_options_interface (setting)
1510 Option interface for the evaluation options. Instead of using
1511 this procedure directly, use the procedures @code{eval-enable},
1512 @code{eval-disable}, @code{eval-set!} and @code{eval-options}.
1513 @end deffn
1514
1515 \fevaluator-traps-interface
1516 @c snarfed from eval.c:3104
1517 @deffn {Scheme Procedure} evaluator-traps-interface [setting]
1518 @deffnx {C Function} scm_evaluator_traps (setting)
1519 Option interface for the evaluator trap options.
1520 @end deffn
1521
1522 \fdefined?
1523 @c snarfed from evalext.c:34
1524 @deffn {Scheme Procedure} defined? sym [env]
1525 @deffnx {C Function} scm_defined_p (sym, env)
1526 Return @code{#t} if @var{sym} is defined in the lexical environment @var{env}. When @var{env} is not specified, look in the top-level environment as defined by the current module.
1527 @end deffn
1528
1529 \fmap-in-order
1530 @c snarfed from evalext.c:80
1531 @deffn {Scheme Procedure} map-in-order
1532 implemented by the C function "scm_map"
1533 @end deffn
1534
1535 \fself-evaluating?
1536 @c snarfed from evalext.c:85
1537 @deffn {Scheme Procedure} self-evaluating? obj
1538 @deffnx {C Function} scm_self_evaluating_p (obj)
1539 Return #t for objects which Guile considers self-evaluating
1540 @end deffn
1541
1542 \fload-extension
1543 @c snarfed from extensions.c:143
1544 @deffn {Scheme Procedure} load-extension lib init
1545 @deffnx {C Function} scm_load_extension (lib, init)
1546 Load and initialize the extension designated by LIB and INIT.
1547 When there is no pre-registered function for LIB/INIT, this is
1548 equivalent to
1549
1550 @lisp
1551 (dynamic-call INIT (dynamic-link LIB))
1552 @end lisp
1553
1554 When there is a pre-registered function, that function is called
1555 instead.
1556
1557 Normally, there is no pre-registered function. This option exists
1558 only for situations where dynamic linking is unavailable or unwanted.
1559 In that case, you would statically link your program with the desired
1560 library, and register its init function right after Guile has been
1561 initialized.
1562
1563 LIB should be a string denoting a shared library without any file type
1564 suffix such as ".so". The suffix is provided automatically. It
1565 should also not contain any directory components. Libraries that
1566 implement Guile Extensions should be put into the normal locations for
1567 shared libraries. We recommend to use the naming convention
1568 libguile-bla-blum for a extension related to a module `(bla blum)'.
1569
1570 The normal way for a extension to be used is to write a small Scheme
1571 file that defines a module, and to load the extension into this
1572 module. When the module is auto-loaded, the extension is loaded as
1573 well. For example,
1574
1575 @lisp
1576 (define-module (bla blum))
1577
1578 (load-extension "libguile-bla-blum" "bla_init_blum")
1579 @end lisp
1580 @end deffn
1581
1582 \fprogram-arguments
1583 @c snarfed from feature.c:57
1584 @deffn {Scheme Procedure} program-arguments
1585 @deffnx {Scheme Procedure} command-line
1586 @deffnx {C Function} scm_program_arguments ()
1587 Return the list of command line arguments passed to Guile, as a list of
1588 strings. The list includes the invoked program name, which is usually
1589 @code{"guile"}, but excludes switches and parameters for command line
1590 options like @code{-e} and @code{-l}.
1591 @end deffn
1592
1593 \fmake-fluid
1594 @c snarfed from fluids.c:260
1595 @deffn {Scheme Procedure} make-fluid
1596 @deffnx {C Function} scm_make_fluid ()
1597 Return a newly created fluid.
1598 Fluids are objects that can hold one
1599 value per dynamic state. That is, modifications to this value are
1600 only visible to code that executes with the same dynamic state as
1601 the modifying code. When a new dynamic state is constructed, it
1602 inherits the values from its parent. Because each thread normally executes
1603 with its own dynamic state, you can use fluids for thread local storage.
1604 @end deffn
1605
1606 \ffluid?
1607 @c snarfed from fluids.c:283
1608 @deffn {Scheme Procedure} fluid? obj
1609 @deffnx {C Function} scm_fluid_p (obj)
1610 Return @code{#t} iff @var{obj} is a fluid; otherwise, return
1611 @code{#f}.
1612 @end deffn
1613
1614 \ffluid-ref
1615 @c snarfed from fluids.c:306
1616 @deffn {Scheme Procedure} fluid-ref fluid
1617 @deffnx {C Function} scm_fluid_ref (fluid)
1618 Return the value associated with @var{fluid} in the current
1619 dynamic root. If @var{fluid} has not been set, then return
1620 @code{#f}.
1621 @end deffn
1622
1623 \ffluid-set!
1624 @c snarfed from fluids.c:325
1625 @deffn {Scheme Procedure} fluid-set! fluid value
1626 @deffnx {C Function} scm_fluid_set_x (fluid, value)
1627 Set the value associated with @var{fluid} in the current dynamic root.
1628 @end deffn
1629
1630 \fwith-fluids*
1631 @c snarfed from fluids.c:395
1632 @deffn {Scheme Procedure} with-fluids* fluids values thunk
1633 @deffnx {C Function} scm_with_fluids (fluids, values, thunk)
1634 Set @var{fluids} to @var{values} temporary, and call @var{thunk}.
1635 @var{fluids} must be a list of fluids and @var{values} must be the same
1636 number of their values to be applied. Each substitution is done
1637 one after another. @var{thunk} must be a procedure with no argument.
1638 @end deffn
1639
1640 \fwith-fluid*
1641 @c snarfed from fluids.c:434
1642 @deffn {Scheme Procedure} with-fluid* fluid value thunk
1643 @deffnx {C Function} scm_with_fluid (fluid, value, thunk)
1644 Set @var{fluid} to @var{value} temporarily, and call @var{thunk}.
1645 @var{thunk} must be a procedure with no argument.
1646 @end deffn
1647
1648 \fmake-dynamic-state
1649 @c snarfed from fluids.c:487
1650 @deffn {Scheme Procedure} make-dynamic-state [parent]
1651 @deffnx {C Function} scm_make_dynamic_state (parent)
1652 Return a copy of the dynamic state object @var{parent}
1653 or of the current dynamic state when @var{parent} is omitted.
1654 @end deffn
1655
1656 \fdynamic-state?
1657 @c snarfed from fluids.c:515
1658 @deffn {Scheme Procedure} dynamic-state? obj
1659 @deffnx {C Function} scm_dynamic_state_p (obj)
1660 Return @code{#t} if @var{obj} is a dynamic state object;
1661 return @code{#f} otherwise
1662 @end deffn
1663
1664 \fcurrent-dynamic-state
1665 @c snarfed from fluids.c:530
1666 @deffn {Scheme Procedure} current-dynamic-state
1667 @deffnx {C Function} scm_current_dynamic_state ()
1668 Return the current dynamic state object.
1669 @end deffn
1670
1671 \fset-current-dynamic-state
1672 @c snarfed from fluids.c:540
1673 @deffn {Scheme Procedure} set-current-dynamic-state state
1674 @deffnx {C Function} scm_set_current_dynamic_state (state)
1675 Set the current dynamic state object to @var{state}
1676 and return the previous current dynamic state object.
1677 @end deffn
1678
1679 \fwith-dynamic-state
1680 @c snarfed from fluids.c:582
1681 @deffn {Scheme Procedure} with-dynamic-state state proc
1682 @deffnx {C Function} scm_with_dynamic_state (state, proc)
1683 Call @var{proc} while @var{state} is the current dynamic
1684 state object.
1685 @end deffn
1686
1687 \fsetvbuf
1688 @c snarfed from fports.c:137
1689 @deffn {Scheme Procedure} setvbuf port mode [size]
1690 @deffnx {C Function} scm_setvbuf (port, mode, size)
1691 Set the buffering mode for @var{port}. @var{mode} can be:
1692 @table @code
1693 @item _IONBF
1694 non-buffered
1695 @item _IOLBF
1696 line buffered
1697 @item _IOFBF
1698 block buffered, using a newly allocated buffer of @var{size} bytes.
1699 If @var{size} is omitted, a default size will be used.
1700 @end table
1701 @end deffn
1702
1703 \ffile-port?
1704 @c snarfed from fports.c:230
1705 @deffn {Scheme Procedure} file-port? obj
1706 @deffnx {C Function} scm_file_port_p (obj)
1707 Determine whether @var{obj} is a port that is related to a file.
1708 @end deffn
1709
1710 \fopen-file
1711 @c snarfed from fports.c:284
1712 @deffn {Scheme Procedure} open-file filename mode
1713 @deffnx {C Function} scm_open_file (filename, mode)
1714 Open the file whose name is @var{filename}, and return a port
1715 representing that file. The attributes of the port are
1716 determined by the @var{mode} string. The way in which this is
1717 interpreted is similar to C stdio. The first character must be
1718 one of the following:
1719 @table @samp
1720 @item r
1721 Open an existing file for input.
1722 @item w
1723 Open a file for output, creating it if it doesn't already exist
1724 or removing its contents if it does.
1725 @item a
1726 Open a file for output, creating it if it doesn't already
1727 exist. All writes to the port will go to the end of the file.
1728 The "append mode" can be turned off while the port is in use
1729 @pxref{Ports and File Descriptors, fcntl}
1730 @end table
1731 The following additional characters can be appended:
1732 @table @samp
1733 @item +
1734 Open the port for both input and output. E.g., @code{r+}: open
1735 an existing file for both input and output.
1736 @item 0
1737 Create an "unbuffered" port. In this case input and output
1738 operations are passed directly to the underlying port
1739 implementation without additional buffering. This is likely to
1740 slow down I/O operations. The buffering mode can be changed
1741 while a port is in use @pxref{Ports and File Descriptors,
1742 setvbuf}
1743 @item l
1744 Add line-buffering to the port. The port output buffer will be
1745 automatically flushed whenever a newline character is written.
1746 @end table
1747 In theory we could create read/write ports which were buffered
1748 in one direction only. However this isn't included in the
1749 current interfaces. If a file cannot be opened with the access
1750 requested, @code{open-file} throws an exception.
1751 @end deffn
1752
1753 \fmake-future
1754 @c snarfed from futures.c:89
1755 @deffn {Scheme Procedure} make-future thunk
1756 @deffnx {C Function} scm_make_future (thunk)
1757 Make a future evaluating THUNK.
1758 @end deffn
1759
1760 \ffuture-ref
1761 @c snarfed from futures.c:221
1762 @deffn {Scheme Procedure} future-ref future
1763 @deffnx {C Function} scm_future_ref (future)
1764 If the future @var{x} has not been computed yet, compute and
1765 return @var{x}, otherwise just return the previously computed
1766 value.
1767 @end deffn
1768
1769 \fgc-live-object-stats
1770 @c snarfed from gc.c:276
1771 @deffn {Scheme Procedure} gc-live-object-stats
1772 @deffnx {C Function} scm_gc_live_object_stats ()
1773 Return an alist of statistics of the current live objects.
1774 @end deffn
1775
1776 \fgc-stats
1777 @c snarfed from gc.c:293
1778 @deffn {Scheme Procedure} gc-stats
1779 @deffnx {C Function} scm_gc_stats ()
1780 Return an association list of statistics about Guile's current
1781 use of storage.
1782
1783 @end deffn
1784
1785 \fobject-address
1786 @c snarfed from gc.c:429
1787 @deffn {Scheme Procedure} object-address obj
1788 @deffnx {C Function} scm_object_address (obj)
1789 Return an integer that for the lifetime of @var{obj} is uniquely
1790 returned by this function for @var{obj}
1791 @end deffn
1792
1793 \fgc
1794 @c snarfed from gc.c:440
1795 @deffn {Scheme Procedure} gc
1796 @deffnx {C Function} scm_gc ()
1797 Scans all of SCM objects and reclaims for further use those that are
1798 no longer accessible.
1799 @end deffn
1800
1801 \fclass-of
1802 @c snarfed from goops.c:166
1803 @deffn {Scheme Procedure} class-of x
1804 @deffnx {C Function} scm_class_of (x)
1805 Return the class of @var{x}.
1806 @end deffn
1807
1808 \f%compute-slots
1809 @c snarfed from goops.c:407
1810 @deffn {Scheme Procedure} %compute-slots class
1811 @deffnx {C Function} scm_sys_compute_slots (class)
1812 Return a list consisting of the names of all slots belonging to
1813 class @var{class}, i. e. the slots of @var{class} and of all of
1814 its superclasses.
1815 @end deffn
1816
1817 \fget-keyword
1818 @c snarfed from goops.c:498
1819 @deffn {Scheme Procedure} get-keyword key l default_value
1820 @deffnx {C Function} scm_get_keyword (key, l, default_value)
1821 Determine an associated value for the keyword @var{key} from
1822 the list @var{l}. The list @var{l} has to consist of an even
1823 number of elements, where, starting with the first, every
1824 second element is a keyword, followed by its associated value.
1825 If @var{l} does not hold a value for @var{key}, the value
1826 @var{default_value} is returned.
1827 @end deffn
1828
1829 \f%initialize-object
1830 @c snarfed from goops.c:521
1831 @deffn {Scheme Procedure} %initialize-object obj initargs
1832 @deffnx {C Function} scm_sys_initialize_object (obj, initargs)
1833 Initialize the object @var{obj} with the given arguments
1834 @var{initargs}.
1835 @end deffn
1836
1837 \f%prep-layout!
1838 @c snarfed from goops.c:619
1839 @deffn {Scheme Procedure} %prep-layout! class
1840 @deffnx {C Function} scm_sys_prep_layout_x (class)
1841
1842 @end deffn
1843
1844 \f%inherit-magic!
1845 @c snarfed from goops.c:718
1846 @deffn {Scheme Procedure} %inherit-magic! class dsupers
1847 @deffnx {C Function} scm_sys_inherit_magic_x (class, dsupers)
1848
1849 @end deffn
1850
1851 \finstance?
1852 @c snarfed from goops.c:958
1853 @deffn {Scheme Procedure} instance? obj
1854 @deffnx {C Function} scm_instance_p (obj)
1855 Return @code{#t} if @var{obj} is an instance.
1856 @end deffn
1857
1858 \fclass-name
1859 @c snarfed from goops.c:973
1860 @deffn {Scheme Procedure} class-name obj
1861 @deffnx {C Function} scm_class_name (obj)
1862 Return the class name of @var{obj}.
1863 @end deffn
1864
1865 \fclass-direct-supers
1866 @c snarfed from goops.c:983
1867 @deffn {Scheme Procedure} class-direct-supers obj
1868 @deffnx {C Function} scm_class_direct_supers (obj)
1869 Return the direct superclasses of the class @var{obj}.
1870 @end deffn
1871
1872 \fclass-direct-slots
1873 @c snarfed from goops.c:993
1874 @deffn {Scheme Procedure} class-direct-slots obj
1875 @deffnx {C Function} scm_class_direct_slots (obj)
1876 Return the direct slots of the class @var{obj}.
1877 @end deffn
1878
1879 \fclass-direct-subclasses
1880 @c snarfed from goops.c:1003
1881 @deffn {Scheme Procedure} class-direct-subclasses obj
1882 @deffnx {C Function} scm_class_direct_subclasses (obj)
1883 Return the direct subclasses of the class @var{obj}.
1884 @end deffn
1885
1886 \fclass-direct-methods
1887 @c snarfed from goops.c:1013
1888 @deffn {Scheme Procedure} class-direct-methods obj
1889 @deffnx {C Function} scm_class_direct_methods (obj)
1890 Return the direct methods of the class @var{obj}
1891 @end deffn
1892
1893 \fclass-precedence-list
1894 @c snarfed from goops.c:1023
1895 @deffn {Scheme Procedure} class-precedence-list obj
1896 @deffnx {C Function} scm_class_precedence_list (obj)
1897 Return the class precedence list of the class @var{obj}.
1898 @end deffn
1899
1900 \fclass-slots
1901 @c snarfed from goops.c:1033
1902 @deffn {Scheme Procedure} class-slots obj
1903 @deffnx {C Function} scm_class_slots (obj)
1904 Return the slot list of the class @var{obj}.
1905 @end deffn
1906
1907 \fclass-environment
1908 @c snarfed from goops.c:1043
1909 @deffn {Scheme Procedure} class-environment obj
1910 @deffnx {C Function} scm_class_environment (obj)
1911 Return the environment of the class @var{obj}.
1912 @end deffn
1913
1914 \fgeneric-function-name
1915 @c snarfed from goops.c:1054
1916 @deffn {Scheme Procedure} generic-function-name obj
1917 @deffnx {C Function} scm_generic_function_name (obj)
1918 Return the name of the generic function @var{obj}.
1919 @end deffn
1920
1921 \fgeneric-function-methods
1922 @c snarfed from goops.c:1099
1923 @deffn {Scheme Procedure} generic-function-methods obj
1924 @deffnx {C Function} scm_generic_function_methods (obj)
1925 Return the methods of the generic function @var{obj}.
1926 @end deffn
1927
1928 \fmethod-generic-function
1929 @c snarfed from goops.c:1112
1930 @deffn {Scheme Procedure} method-generic-function obj
1931 @deffnx {C Function} scm_method_generic_function (obj)
1932 Return the generic function for the method @var{obj}.
1933 @end deffn
1934
1935 \fmethod-specializers
1936 @c snarfed from goops.c:1122
1937 @deffn {Scheme Procedure} method-specializers obj
1938 @deffnx {C Function} scm_method_specializers (obj)
1939 Return specializers of the method @var{obj}.
1940 @end deffn
1941
1942 \fmethod-procedure
1943 @c snarfed from goops.c:1132
1944 @deffn {Scheme Procedure} method-procedure obj
1945 @deffnx {C Function} scm_method_procedure (obj)
1946 Return the procedure of the method @var{obj}.
1947 @end deffn
1948
1949 \faccessor-method-slot-definition
1950 @c snarfed from goops.c:1142
1951 @deffn {Scheme Procedure} accessor-method-slot-definition obj
1952 @deffnx {C Function} scm_accessor_method_slot_definition (obj)
1953 Return the slot definition of the accessor @var{obj}.
1954 @end deffn
1955
1956 \f%tag-body
1957 @c snarfed from goops.c:1152
1958 @deffn {Scheme Procedure} %tag-body body
1959 @deffnx {C Function} scm_sys_tag_body (body)
1960 Internal GOOPS magic---don't use this function!
1961 @end deffn
1962
1963 \fmake-unbound
1964 @c snarfed from goops.c:1167
1965 @deffn {Scheme Procedure} make-unbound
1966 @deffnx {C Function} scm_make_unbound ()
1967 Return the unbound value.
1968 @end deffn
1969
1970 \funbound?
1971 @c snarfed from goops.c:1176
1972 @deffn {Scheme Procedure} unbound? obj
1973 @deffnx {C Function} scm_unbound_p (obj)
1974 Return @code{#t} if @var{obj} is unbound.
1975 @end deffn
1976
1977 \fassert-bound
1978 @c snarfed from goops.c:1186
1979 @deffn {Scheme Procedure} assert-bound value obj
1980 @deffnx {C Function} scm_assert_bound (value, obj)
1981 Return @var{value} if it is bound, and invoke the
1982 @var{slot-unbound} method of @var{obj} if it is not.
1983 @end deffn
1984
1985 \f@@assert-bound-ref
1986 @c snarfed from goops.c:1198
1987 @deffn {Scheme Procedure} @@assert-bound-ref obj index
1988 @deffnx {C Function} scm_at_assert_bound_ref (obj, index)
1989 Like @code{assert-bound}, but use @var{index} for accessing
1990 the value from @var{obj}.
1991 @end deffn
1992
1993 \f%fast-slot-ref
1994 @c snarfed from goops.c:1210
1995 @deffn {Scheme Procedure} %fast-slot-ref obj index
1996 @deffnx {C Function} scm_sys_fast_slot_ref (obj, index)
1997 Return the slot value with index @var{index} from @var{obj}.
1998 @end deffn
1999
2000 \f%fast-slot-set!
2001 @c snarfed from goops.c:1224
2002 @deffn {Scheme Procedure} %fast-slot-set! obj index value
2003 @deffnx {C Function} scm_sys_fast_slot_set_x (obj, index, value)
2004 Set the slot with index @var{index} in @var{obj} to
2005 @var{value}.
2006 @end deffn
2007
2008 \fslot-ref-using-class
2009 @c snarfed from goops.c:1361
2010 @deffn {Scheme Procedure} slot-ref-using-class class obj slot_name
2011 @deffnx {C Function} scm_slot_ref_using_class (class, obj, slot_name)
2012
2013 @end deffn
2014
2015 \fslot-set-using-class!
2016 @c snarfed from goops.c:1380
2017 @deffn {Scheme Procedure} slot-set-using-class! class obj slot_name value
2018 @deffnx {C Function} scm_slot_set_using_class_x (class, obj, slot_name, value)
2019
2020 @end deffn
2021
2022 \fslot-bound-using-class?
2023 @c snarfed from goops.c:1394
2024 @deffn {Scheme Procedure} slot-bound-using-class? class obj slot_name
2025 @deffnx {C Function} scm_slot_bound_using_class_p (class, obj, slot_name)
2026
2027 @end deffn
2028
2029 \fslot-exists-using-class?
2030 @c snarfed from goops.c:1409
2031 @deffn {Scheme Procedure} slot-exists-using-class? class obj slot_name
2032 @deffnx {C Function} scm_slot_exists_using_class_p (class, obj, slot_name)
2033
2034 @end deffn
2035
2036 \fslot-ref
2037 @c snarfed from goops.c:1425
2038 @deffn {Scheme Procedure} slot-ref obj slot_name
2039 @deffnx {C Function} scm_slot_ref (obj, slot_name)
2040 Return the value from @var{obj}'s slot with the name
2041 @var{slot_name}.
2042 @end deffn
2043
2044 \fslot-set!
2045 @c snarfed from goops.c:1442
2046 @deffn {Scheme Procedure} slot-set! obj slot_name value
2047 @deffnx {C Function} scm_slot_set_x (obj, slot_name, value)
2048 Set the slot named @var{slot_name} of @var{obj} to @var{value}.
2049 @end deffn
2050
2051 \fslot-bound?
2052 @c snarfed from goops.c:1459
2053 @deffn {Scheme Procedure} slot-bound? obj slot_name
2054 @deffnx {C Function} scm_slot_bound_p (obj, slot_name)
2055 Return @code{#t} if the slot named @var{slot_name} of @var{obj}
2056 is bound.
2057 @end deffn
2058
2059 \fslot-exists?
2060 @c snarfed from goops.c:1477
2061 @deffn {Scheme Procedure} slot-exists? obj slot_name
2062 @deffnx {C Function} scm_slot_exists_p (obj, slot_name)
2063 Return @code{#t} if @var{obj} has a slot named @var{slot_name}.
2064 @end deffn
2065
2066 \f%allocate-instance
2067 @c snarfed from goops.c:1516
2068 @deffn {Scheme Procedure} %allocate-instance class initargs
2069 @deffnx {C Function} scm_sys_allocate_instance (class, initargs)
2070 Create a new instance of class @var{class} and initialize it
2071 from the arguments @var{initargs}.
2072 @end deffn
2073
2074 \f%set-object-setter!
2075 @c snarfed from goops.c:1586
2076 @deffn {Scheme Procedure} %set-object-setter! obj setter
2077 @deffnx {C Function} scm_sys_set_object_setter_x (obj, setter)
2078
2079 @end deffn
2080
2081 \f%modify-instance
2082 @c snarfed from goops.c:1611
2083 @deffn {Scheme Procedure} %modify-instance old new
2084 @deffnx {C Function} scm_sys_modify_instance (old, new)
2085
2086 @end deffn
2087
2088 \f%modify-class
2089 @c snarfed from goops.c:1637
2090 @deffn {Scheme Procedure} %modify-class old new
2091 @deffnx {C Function} scm_sys_modify_class (old, new)
2092
2093 @end deffn
2094
2095 \f%invalidate-class
2096 @c snarfed from goops.c:1661
2097 @deffn {Scheme Procedure} %invalidate-class class
2098 @deffnx {C Function} scm_sys_invalidate_class (class)
2099
2100 @end deffn
2101
2102 \f%invalidate-method-cache!
2103 @c snarfed from goops.c:1783
2104 @deffn {Scheme Procedure} %invalidate-method-cache! gf
2105 @deffnx {C Function} scm_sys_invalidate_method_cache_x (gf)
2106
2107 @end deffn
2108
2109 \fgeneric-capability?
2110 @c snarfed from goops.c:1809
2111 @deffn {Scheme Procedure} generic-capability? proc
2112 @deffnx {C Function} scm_generic_capability_p (proc)
2113
2114 @end deffn
2115
2116 \fenable-primitive-generic!
2117 @c snarfed from goops.c:1822
2118 @deffn {Scheme Procedure} enable-primitive-generic! . subrs
2119 @deffnx {C Function} scm_enable_primitive_generic_x (subrs)
2120
2121 @end deffn
2122
2123 \fprimitive-generic-generic
2124 @c snarfed from goops.c:1843
2125 @deffn {Scheme Procedure} primitive-generic-generic subr
2126 @deffnx {C Function} scm_primitive_generic_generic (subr)
2127
2128 @end deffn
2129
2130 \fmake
2131 @c snarfed from goops.c:2209
2132 @deffn {Scheme Procedure} make . args
2133 @deffnx {C Function} scm_make (args)
2134 Make a new object. @var{args} must contain the class and
2135 all necessary initialization information.
2136 @end deffn
2137
2138 \ffind-method
2139 @c snarfed from goops.c:2298
2140 @deffn {Scheme Procedure} find-method . l
2141 @deffnx {C Function} scm_find_method (l)
2142
2143 @end deffn
2144
2145 \f%method-more-specific?
2146 @c snarfed from goops.c:2318
2147 @deffn {Scheme Procedure} %method-more-specific? m1 m2 targs
2148 @deffnx {C Function} scm_sys_method_more_specific_p (m1, m2, targs)
2149
2150 @end deffn
2151
2152 \f%goops-loaded
2153 @c snarfed from goops.c:2944
2154 @deffn {Scheme Procedure} %goops-loaded
2155 @deffnx {C Function} scm_sys_goops_loaded ()
2156 Announce that GOOPS is loaded and perform initialization
2157 on the C level which depends on the loaded GOOPS modules.
2158 @end deffn
2159
2160 \fmake-guardian
2161 @c snarfed from guardians.c:307
2162 @deffn {Scheme Procedure} make-guardian [greedy_p]
2163 @deffnx {C Function} scm_make_guardian (greedy_p)
2164 Create a new guardian.
2165 A guardian protects a set of objects from garbage collection,
2166 allowing a program to apply cleanup or other actions.
2167
2168 @code{make-guardian} returns a procedure representing the guardian.
2169 Calling the guardian procedure with an argument adds the
2170 argument to the guardian's set of protected objects.
2171 Calling the guardian procedure without an argument returns
2172 one of the protected objects which are ready for garbage
2173 collection, or @code{#f} if no such object is available.
2174 Objects which are returned in this way are removed from
2175 the guardian.
2176
2177 @code{make-guardian} takes one optional argument that says whether the
2178 new guardian should be greedy or sharing. If there is any chance
2179 that any object protected by the guardian may be resurrected,
2180 then you should make the guardian greedy (this is the default).
2181
2182 See R. Kent Dybvig, Carl Bruggeman, and David Eby (1993)
2183 "Guardians in a Generation-Based Garbage Collector".
2184 ACM SIGPLAN Conference on Programming Language Design
2185 and Implementation, June 1993.
2186
2187 (the semantics are slightly different at this point, but the
2188 paper still (mostly) accurately describes the interface).
2189 @end deffn
2190
2191 \fguardian-destroyed?
2192 @c snarfed from guardians.c:335
2193 @deffn {Scheme Procedure} guardian-destroyed? guardian
2194 @deffnx {C Function} scm_guardian_destroyed_p (guardian)
2195 Return @code{#t} if @var{guardian} has been destroyed, otherwise @code{#f}.
2196 @end deffn
2197
2198 \fguardian-greedy?
2199 @c snarfed from guardians.c:353
2200 @deffn {Scheme Procedure} guardian-greedy? guardian
2201 @deffnx {C Function} scm_guardian_greedy_p (guardian)
2202 Return @code{#t} if @var{guardian} is a greedy guardian, otherwise @code{#f}.
2203 @end deffn
2204
2205 \fdestroy-guardian!
2206 @c snarfed from guardians.c:364
2207 @deffn {Scheme Procedure} destroy-guardian! guardian
2208 @deffnx {C Function} scm_destroy_guardian_x (guardian)
2209 Destroys @var{guardian}, by making it impossible to put any more
2210 objects in it or get any objects from it. It also unguards any
2211 objects guarded by @var{guardian}.
2212 @end deffn
2213
2214 \fhashq
2215 @c snarfed from hash.c:183
2216 @deffn {Scheme Procedure} hashq key size
2217 @deffnx {C Function} scm_hashq (key, size)
2218 Determine a hash value for @var{key} that is suitable for
2219 lookups in a hashtable of size @var{size}, where @code{eq?} is
2220 used as the equality predicate. The function returns an
2221 integer in the range 0 to @var{size} - 1. Note that
2222 @code{hashq} may use internal addresses. Thus two calls to
2223 hashq where the keys are @code{eq?} are not guaranteed to
2224 deliver the same value if the key object gets garbage collected
2225 in between. This can happen, for example with symbols:
2226 @code{(hashq 'foo n) (gc) (hashq 'foo n)} may produce two
2227 different values, since @code{foo} will be garbage collected.
2228 @end deffn
2229
2230 \fhashv
2231 @c snarfed from hash.c:219
2232 @deffn {Scheme Procedure} hashv key size
2233 @deffnx {C Function} scm_hashv (key, size)
2234 Determine a hash value for @var{key} that is suitable for
2235 lookups in a hashtable of size @var{size}, where @code{eqv?} is
2236 used as the equality predicate. The function returns an
2237 integer in the range 0 to @var{size} - 1. Note that
2238 @code{(hashv key)} may use internal addresses. Thus two calls
2239 to hashv where the keys are @code{eqv?} are not guaranteed to
2240 deliver the same value if the key object gets garbage collected
2241 in between. This can happen, for example with symbols:
2242 @code{(hashv 'foo n) (gc) (hashv 'foo n)} may produce two
2243 different values, since @code{foo} will be garbage collected.
2244 @end deffn
2245
2246 \fhash
2247 @c snarfed from hash.c:242
2248 @deffn {Scheme Procedure} hash key size
2249 @deffnx {C Function} scm_hash (key, size)
2250 Determine a hash value for @var{key} that is suitable for
2251 lookups in a hashtable of size @var{size}, where @code{equal?}
2252 is used as the equality predicate. The function returns an
2253 integer in the range 0 to @var{size} - 1.
2254 @end deffn
2255
2256 \fmake-hash-table
2257 @c snarfed from hashtab.c:332
2258 @deffn {Scheme Procedure} make-hash-table [n]
2259 @deffnx {C Function} scm_make_hash_table (n)
2260 Make a new abstract hash table object with minimum number of buckets @var{n}
2261
2262 @end deffn
2263
2264 \fmake-weak-key-hash-table
2265 @c snarfed from hashtab.c:349
2266 @deffn {Scheme Procedure} make-weak-key-hash-table [n]
2267 @deffnx {Scheme Procedure} make-weak-value-hash-table size
2268 @deffnx {Scheme Procedure} make-doubly-weak-hash-table size
2269 @deffnx {C Function} scm_make_weak_key_hash_table (n)
2270 Return a weak hash table with @var{size} buckets.
2271
2272 You can modify weak hash tables in exactly the same way you
2273 would modify regular hash tables. (@pxref{Hash Tables})
2274 @end deffn
2275
2276 \fmake-weak-value-hash-table
2277 @c snarfed from hashtab.c:364
2278 @deffn {Scheme Procedure} make-weak-value-hash-table [n]
2279 @deffnx {C Function} scm_make_weak_value_hash_table (n)
2280 Return a hash table with weak values with @var{size} buckets.
2281 (@pxref{Hash Tables})
2282 @end deffn
2283
2284 \fmake-doubly-weak-hash-table
2285 @c snarfed from hashtab.c:381
2286 @deffn {Scheme Procedure} make-doubly-weak-hash-table n
2287 @deffnx {C Function} scm_make_doubly_weak_hash_table (n)
2288 Return a hash table with weak keys and values with @var{size}
2289 buckets. (@pxref{Hash Tables})
2290 @end deffn
2291
2292 \fhash-table?
2293 @c snarfed from hashtab.c:400
2294 @deffn {Scheme Procedure} hash-table? obj
2295 @deffnx {C Function} scm_hash_table_p (obj)
2296 Return @code{#t} if @var{obj} is an abstract hash table object.
2297 @end deffn
2298
2299 \fweak-key-hash-table?
2300 @c snarfed from hashtab.c:414
2301 @deffn {Scheme Procedure} weak-key-hash-table? obj
2302 @deffnx {Scheme Procedure} weak-value-hash-table? obj
2303 @deffnx {Scheme Procedure} doubly-weak-hash-table? obj
2304 @deffnx {C Function} scm_weak_key_hash_table_p (obj)
2305 Return @code{#t} if @var{obj} is the specified weak hash
2306 table. Note that a doubly weak hash table is neither a weak key
2307 nor a weak value hash table.
2308 @end deffn
2309
2310 \fweak-value-hash-table?
2311 @c snarfed from hashtab.c:424
2312 @deffn {Scheme Procedure} weak-value-hash-table? obj
2313 @deffnx {C Function} scm_weak_value_hash_table_p (obj)
2314 Return @code{#t} if @var{obj} is a weak value hash table.
2315 @end deffn
2316
2317 \fdoubly-weak-hash-table?
2318 @c snarfed from hashtab.c:434
2319 @deffn {Scheme Procedure} doubly-weak-hash-table? obj
2320 @deffnx {C Function} scm_doubly_weak_hash_table_p (obj)
2321 Return @code{#t} if @var{obj} is a doubly weak hash table.
2322 @end deffn
2323
2324 \fhash-clear!
2325 @c snarfed from hashtab.c:586
2326 @deffn {Scheme Procedure} hash-clear! table
2327 @deffnx {C Function} scm_hash_clear_x (table)
2328 Remove all items from @var{table} (without triggering a resize).
2329 @end deffn
2330
2331 \fhashq-get-handle
2332 @c snarfed from hashtab.c:607
2333 @deffn {Scheme Procedure} hashq-get-handle table key
2334 @deffnx {C Function} scm_hashq_get_handle (table, key)
2335 This procedure returns the @code{(key . value)} pair from the
2336 hash table @var{table}. If @var{table} does not hold an
2337 associated value for @var{key}, @code{#f} is returned.
2338 Uses @code{eq?} for equality testing.
2339 @end deffn
2340
2341 \fhashq-create-handle!
2342 @c snarfed from hashtab.c:619
2343 @deffn {Scheme Procedure} hashq-create-handle! table key init
2344 @deffnx {C Function} scm_hashq_create_handle_x (table, key, init)
2345 This function looks up @var{key} in @var{table} and returns its handle.
2346 If @var{key} is not already present, a new handle is created which
2347 associates @var{key} with @var{init}.
2348 @end deffn
2349
2350 \fhashq-ref
2351 @c snarfed from hashtab.c:632
2352 @deffn {Scheme Procedure} hashq-ref table key [dflt]
2353 @deffnx {C Function} scm_hashq_ref (table, key, dflt)
2354 Look up @var{key} in the hash table @var{table}, and return the
2355 value (if any) associated with it. If @var{key} is not found,
2356 return @var{default} (or @code{#f} if no @var{default} argument
2357 is supplied). Uses @code{eq?} for equality testing.
2358 @end deffn
2359
2360 \fhashq-set!
2361 @c snarfed from hashtab.c:646
2362 @deffn {Scheme Procedure} hashq-set! table key val
2363 @deffnx {C Function} scm_hashq_set_x (table, key, val)
2364 Find the entry in @var{table} associated with @var{key}, and
2365 store @var{value} there. Uses @code{eq?} for equality testing.
2366 @end deffn
2367
2368 \fhashq-remove!
2369 @c snarfed from hashtab.c:658
2370 @deffn {Scheme Procedure} hashq-remove! table key
2371 @deffnx {C Function} scm_hashq_remove_x (table, key)
2372 Remove @var{key} (and any value associated with it) from
2373 @var{table}. Uses @code{eq?} for equality tests.
2374 @end deffn
2375
2376 \fhashv-get-handle
2377 @c snarfed from hashtab.c:673
2378 @deffn {Scheme Procedure} hashv-get-handle table key
2379 @deffnx {C Function} scm_hashv_get_handle (table, key)
2380 This procedure returns the @code{(key . value)} pair from the
2381 hash table @var{table}. If @var{table} does not hold an
2382 associated value for @var{key}, @code{#f} is returned.
2383 Uses @code{eqv?} for equality testing.
2384 @end deffn
2385
2386 \fhashv-create-handle!
2387 @c snarfed from hashtab.c:685
2388 @deffn {Scheme Procedure} hashv-create-handle! table key init
2389 @deffnx {C Function} scm_hashv_create_handle_x (table, key, init)
2390 This function looks up @var{key} in @var{table} and returns its handle.
2391 If @var{key} is not already present, a new handle is created which
2392 associates @var{key} with @var{init}.
2393 @end deffn
2394
2395 \fhashv-ref
2396 @c snarfed from hashtab.c:699
2397 @deffn {Scheme Procedure} hashv-ref table key [dflt]
2398 @deffnx {C Function} scm_hashv_ref (table, key, dflt)
2399 Look up @var{key} in the hash table @var{table}, and return the
2400 value (if any) associated with it. If @var{key} is not found,
2401 return @var{default} (or @code{#f} if no @var{default} argument
2402 is supplied). Uses @code{eqv?} for equality testing.
2403 @end deffn
2404
2405 \fhashv-set!
2406 @c snarfed from hashtab.c:713
2407 @deffn {Scheme Procedure} hashv-set! table key val
2408 @deffnx {C Function} scm_hashv_set_x (table, key, val)
2409 Find the entry in @var{table} associated with @var{key}, and
2410 store @var{value} there. Uses @code{eqv?} for equality testing.
2411 @end deffn
2412
2413 \fhashv-remove!
2414 @c snarfed from hashtab.c:724
2415 @deffn {Scheme Procedure} hashv-remove! table key
2416 @deffnx {C Function} scm_hashv_remove_x (table, key)
2417 Remove @var{key} (and any value associated with it) from
2418 @var{table}. Uses @code{eqv?} for equality tests.
2419 @end deffn
2420
2421 \fhash-get-handle
2422 @c snarfed from hashtab.c:738
2423 @deffn {Scheme Procedure} hash-get-handle table key
2424 @deffnx {C Function} scm_hash_get_handle (table, key)
2425 This procedure returns the @code{(key . value)} pair from the
2426 hash table @var{table}. If @var{table} does not hold an
2427 associated value for @var{key}, @code{#f} is returned.
2428 Uses @code{equal?} for equality testing.
2429 @end deffn
2430
2431 \fhash-create-handle!
2432 @c snarfed from hashtab.c:750
2433 @deffn {Scheme Procedure} hash-create-handle! table key init
2434 @deffnx {C Function} scm_hash_create_handle_x (table, key, init)
2435 This function looks up @var{key} in @var{table} and returns its handle.
2436 If @var{key} is not already present, a new handle is created which
2437 associates @var{key} with @var{init}.
2438 @end deffn
2439
2440 \fhash-ref
2441 @c snarfed from hashtab.c:763
2442 @deffn {Scheme Procedure} hash-ref table key [dflt]
2443 @deffnx {C Function} scm_hash_ref (table, key, dflt)
2444 Look up @var{key} in the hash table @var{table}, and return the
2445 value (if any) associated with it. If @var{key} is not found,
2446 return @var{default} (or @code{#f} if no @var{default} argument
2447 is supplied). Uses @code{equal?} for equality testing.
2448 @end deffn
2449
2450 \fhash-set!
2451 @c snarfed from hashtab.c:778
2452 @deffn {Scheme Procedure} hash-set! table key val
2453 @deffnx {C Function} scm_hash_set_x (table, key, val)
2454 Find the entry in @var{table} associated with @var{key}, and
2455 store @var{value} there. Uses @code{equal?} for equality
2456 testing.
2457 @end deffn
2458
2459 \fhash-remove!
2460 @c snarfed from hashtab.c:790
2461 @deffn {Scheme Procedure} hash-remove! table key
2462 @deffnx {C Function} scm_hash_remove_x (table, key)
2463 Remove @var{key} (and any value associated with it) from
2464 @var{table}. Uses @code{equal?} for equality tests.
2465 @end deffn
2466
2467 \fhashx-get-handle
2468 @c snarfed from hashtab.c:831
2469 @deffn {Scheme Procedure} hashx-get-handle hash assoc table key
2470 @deffnx {C Function} scm_hashx_get_handle (hash, assoc, table, key)
2471 This behaves the same way as the corresponding
2472 @code{-get-handle} function, but uses @var{hash} as a hash
2473 function and @var{assoc} to compare keys. @code{hash} must be
2474 a function that takes two arguments, a key to be hashed and a
2475 table size. @code{assoc} must be an associator function, like
2476 @code{assoc}, @code{assq} or @code{assv}.
2477 @end deffn
2478
2479 \fhashx-create-handle!
2480 @c snarfed from hashtab.c:850
2481 @deffn {Scheme Procedure} hashx-create-handle! hash assoc table key init
2482 @deffnx {C Function} scm_hashx_create_handle_x (hash, assoc, table, key, init)
2483 This behaves the same way as the corresponding
2484 @code{-create-handle} function, but uses @var{hash} as a hash
2485 function and @var{assoc} to compare keys. @code{hash} must be
2486 a function that takes two arguments, a key to be hashed and a
2487 table size. @code{assoc} must be an associator function, like
2488 @code{assoc}, @code{assq} or @code{assv}.
2489 @end deffn
2490
2491 \fhashx-ref
2492 @c snarfed from hashtab.c:873
2493 @deffn {Scheme Procedure} hashx-ref hash assoc table key [dflt]
2494 @deffnx {C Function} scm_hashx_ref (hash, assoc, table, key, dflt)
2495 This behaves the same way as the corresponding @code{ref}
2496 function, but uses @var{hash} as a hash function and
2497 @var{assoc} to compare keys. @code{hash} must be a function
2498 that takes two arguments, a key to be hashed and a table size.
2499 @code{assoc} must be an associator function, like @code{assoc},
2500 @code{assq} or @code{assv}.
2501
2502 By way of illustration, @code{hashq-ref table key} is
2503 equivalent to @code{hashx-ref hashq assq table key}.
2504 @end deffn
2505
2506 \fhashx-set!
2507 @c snarfed from hashtab.c:899
2508 @deffn {Scheme Procedure} hashx-set! hash assoc table key val
2509 @deffnx {C Function} scm_hashx_set_x (hash, assoc, table, key, val)
2510 This behaves the same way as the corresponding @code{set!}
2511 function, but uses @var{hash} as a hash function and
2512 @var{assoc} to compare keys. @code{hash} must be a function
2513 that takes two arguments, a key to be hashed and a table size.
2514 @code{assoc} must be an associator function, like @code{assoc},
2515 @code{assq} or @code{assv}.
2516
2517 By way of illustration, @code{hashq-set! table key} is
2518 equivalent to @code{hashx-set! hashq assq table key}.
2519 @end deffn
2520
2521 \fhashx-remove!
2522 @c snarfed from hashtab.c:920
2523 @deffn {Scheme Procedure} hashx-remove! hash assoc table obj
2524 @deffnx {C Function} scm_hashx_remove_x (hash, assoc, table, obj)
2525 This behaves the same way as the corresponding @code{remove!}
2526 function, but uses @var{hash} as a hash function and
2527 @var{assoc} to compare keys. @code{hash} must be a function
2528 that takes two arguments, a key to be hashed and a table size.
2529 @code{assoc} must be an associator function, like @code{assoc},
2530 @code{assq} or @code{assv}.
2531
2532 By way of illustration, @code{hashq-remove! table key} is
2533 equivalent to @code{hashx-remove! hashq assq #f table key}.
2534 @end deffn
2535
2536 \fhash-fold
2537 @c snarfed from hashtab.c:1009
2538 @deffn {Scheme Procedure} hash-fold proc init table
2539 @deffnx {C Function} scm_hash_fold (proc, init, table)
2540 An iterator over hash-table elements.
2541 Accumulates and returns a result by applying PROC successively.
2542 The arguments to PROC are "(key value prior-result)" where key
2543 and value are successive pairs from the hash table TABLE, and
2544 prior-result is either INIT (for the first application of PROC)
2545 or the return value of the previous application of PROC.
2546 For example, @code{(hash-fold acons '() tab)} will convert a hash
2547 table into an a-list of key-value pairs.
2548 @end deffn
2549
2550 \fhash-for-each
2551 @c snarfed from hashtab.c:1030
2552 @deffn {Scheme Procedure} hash-for-each proc table
2553 @deffnx {C Function} scm_hash_for_each (proc, table)
2554 An iterator over hash-table elements.
2555 Applies PROC successively on all hash table items.
2556 The arguments to PROC are "(key value)" where key
2557 and value are successive pairs from the hash table TABLE.
2558 @end deffn
2559
2560 \fhash-for-each-handle
2561 @c snarfed from hashtab.c:1047
2562 @deffn {Scheme Procedure} hash-for-each-handle proc table
2563 @deffnx {C Function} scm_hash_for_each_handle (proc, table)
2564 An iterator over hash-table elements.
2565 Applies PROC successively on all hash table handles.
2566 @end deffn
2567
2568 \fhash-map->list
2569 @c snarfed from hashtab.c:1073
2570 @deffn {Scheme Procedure} hash-map->list proc table
2571 @deffnx {C Function} scm_hash_map_to_list (proc, table)
2572 An iterator over hash-table elements.
2573 Accumulates and returns as a list the results of applying PROC successively.
2574 The arguments to PROC are "(key value)" where key
2575 and value are successive pairs from the hash table TABLE.
2576 @end deffn
2577
2578 \fmake-hook
2579 @c snarfed from hooks.c:154
2580 @deffn {Scheme Procedure} make-hook [n_args]
2581 @deffnx {C Function} scm_make_hook (n_args)
2582 Create a hook for storing procedure of arity @var{n_args}.
2583 @var{n_args} defaults to zero. The returned value is a hook
2584 object to be used with the other hook procedures.
2585 @end deffn
2586
2587 \fhook?
2588 @c snarfed from hooks.c:171
2589 @deffn {Scheme Procedure} hook? x
2590 @deffnx {C Function} scm_hook_p (x)
2591 Return @code{#t} if @var{x} is a hook, @code{#f} otherwise.
2592 @end deffn
2593
2594 \fhook-empty?
2595 @c snarfed from hooks.c:182
2596 @deffn {Scheme Procedure} hook-empty? hook
2597 @deffnx {C Function} scm_hook_empty_p (hook)
2598 Return @code{#t} if @var{hook} is an empty hook, @code{#f}
2599 otherwise.
2600 @end deffn
2601
2602 \fadd-hook!
2603 @c snarfed from hooks.c:196
2604 @deffn {Scheme Procedure} add-hook! hook proc [append_p]
2605 @deffnx {C Function} scm_add_hook_x (hook, proc, append_p)
2606 Add the procedure @var{proc} to the hook @var{hook}. The
2607 procedure is added to the end if @var{append_p} is true,
2608 otherwise it is added to the front. The return value of this
2609 procedure is not specified.
2610 @end deffn
2611
2612 \fremove-hook!
2613 @c snarfed from hooks.c:223
2614 @deffn {Scheme Procedure} remove-hook! hook proc
2615 @deffnx {C Function} scm_remove_hook_x (hook, proc)
2616 Remove the procedure @var{proc} from the hook @var{hook}. The
2617 return value of this procedure is not specified.
2618 @end deffn
2619
2620 \freset-hook!
2621 @c snarfed from hooks.c:237
2622 @deffn {Scheme Procedure} reset-hook! hook
2623 @deffnx {C Function} scm_reset_hook_x (hook)
2624 Remove all procedures from the hook @var{hook}. The return
2625 value of this procedure is not specified.
2626 @end deffn
2627
2628 \frun-hook
2629 @c snarfed from hooks.c:251
2630 @deffn {Scheme Procedure} run-hook hook . args
2631 @deffnx {C Function} scm_run_hook (hook, args)
2632 Apply all procedures from the hook @var{hook} to the arguments
2633 @var{args}. The order of the procedure application is first to
2634 last. The return value of this procedure is not specified.
2635 @end deffn
2636
2637 \fhook->list
2638 @c snarfed from hooks.c:278
2639 @deffn {Scheme Procedure} hook->list hook
2640 @deffnx {C Function} scm_hook_to_list (hook)
2641 Convert the procedure list of @var{hook} to a list.
2642 @end deffn
2643
2644 \fgettext
2645 @c snarfed from i18n.c:90
2646 @deffn {Scheme Procedure} gettext msgid [domain [category]]
2647 @deffnx {C Function} scm_gettext (msgid, domain, category)
2648 Return the translation of @var{msgid} in the message domain @var{domain}. @var{domain} is optional and defaults to the domain set through (textdomain). @var{category} is optional and defaults to LC_MESSAGES.
2649 @end deffn
2650
2651 \fngettext
2652 @c snarfed from i18n.c:146
2653 @deffn {Scheme Procedure} ngettext msgid msgid_plural n [domain [category]]
2654 @deffnx {C Function} scm_ngettext (msgid, msgid_plural, n, domain, category)
2655 Return the translation of @var{msgid}/@var{msgid_plural} in the message domain @var{domain}, with the plural form being chosen appropriately for the number @var{n}. @var{domain} is optional and defaults to the domain set through (textdomain). @var{category} is optional and defaults to LC_MESSAGES.
2656 @end deffn
2657
2658 \ftextdomain
2659 @c snarfed from i18n.c:209
2660 @deffn {Scheme Procedure} textdomain [domainname]
2661 @deffnx {C Function} scm_textdomain (domainname)
2662 If optional parameter @var{domainname} is supplied, set the textdomain. Return the textdomain.
2663 @end deffn
2664
2665 \fbindtextdomain
2666 @c snarfed from i18n.c:241
2667 @deffn {Scheme Procedure} bindtextdomain domainname [directory]
2668 @deffnx {C Function} scm_bindtextdomain (domainname, directory)
2669 If optional parameter @var{directory} is supplied, set message catalogs to directory @var{directory}. Return the directory bound to @var{domainname}.
2670 @end deffn
2671
2672 \fbind-textdomain-codeset
2673 @c snarfed from i18n.c:280
2674 @deffn {Scheme Procedure} bind-textdomain-codeset domainname [encoding]
2675 @deffnx {C Function} scm_bind_textdomain_codeset (domainname, encoding)
2676 If optional parameter @var{encoding} is supplied, set encoding for message catalogs of @var{domainname}. Return the encoding of @var{domainname}.
2677 @end deffn
2678
2679 \fftell
2680 @c snarfed from ioext.c:54
2681 @deffn {Scheme Procedure} ftell fd_port
2682 @deffnx {C Function} scm_ftell (fd_port)
2683 Return an integer representing the current position of
2684 @var{fd/port}, measured from the beginning. Equivalent to:
2685
2686 @lisp
2687 (seek port 0 SEEK_CUR)
2688 @end lisp
2689 @end deffn
2690
2691 \fredirect-port
2692 @c snarfed from ioext.c:72
2693 @deffn {Scheme Procedure} redirect-port old new
2694 @deffnx {C Function} scm_redirect_port (old, new)
2695 This procedure takes two ports and duplicates the underlying file
2696 descriptor from @var{old-port} into @var{new-port}. The
2697 current file descriptor in @var{new-port} will be closed.
2698 After the redirection the two ports will share a file position
2699 and file status flags.
2700
2701 The return value is unspecified.
2702
2703 Unexpected behaviour can result if both ports are subsequently used
2704 and the original and/or duplicate ports are buffered.
2705
2706 This procedure does not have any side effects on other ports or
2707 revealed counts.
2708 @end deffn
2709
2710 \fdup->fdes
2711 @c snarfed from ioext.c:111
2712 @deffn {Scheme Procedure} dup->fdes fd_or_port [fd]
2713 @deffnx {C Function} scm_dup_to_fdes (fd_or_port, fd)
2714 Return a new integer file descriptor referring to the open file
2715 designated by @var{fd_or_port}, which must be either an open
2716 file port or a file descriptor.
2717 @end deffn
2718
2719 \fdup2
2720 @c snarfed from ioext.c:158
2721 @deffn {Scheme Procedure} dup2 oldfd newfd
2722 @deffnx {C Function} scm_dup2 (oldfd, newfd)
2723 A simple wrapper for the @code{dup2} system call.
2724 Copies the file descriptor @var{oldfd} to descriptor
2725 number @var{newfd}, replacing the previous meaning
2726 of @var{newfd}. Both @var{oldfd} and @var{newfd} must
2727 be integers.
2728 Unlike for dup->fdes or primitive-move->fdes, no attempt
2729 is made to move away ports which are using @var{newfd}.
2730 The return value is unspecified.
2731 @end deffn
2732
2733 \ffileno
2734 @c snarfed from ioext.c:177
2735 @deffn {Scheme Procedure} fileno port
2736 @deffnx {C Function} scm_fileno (port)
2737 Return the integer file descriptor underlying @var{port}. Does
2738 not change its revealed count.
2739 @end deffn
2740
2741 \fisatty?
2742 @c snarfed from ioext.c:197
2743 @deffn {Scheme Procedure} isatty? port
2744 @deffnx {C Function} scm_isatty_p (port)
2745 Return @code{#t} if @var{port} is using a serial non--file
2746 device, otherwise @code{#f}.
2747 @end deffn
2748
2749 \ffdopen
2750 @c snarfed from ioext.c:219
2751 @deffn {Scheme Procedure} fdopen fdes modes
2752 @deffnx {C Function} scm_fdopen (fdes, modes)
2753 Return a new port based on the file descriptor @var{fdes}.
2754 Modes are given by the string @var{modes}. The revealed count
2755 of the port is initialized to zero. The modes string is the
2756 same as that accepted by @ref{File Ports, open-file}.
2757 @end deffn
2758
2759 \fprimitive-move->fdes
2760 @c snarfed from ioext.c:241
2761 @deffn {Scheme Procedure} primitive-move->fdes port fd
2762 @deffnx {C Function} scm_primitive_move_to_fdes (port, fd)
2763 Moves the underlying file descriptor for @var{port} to the integer
2764 value @var{fdes} without changing the revealed count of @var{port}.
2765 Any other ports already using this descriptor will be automatically
2766 shifted to new descriptors and their revealed counts reset to zero.
2767 The return value is @code{#f} if the file descriptor already had the
2768 required value or @code{#t} if it was moved.
2769 @end deffn
2770
2771 \ffdes->ports
2772 @c snarfed from ioext.c:274
2773 @deffn {Scheme Procedure} fdes->ports fd
2774 @deffnx {C Function} scm_fdes_to_ports (fd)
2775 Return a list of existing ports which have @var{fdes} as an
2776 underlying file descriptor, without changing their revealed
2777 counts.
2778 @end deffn
2779
2780 \fkeyword?
2781 @c snarfed from keywords.c:52
2782 @deffn {Scheme Procedure} keyword? obj
2783 @deffnx {C Function} scm_keyword_p (obj)
2784 Return @code{#t} if the argument @var{obj} is a keyword, else
2785 @code{#f}.
2786 @end deffn
2787
2788 \fsymbol->keyword
2789 @c snarfed from keywords.c:61
2790 @deffn {Scheme Procedure} symbol->keyword symbol
2791 @deffnx {C Function} scm_symbol_to_keyword (symbol)
2792 Return the keyword with the same name as @var{symbol}.
2793 @end deffn
2794
2795 \fkeyword->symbol
2796 @c snarfed from keywords.c:82
2797 @deffn {Scheme Procedure} keyword->symbol keyword
2798 @deffnx {C Function} scm_keyword_to_symbol (keyword)
2799 Return the symbol with the same name as @var{keyword}.
2800 @end deffn
2801
2802 \flist
2803 @c snarfed from list.c:104
2804 @deffn {Scheme Procedure} list . objs
2805 @deffnx {C Function} scm_list (objs)
2806 Return a list containing @var{objs}, the arguments to
2807 @code{list}.
2808 @end deffn
2809
2810 \fcons*
2811 @c snarfed from list.c:119
2812 @deffn {Scheme Procedure} cons* arg . rest
2813 @deffnx {C Function} scm_cons_star (arg, rest)
2814 Like @code{list}, but the last arg provides the tail of the
2815 constructed list, returning @code{(cons @var{arg1} (cons
2816 @var{arg2} (cons @dots{} @var{argn})))}. Requires at least one
2817 argument. If given one argument, that argument is returned as
2818 result. This function is called @code{list*} in some other
2819 Schemes and in Common LISP.
2820 @end deffn
2821
2822 \fnull?
2823 @c snarfed from list.c:143
2824 @deffn {Scheme Procedure} null? x
2825 @deffnx {C Function} scm_null_p (x)
2826 Return @code{#t} iff @var{x} is the empty list, else @code{#f}.
2827 @end deffn
2828
2829 \flist?
2830 @c snarfed from list.c:153
2831 @deffn {Scheme Procedure} list? x
2832 @deffnx {C Function} scm_list_p (x)
2833 Return @code{#t} iff @var{x} is a proper list, else @code{#f}.
2834 @end deffn
2835
2836 \flength
2837 @c snarfed from list.c:194
2838 @deffn {Scheme Procedure} length lst
2839 @deffnx {C Function} scm_length (lst)
2840 Return the number of elements in list @var{lst}.
2841 @end deffn
2842
2843 \fappend
2844 @c snarfed from list.c:223
2845 @deffn {Scheme Procedure} append . args
2846 @deffnx {C Function} scm_append (args)
2847 Return a list consisting of the elements the lists passed as
2848 arguments.
2849 @lisp
2850 (append '(x) '(y)) @result{} (x y)
2851 (append '(a) '(b c d)) @result{} (a b c d)
2852 (append '(a (b)) '((c))) @result{} (a (b) (c))
2853 @end lisp
2854 The resulting list is always newly allocated, except that it
2855 shares structure with the last list argument. The last
2856 argument may actually be any object; an improper list results
2857 if the last argument is not a proper list.
2858 @lisp
2859 (append '(a b) '(c . d)) @result{} (a b c . d)
2860 (append '() 'a) @result{} a
2861 @end lisp
2862 @end deffn
2863
2864 \fappend!
2865 @c snarfed from list.c:259
2866 @deffn {Scheme Procedure} append! . lists
2867 @deffnx {C Function} scm_append_x (lists)
2868 A destructive version of @code{append} (@pxref{Pairs and
2869 Lists,,,r5rs, The Revised^5 Report on Scheme}). The cdr field
2870 of each list's final pair is changed to point to the head of
2871 the next list, so no consing is performed. Return
2872 the mutated list.
2873 @end deffn
2874
2875 \flast-pair
2876 @c snarfed from list.c:291
2877 @deffn {Scheme Procedure} last-pair lst
2878 @deffnx {C Function} scm_last_pair (lst)
2879 Return the last pair in @var{lst}, signalling an error if
2880 @var{lst} is circular.
2881 @end deffn
2882
2883 \freverse
2884 @c snarfed from list.c:321
2885 @deffn {Scheme Procedure} reverse lst
2886 @deffnx {C Function} scm_reverse (lst)
2887 Return a new list that contains the elements of @var{lst} but
2888 in reverse order.
2889 @end deffn
2890
2891 \freverse!
2892 @c snarfed from list.c:355
2893 @deffn {Scheme Procedure} reverse! lst [new_tail]
2894 @deffnx {C Function} scm_reverse_x (lst, new_tail)
2895 A destructive version of @code{reverse} (@pxref{Pairs and Lists,,,r5rs,
2896 The Revised^5 Report on Scheme}). The cdr of each cell in @var{lst} is
2897 modified to point to the previous list element. Return the
2898 reversed list.
2899
2900 Caveat: because the list is modified in place, the tail of the original
2901 list now becomes its head, and the head of the original list now becomes
2902 the tail. Therefore, the @var{lst} symbol to which the head of the
2903 original list was bound now points to the tail. To ensure that the head
2904 of the modified list is not lost, it is wise to save the return value of
2905 @code{reverse!}
2906 @end deffn
2907
2908 \flist-ref
2909 @c snarfed from list.c:381
2910 @deffn {Scheme Procedure} list-ref list k
2911 @deffnx {C Function} scm_list_ref (list, k)
2912 Return the @var{k}th element from @var{list}.
2913 @end deffn
2914
2915 \flist-set!
2916 @c snarfed from list.c:405
2917 @deffn {Scheme Procedure} list-set! list k val
2918 @deffnx {C Function} scm_list_set_x (list, k, val)
2919 Set the @var{k}th element of @var{list} to @var{val}.
2920 @end deffn
2921
2922 \flist-cdr-ref
2923 @c snarfed from list.c:427
2924 @deffn {Scheme Procedure} list-cdr-ref
2925 implemented by the C function "scm_list_tail"
2926 @end deffn
2927
2928 \flist-tail
2929 @c snarfed from list.c:436
2930 @deffn {Scheme Procedure} list-tail lst k
2931 @deffnx {Scheme Procedure} list-cdr-ref lst k
2932 @deffnx {C Function} scm_list_tail (lst, k)
2933 Return the "tail" of @var{lst} beginning with its @var{k}th element.
2934 The first element of the list is considered to be element 0.
2935
2936 @code{list-tail} and @code{list-cdr-ref} are identical. It may help to
2937 think of @code{list-cdr-ref} as accessing the @var{k}th cdr of the list,
2938 or returning the results of cdring @var{k} times down @var{lst}.
2939 @end deffn
2940
2941 \flist-cdr-set!
2942 @c snarfed from list.c:451
2943 @deffn {Scheme Procedure} list-cdr-set! list k val
2944 @deffnx {C Function} scm_list_cdr_set_x (list, k, val)
2945 Set the @var{k}th cdr of @var{list} to @var{val}.
2946 @end deffn
2947
2948 \flist-head
2949 @c snarfed from list.c:479
2950 @deffn {Scheme Procedure} list-head lst k
2951 @deffnx {C Function} scm_list_head (lst, k)
2952 Copy the first @var{k} elements from @var{lst} into a new list, and
2953 return it.
2954 @end deffn
2955
2956 \flist-copy
2957 @c snarfed from list.c:530
2958 @deffn {Scheme Procedure} list-copy lst
2959 @deffnx {C Function} scm_list_copy (lst)
2960 Return a (newly-created) copy of @var{lst}.
2961 @end deffn
2962
2963 \fmemq
2964 @c snarfed from list.c:584
2965 @deffn {Scheme Procedure} memq x lst
2966 @deffnx {C Function} scm_memq (x, lst)
2967 Return the first sublist of @var{lst} whose car is @code{eq?}
2968 to @var{x} where the sublists of @var{lst} are the non-empty
2969 lists returned by @code{(list-tail @var{lst} @var{k})} for
2970 @var{k} less than the length of @var{lst}. If @var{x} does not
2971 occur in @var{lst}, then @code{#f} (not the empty list) is
2972 returned.
2973 @end deffn
2974
2975 \fmemv
2976 @c snarfed from list.c:600
2977 @deffn {Scheme Procedure} memv x lst
2978 @deffnx {C Function} scm_memv (x, lst)
2979 Return the first sublist of @var{lst} whose car is @code{eqv?}
2980 to @var{x} where the sublists of @var{lst} are the non-empty
2981 lists returned by @code{(list-tail @var{lst} @var{k})} for
2982 @var{k} less than the length of @var{lst}. If @var{x} does not
2983 occur in @var{lst}, then @code{#f} (not the empty list) is
2984 returned.
2985 @end deffn
2986
2987 \fmember
2988 @c snarfed from list.c:621
2989 @deffn {Scheme Procedure} member x lst
2990 @deffnx {C Function} scm_member (x, lst)
2991 Return the first sublist of @var{lst} whose car is
2992 @code{equal?} to @var{x} where the sublists of @var{lst} are
2993 the non-empty lists returned by @code{(list-tail @var{lst}
2994 @var{k})} for @var{k} less than the length of @var{lst}. If
2995 @var{x} does not occur in @var{lst}, then @code{#f} (not the
2996 empty list) is returned.
2997 @end deffn
2998
2999 \fdelq!
3000 @c snarfed from list.c:646
3001 @deffn {Scheme Procedure} delq! item lst
3002 @deffnx {Scheme Procedure} delv! item lst
3003 @deffnx {Scheme Procedure} delete! item lst
3004 @deffnx {C Function} scm_delq_x (item, lst)
3005 These procedures are destructive versions of @code{delq}, @code{delv}
3006 and @code{delete}: they modify the existing @var{lst}
3007 rather than creating a new list. Caveat evaluator: Like other
3008 destructive list functions, these functions cannot modify the binding of
3009 @var{lst}, and so cannot be used to delete the first element of
3010 @var{lst} destructively.
3011 @end deffn
3012
3013 \fdelv!
3014 @c snarfed from list.c:670
3015 @deffn {Scheme Procedure} delv! item lst
3016 @deffnx {C Function} scm_delv_x (item, lst)
3017 Destructively remove all elements from @var{lst} that are
3018 @code{eqv?} to @var{item}.
3019 @end deffn
3020
3021 \fdelete!
3022 @c snarfed from list.c:695
3023 @deffn {Scheme Procedure} delete! item lst
3024 @deffnx {C Function} scm_delete_x (item, lst)
3025 Destructively remove all elements from @var{lst} that are
3026 @code{equal?} to @var{item}.
3027 @end deffn
3028
3029 \fdelq
3030 @c snarfed from list.c:724
3031 @deffn {Scheme Procedure} delq item lst
3032 @deffnx {C Function} scm_delq (item, lst)
3033 Return a newly-created copy of @var{lst} with elements
3034 @code{eq?} to @var{item} removed. This procedure mirrors
3035 @code{memq}: @code{delq} compares elements of @var{lst} against
3036 @var{item} with @code{eq?}.
3037 @end deffn
3038
3039 \fdelv
3040 @c snarfed from list.c:737
3041 @deffn {Scheme Procedure} delv item lst
3042 @deffnx {C Function} scm_delv (item, lst)
3043 Return a newly-created copy of @var{lst} with elements
3044 @code{eqv?} to @var{item} removed. This procedure mirrors
3045 @code{memv}: @code{delv} compares elements of @var{lst} against
3046 @var{item} with @code{eqv?}.
3047 @end deffn
3048
3049 \fdelete
3050 @c snarfed from list.c:750
3051 @deffn {Scheme Procedure} delete item lst
3052 @deffnx {C Function} scm_delete (item, lst)
3053 Return a newly-created copy of @var{lst} with elements
3054 @code{equal?} to @var{item} removed. This procedure mirrors
3055 @code{member}: @code{delete} compares elements of @var{lst}
3056 against @var{item} with @code{equal?}.
3057 @end deffn
3058
3059 \fdelq1!
3060 @c snarfed from list.c:763
3061 @deffn {Scheme Procedure} delq1! item lst
3062 @deffnx {C Function} scm_delq1_x (item, lst)
3063 Like @code{delq!}, but only deletes the first occurrence of
3064 @var{item} from @var{lst}. Tests for equality using
3065 @code{eq?}. See also @code{delv1!} and @code{delete1!}.
3066 @end deffn
3067
3068 \fdelv1!
3069 @c snarfed from list.c:791
3070 @deffn {Scheme Procedure} delv1! item lst
3071 @deffnx {C Function} scm_delv1_x (item, lst)
3072 Like @code{delv!}, but only deletes the first occurrence of
3073 @var{item} from @var{lst}. Tests for equality using
3074 @code{eqv?}. See also @code{delq1!} and @code{delete1!}.
3075 @end deffn
3076
3077 \fdelete1!
3078 @c snarfed from list.c:819
3079 @deffn {Scheme Procedure} delete1! item lst
3080 @deffnx {C Function} scm_delete1_x (item, lst)
3081 Like @code{delete!}, but only deletes the first occurrence of
3082 @var{item} from @var{lst}. Tests for equality using
3083 @code{equal?}. See also @code{delq1!} and @code{delv1!}.
3084 @end deffn
3085
3086 \ffilter
3087 @c snarfed from list.c:851
3088 @deffn {Scheme Procedure} filter pred list
3089 @deffnx {C Function} scm_filter (pred, list)
3090 Return all the elements of 2nd arg @var{list} that satisfy predicate @var{pred}.
3091 The list is not disordered -- elements that appear in the result list occur
3092 in the same order as they occur in the argument list. The returned list may
3093 share a common tail with the argument list. The dynamic order in which the
3094 various applications of pred are made is not specified.
3095
3096 @lisp
3097 (filter even? '(0 7 8 8 43 -4)) => (0 8 8 -4)
3098 @end lisp
3099 @end deffn
3100
3101 \ffilter!
3102 @c snarfed from list.c:878
3103 @deffn {Scheme Procedure} filter! pred list
3104 @deffnx {C Function} scm_filter_x (pred, list)
3105 Linear-update variant of @code{filter}.
3106 @end deffn
3107
3108 \fprimitive-load
3109 @c snarfed from load.c:72
3110 @deffn {Scheme Procedure} primitive-load filename
3111 @deffnx {C Function} scm_primitive_load (filename)
3112 Load the file named @var{filename} and evaluate its contents in
3113 the top-level environment. The load paths are not searched;
3114 @var{filename} must either be a full pathname or be a pathname
3115 relative to the current directory. If the variable
3116 @code{%load-hook} is defined, it should be bound to a procedure
3117 that will be called before any code is loaded. See the
3118 documentation for @code{%load-hook} later in this section.
3119 @end deffn
3120
3121 \f%package-data-dir
3122 @c snarfed from load.c:117
3123 @deffn {Scheme Procedure} %package-data-dir
3124 @deffnx {C Function} scm_sys_package_data_dir ()
3125 Return the name of the directory where Scheme packages, modules and
3126 libraries are kept. On most Unix systems, this will be
3127 @samp{/usr/local/share/guile}.
3128 @end deffn
3129
3130 \f%library-dir
3131 @c snarfed from load.c:129
3132 @deffn {Scheme Procedure} %library-dir
3133 @deffnx {C Function} scm_sys_library_dir ()
3134 Return the directory where the Guile Scheme library files are installed.
3135 E.g., may return "/usr/share/guile/1.3.5".
3136 @end deffn
3137
3138 \f%site-dir
3139 @c snarfed from load.c:141
3140 @deffn {Scheme Procedure} %site-dir
3141 @deffnx {C Function} scm_sys_site_dir ()
3142 Return the directory where the Guile site files are installed.
3143 E.g., may return "/usr/share/guile/site".
3144 @end deffn
3145
3146 \fparse-path
3147 @c snarfed from load.c:166
3148 @deffn {Scheme Procedure} parse-path path [tail]
3149 @deffnx {C Function} scm_parse_path (path, tail)
3150 Parse @var{path}, which is expected to be a colon-separated
3151 string, into a list and return the resulting list with
3152 @var{tail} appended. If @var{path} is @code{#f}, @var{tail}
3153 is returned.
3154 @end deffn
3155
3156 \fsearch-path
3157 @c snarfed from load.c:293
3158 @deffn {Scheme Procedure} search-path path filename [extensions]
3159 @deffnx {C Function} scm_search_path (path, filename, extensions)
3160 Search @var{path} for a directory containing a file named
3161 @var{filename}. The file must be readable, and not a directory.
3162 If we find one, return its full filename; otherwise, return
3163 @code{#f}. If @var{filename} is absolute, return it unchanged.
3164 If given, @var{extensions} is a list of strings; for each
3165 directory in @var{path}, we search for @var{filename}
3166 concatenated with each @var{extension}.
3167 @end deffn
3168
3169 \f%search-load-path
3170 @c snarfed from load.c:430
3171 @deffn {Scheme Procedure} %search-load-path filename
3172 @deffnx {C Function} scm_sys_search_load_path (filename)
3173 Search @var{%load-path} for the file named @var{filename},
3174 which must be readable by the current user. If @var{filename}
3175 is found in the list of paths to search or is an absolute
3176 pathname, return its full pathname. Otherwise, return
3177 @code{#f}. Filenames may have any of the optional extensions
3178 in the @code{%load-extensions} list; @code{%search-load-path}
3179 will try each extension automatically.
3180 @end deffn
3181
3182 \fprimitive-load-path
3183 @c snarfed from load.c:451
3184 @deffn {Scheme Procedure} primitive-load-path filename
3185 @deffnx {C Function} scm_primitive_load_path (filename)
3186 Search @var{%load-path} for the file named @var{filename} and
3187 load it into the top-level environment. If @var{filename} is a
3188 relative pathname and is not found in the list of search paths,
3189 an error is signalled.
3190 @end deffn
3191
3192 \fprocedure->memoizing-macro
3193 @c snarfed from macros.c:109
3194 @deffn {Scheme Procedure} procedure->memoizing-macro code
3195 @deffnx {C Function} scm_makmmacro (code)
3196 Return a @dfn{macro} which, when a symbol defined to this value
3197 appears as the first symbol in an expression, evaluates the
3198 result of applying @var{code} to the expression and the
3199 environment.
3200
3201 @code{procedure->memoizing-macro} is the same as
3202 @code{procedure->macro}, except that the expression returned by
3203 @var{code} replaces the original macro expression in the memoized
3204 form of the containing code.
3205 @end deffn
3206
3207 \fprocedure->syntax
3208 @c snarfed from macros.c:123
3209 @deffn {Scheme Procedure} procedure->syntax code
3210 @deffnx {C Function} scm_makacro (code)
3211 Return a @dfn{macro} which, when a symbol defined to this value
3212 appears as the first symbol in an expression, returns the
3213 result of applying @var{code} to the expression and the
3214 environment.
3215 @end deffn
3216
3217 \fprocedure->macro
3218 @c snarfed from macros.c:146
3219 @deffn {Scheme Procedure} procedure->macro code
3220 @deffnx {C Function} scm_makmacro (code)
3221 Return a @dfn{macro} which, when a symbol defined to this value
3222 appears as the first symbol in an expression, evaluates the
3223 result of applying @var{code} to the expression and the
3224 environment. For example:
3225
3226 @lisp
3227 (define trace
3228 (procedure->macro
3229 (lambda (x env) `(set! ,(cadr x) (tracef ,(cadr x) ',(cadr x))))))
3230
3231 (trace @i{foo}) @equiv{} (set! @i{foo} (tracef @i{foo} '@i{foo})).
3232 @end lisp
3233 @end deffn
3234
3235 \fmacro?
3236 @c snarfed from macros.c:165
3237 @deffn {Scheme Procedure} macro? obj
3238 @deffnx {C Function} scm_macro_p (obj)
3239 Return @code{#t} if @var{obj} is a regular macro, a memoizing macro or a
3240 syntax transformer.
3241 @end deffn
3242
3243 \fmacro-type
3244 @c snarfed from macros.c:186
3245 @deffn {Scheme Procedure} macro-type m
3246 @deffnx {C Function} scm_macro_type (m)
3247 Return one of the symbols @code{syntax}, @code{macro} or
3248 @code{macro!}, depending on whether @var{m} is a syntax
3249 transformer, a regular macro, or a memoizing macro,
3250 respectively. If @var{m} is not a macro, @code{#f} is
3251 returned.
3252 @end deffn
3253
3254 \fmacro-name
3255 @c snarfed from macros.c:207
3256 @deffn {Scheme Procedure} macro-name m
3257 @deffnx {C Function} scm_macro_name (m)
3258 Return the name of the macro @var{m}.
3259 @end deffn
3260
3261 \fmacro-transformer
3262 @c snarfed from macros.c:218
3263 @deffn {Scheme Procedure} macro-transformer m
3264 @deffnx {C Function} scm_macro_transformer (m)
3265 Return the transformer of the macro @var{m}.
3266 @end deffn
3267
3268 \fcurrent-module
3269 @c snarfed from modules.c:45
3270 @deffn {Scheme Procedure} current-module
3271 @deffnx {C Function} scm_current_module ()
3272 Return the current module.
3273 @end deffn
3274
3275 \fset-current-module
3276 @c snarfed from modules.c:57
3277 @deffn {Scheme Procedure} set-current-module module
3278 @deffnx {C Function} scm_set_current_module (module)
3279 Set the current module to @var{module} and return
3280 the previous current module.
3281 @end deffn
3282
3283 \finteraction-environment
3284 @c snarfed from modules.c:80
3285 @deffn {Scheme Procedure} interaction-environment
3286 @deffnx {C Function} scm_interaction_environment ()
3287 Return a specifier for the environment that contains
3288 implementation--defined bindings, typically a superset of those
3289 listed in the report. The intent is that this procedure will
3290 return the environment in which the implementation would
3291 evaluate expressions dynamically typed by the user.
3292 @end deffn
3293
3294 \fenv-module
3295 @c snarfed from modules.c:266
3296 @deffn {Scheme Procedure} env-module env
3297 @deffnx {C Function} scm_env_module (env)
3298 Return the module of @var{ENV}, a lexical environment.
3299 @end deffn
3300
3301 \fstandard-eval-closure
3302 @c snarfed from modules.c:342
3303 @deffn {Scheme Procedure} standard-eval-closure module
3304 @deffnx {C Function} scm_standard_eval_closure (module)
3305 Return an eval closure for the module @var{module}.
3306 @end deffn
3307
3308 \fstandard-interface-eval-closure
3309 @c snarfed from modules.c:353
3310 @deffn {Scheme Procedure} standard-interface-eval-closure module
3311 @deffnx {C Function} scm_standard_interface_eval_closure (module)
3312 Return a interface eval closure for the module @var{module}. Such a closure does not allow new bindings to be added.
3313 @end deffn
3314
3315 \fmodule-import-interface
3316 @c snarfed from modules.c:399
3317 @deffn {Scheme Procedure} module-import-interface module sym
3318 @deffnx {C Function} scm_module_import_interface (module, sym)
3319
3320 @end deffn
3321
3322 \f%get-pre-modules-obarray
3323 @c snarfed from modules.c:616
3324 @deffn {Scheme Procedure} %get-pre-modules-obarray
3325 @deffnx {C Function} scm_get_pre_modules_obarray ()
3326 Return the obarray that is used for all new bindings before the module system is booted. The first call to @code{set-current-module} will boot the module system.
3327 @end deffn
3328
3329 \fexact?
3330 @c snarfed from numbers.c:460
3331 @deffn {Scheme Procedure} exact? x
3332 @deffnx {C Function} scm_exact_p (x)
3333 Return @code{#t} if @var{x} is an exact number, @code{#f}
3334 otherwise.
3335 @end deffn
3336
3337 \fodd?
3338 @c snarfed from numbers.c:479
3339 @deffn {Scheme Procedure} odd? n
3340 @deffnx {C Function} scm_odd_p (n)
3341 Return @code{#t} if @var{n} is an odd number, @code{#f}
3342 otherwise.
3343 @end deffn
3344
3345 \feven?
3346 @c snarfed from numbers.c:514
3347 @deffn {Scheme Procedure} even? n
3348 @deffnx {C Function} scm_even_p (n)
3349 Return @code{#t} if @var{n} is an even number, @code{#f}
3350 otherwise.
3351 @end deffn
3352
3353 \finf?
3354 @c snarfed from numbers.c:548
3355 @deffn {Scheme Procedure} inf? x
3356 @deffnx {C Function} scm_inf_p (x)
3357 Return @code{#t} if @var{x} is either @samp{+inf.0}
3358 or @samp{-inf.0}, @code{#f} otherwise.
3359 @end deffn
3360
3361 \fnan?
3362 @c snarfed from numbers.c:564
3363 @deffn {Scheme Procedure} nan? n
3364 @deffnx {C Function} scm_nan_p (n)
3365 Return @code{#t} if @var{n} is a NaN, @code{#f}
3366 otherwise.
3367 @end deffn
3368
3369 \finf
3370 @c snarfed from numbers.c:634
3371 @deffn {Scheme Procedure} inf
3372 @deffnx {C Function} scm_inf ()
3373 Return Inf.
3374 @end deffn
3375
3376 \fnan
3377 @c snarfed from numbers.c:649
3378 @deffn {Scheme Procedure} nan
3379 @deffnx {C Function} scm_nan ()
3380 Return NaN.
3381 @end deffn
3382
3383 \fabs
3384 @c snarfed from numbers.c:665
3385 @deffn {Scheme Procedure} abs x
3386 @deffnx {C Function} scm_abs (x)
3387 Return the absolute value of @var{x}.
3388 @end deffn
3389
3390 \flogand
3391 @c snarfed from numbers.c:1201
3392 @deffn {Scheme Procedure} logand n1 n2
3393 Return the bitwise AND of the integer arguments.
3394
3395 @lisp
3396 (logand) @result{} -1
3397 (logand 7) @result{} 7
3398 (logand #b111 #b011 #b001) @result{} 1
3399 @end lisp
3400 @end deffn
3401
3402 \flogior
3403 @c snarfed from numbers.c:1277
3404 @deffn {Scheme Procedure} logior n1 n2
3405 Return the bitwise OR of the integer arguments.
3406
3407 @lisp
3408 (logior) @result{} 0
3409 (logior 7) @result{} 7
3410 (logior #b000 #b001 #b011) @result{} 3
3411 @end lisp
3412 @end deffn
3413
3414 \flogxor
3415 @c snarfed from numbers.c:1353
3416 @deffn {Scheme Procedure} logxor n1 n2
3417 Return the bitwise XOR of the integer arguments. A bit is
3418 set in the result if it is set in an odd number of arguments.
3419 @lisp
3420 (logxor) @result{} 0
3421 (logxor 7) @result{} 7
3422 (logxor #b000 #b001 #b011) @result{} 2
3423 (logxor #b000 #b001 #b011 #b011) @result{} 1
3424 @end lisp
3425 @end deffn
3426
3427 \flogtest
3428 @c snarfed from numbers.c:1428
3429 @deffn {Scheme Procedure} logtest j k
3430 @deffnx {C Function} scm_logtest (j, k)
3431 Test whether @var{j} and @var{k} have any 1 bits in common.
3432 This is equivalent to @code{(not (zero? (logand j k)))}, but
3433 without actually calculating the @code{logand}, just testing
3434 for non-zero.
3435
3436 @lisp
3437 (logtest #b0100 #b1011) @result{} #f
3438 (logtest #b0100 #b0111) @result{} #t
3439 @end lisp
3440 @end deffn
3441
3442 \flogbit?
3443 @c snarfed from numbers.c:1501
3444 @deffn {Scheme Procedure} logbit? index j
3445 @deffnx {C Function} scm_logbit_p (index, j)
3446 Test whether bit number @var{index} in @var{j} is set.
3447 @var{index} starts from 0 for the least significant bit.
3448
3449 @lisp
3450 (logbit? 0 #b1101) @result{} #t
3451 (logbit? 1 #b1101) @result{} #f
3452 (logbit? 2 #b1101) @result{} #t
3453 (logbit? 3 #b1101) @result{} #t
3454 (logbit? 4 #b1101) @result{} #f
3455 @end lisp
3456 @end deffn
3457
3458 \flognot
3459 @c snarfed from numbers.c:1535
3460 @deffn {Scheme Procedure} lognot n
3461 @deffnx {C Function} scm_lognot (n)
3462 Return the integer which is the ones-complement of the integer
3463 argument.
3464
3465 @lisp
3466 (number->string (lognot #b10000000) 2)
3467 @result{} "-10000001"
3468 (number->string (lognot #b0) 2)
3469 @result{} "-1"
3470 @end lisp
3471 @end deffn
3472
3473 \fmodulo-expt
3474 @c snarfed from numbers.c:1580
3475 @deffn {Scheme Procedure} modulo-expt n k m
3476 @deffnx {C Function} scm_modulo_expt (n, k, m)
3477 Return @var{n} raised to the integer exponent
3478 @var{k}, modulo @var{m}.
3479
3480 @lisp
3481 (modulo-expt 2 3 5)
3482 @result{} 3
3483 @end lisp
3484 @end deffn
3485
3486 \finteger-expt
3487 @c snarfed from numbers.c:1689
3488 @deffn {Scheme Procedure} integer-expt n k
3489 @deffnx {C Function} scm_integer_expt (n, k)
3490 Return @var{n} raised to the power @var{k}. @var{k} must be an
3491 exact integer, @var{n} can be any number.
3492
3493 Negative @var{k} is supported, and results in @math{1/n^abs(k)}
3494 in the usual way. @math{@var{n}^0} is 1, as usual, and that
3495 includes @math{0^0} is 1.
3496
3497 @lisp
3498 (integer-expt 2 5) @result{} 32
3499 (integer-expt -3 3) @result{} -27
3500 (integer-expt 5 -3) @result{} 1/125
3501 (integer-expt 0 0) @result{} 1
3502 @end lisp
3503 @end deffn
3504
3505 \fash
3506 @c snarfed from numbers.c:1779
3507 @deffn {Scheme Procedure} ash n cnt
3508 @deffnx {C Function} scm_ash (n, cnt)
3509 Return @var{n} shifted left by @var{cnt} bits, or shifted right
3510 if @var{cnt} is negative. This is an ``arithmetic'' shift.
3511
3512 This is effectively a multiplication by 2^@var{cnt}, and when
3513 @var{cnt} is negative it's a division, rounded towards negative
3514 infinity. (Note that this is not the same rounding as
3515 @code{quotient} does.)
3516
3517 With @var{n} viewed as an infinite precision twos complement,
3518 @code{ash} means a left shift introducing zero bits, or a right
3519 shift dropping bits.
3520
3521 @lisp
3522 (number->string (ash #b1 3) 2) @result{} "1000"
3523 (number->string (ash #b1010 -1) 2) @result{} "101"
3524
3525 ;; -23 is bits ...11101001, -6 is bits ...111010
3526 (ash -23 -2) @result{} -6
3527 @end lisp
3528 @end deffn
3529
3530 \fbit-extract
3531 @c snarfed from numbers.c:1870
3532 @deffn {Scheme Procedure} bit-extract n start end
3533 @deffnx {C Function} scm_bit_extract (n, start, end)
3534 Return the integer composed of the @var{start} (inclusive)
3535 through @var{end} (exclusive) bits of @var{n}. The
3536 @var{start}th bit becomes the 0-th bit in the result.
3537
3538 @lisp
3539 (number->string (bit-extract #b1101101010 0 4) 2)
3540 @result{} "1010"
3541 (number->string (bit-extract #b1101101010 4 9) 2)
3542 @result{} "10110"
3543 @end lisp
3544 @end deffn
3545
3546 \flogcount
3547 @c snarfed from numbers.c:1949
3548 @deffn {Scheme Procedure} logcount n
3549 @deffnx {C Function} scm_logcount (n)
3550 Return the number of bits in integer @var{n}. If integer is
3551 positive, the 1-bits in its binary representation are counted.
3552 If negative, the 0-bits in its two's-complement binary
3553 representation are counted. If 0, 0 is returned.
3554
3555 @lisp
3556 (logcount #b10101010)
3557 @result{} 4
3558 (logcount 0)
3559 @result{} 0
3560 (logcount -2)
3561 @result{} 1
3562 @end lisp
3563 @end deffn
3564
3565 \finteger-length
3566 @c snarfed from numbers.c:1997
3567 @deffn {Scheme Procedure} integer-length n
3568 @deffnx {C Function} scm_integer_length (n)
3569 Return the number of bits necessary to represent @var{n}.
3570
3571 @lisp
3572 (integer-length #b10101010)
3573 @result{} 8
3574 (integer-length 0)
3575 @result{} 0
3576 (integer-length #b1111)
3577 @result{} 4
3578 @end lisp
3579 @end deffn
3580
3581 \fnumber->string
3582 @c snarfed from numbers.c:2337
3583 @deffn {Scheme Procedure} number->string n [radix]
3584 @deffnx {C Function} scm_number_to_string (n, radix)
3585 Return a string holding the external representation of the
3586 number @var{n} in the given @var{radix}. If @var{n} is
3587 inexact, a radix of 10 will be used.
3588 @end deffn
3589
3590 \fstring->number
3591 @c snarfed from numbers.c:3034
3592 @deffn {Scheme Procedure} string->number string [radix]
3593 @deffnx {C Function} scm_string_to_number (string, radix)
3594 Return a number of the maximally precise representation
3595 expressed by the given @var{string}. @var{radix} must be an
3596 exact integer, either 2, 8, 10, or 16. If supplied, @var{radix}
3597 is a default radix that may be overridden by an explicit radix
3598 prefix in @var{string} (e.g. "#o177"). If @var{radix} is not
3599 supplied, then the default radix is 10. If string is not a
3600 syntactically valid notation for a number, then
3601 @code{string->number} returns @code{#f}.
3602 @end deffn
3603
3604 \fnumber?
3605 @c snarfed from numbers.c:3097
3606 @deffn {Scheme Procedure} number? x
3607 @deffnx {C Function} scm_number_p (x)
3608 Return @code{#t} if @var{x} is a number, @code{#f}
3609 otherwise.
3610 @end deffn
3611
3612 \fcomplex?
3613 @c snarfed from numbers.c:3110
3614 @deffn {Scheme Procedure} complex? x
3615 @deffnx {C Function} scm_complex_p (x)
3616 Return @code{#t} if @var{x} is a complex number, @code{#f}
3617 otherwise. Note that the sets of real, rational and integer
3618 values form subsets of the set of complex numbers, i. e. the
3619 predicate will also be fulfilled if @var{x} is a real,
3620 rational or integer number.
3621 @end deffn
3622
3623 \freal?
3624 @c snarfed from numbers.c:3123
3625 @deffn {Scheme Procedure} real? x
3626 @deffnx {C Function} scm_real_p (x)
3627 Return @code{#t} if @var{x} is a real number, @code{#f}
3628 otherwise. Note that the set of integer values forms a subset of
3629 the set of real numbers, i. e. the predicate will also be
3630 fulfilled if @var{x} is an integer number.
3631 @end deffn
3632
3633 \frational?
3634 @c snarfed from numbers.c:3136
3635 @deffn {Scheme Procedure} rational? x
3636 @deffnx {C Function} scm_rational_p (x)
3637 Return @code{#t} if @var{x} is a rational number, @code{#f}
3638 otherwise. Note that the set of integer values forms a subset of
3639 the set of rational numbers, i. e. the predicate will also be
3640 fulfilled if @var{x} is an integer number.
3641 @end deffn
3642
3643 \finteger?
3644 @c snarfed from numbers.c:3159
3645 @deffn {Scheme Procedure} integer? x
3646 @deffnx {C Function} scm_integer_p (x)
3647 Return @code{#t} if @var{x} is an integer number, @code{#f}
3648 else.
3649 @end deffn
3650
3651 \finexact?
3652 @c snarfed from numbers.c:3185
3653 @deffn {Scheme Procedure} inexact? x
3654 @deffnx {C Function} scm_inexact_p (x)
3655 Return @code{#t} if @var{x} is an inexact number, @code{#f}
3656 else.
3657 @end deffn
3658
3659 \ftruncate
3660 @c snarfed from numbers.c:5060
3661 @deffn {Scheme Procedure} truncate x
3662 @deffnx {C Function} scm_truncate_number (x)
3663 Round the number @var{x} towards zero.
3664 @end deffn
3665
3666 \fround
3667 @c snarfed from numbers.c:5076
3668 @deffn {Scheme Procedure} round x
3669 @deffnx {C Function} scm_round_number (x)
3670 Round the number @var{x} towards the nearest integer. When it is exactly halfway between two integers, round towards the even one.
3671 @end deffn
3672
3673 \ffloor
3674 @c snarfed from numbers.c:5102
3675 @deffn {Scheme Procedure} floor x
3676 @deffnx {C Function} scm_floor (x)
3677 Round the number @var{x} towards minus infinity.
3678 @end deffn
3679
3680 \fceiling
3681 @c snarfed from numbers.c:5133
3682 @deffn {Scheme Procedure} ceiling x
3683 @deffnx {C Function} scm_ceiling (x)
3684 Round the number @var{x} towards infinity.
3685 @end deffn
3686
3687 \f$expt
3688 @c snarfed from numbers.c:5242
3689 @deffn {Scheme Procedure} $expt x y
3690 @deffnx {C Function} scm_sys_expt (x, y)
3691 Return @var{x} raised to the power of @var{y}. This
3692 procedure does not accept complex arguments.
3693 @end deffn
3694
3695 \f$atan2
3696 @c snarfed from numbers.c:5258
3697 @deffn {Scheme Procedure} $atan2 x y
3698 @deffnx {C Function} scm_sys_atan2 (x, y)
3699 Return the arc tangent of the two arguments @var{x} and
3700 @var{y}. This is similar to calculating the arc tangent of
3701 @var{x} / @var{y}, except that the signs of both arguments
3702 are used to determine the quadrant of the result. This
3703 procedure does not accept complex arguments.
3704 @end deffn
3705
3706 \fmake-rectangular
3707 @c snarfed from numbers.c:5286
3708 @deffn {Scheme Procedure} make-rectangular real imaginary
3709 @deffnx {C Function} scm_make_rectangular (real, imaginary)
3710 Return a complex number constructed of the given @var{real} and
3711 @var{imaginary} parts.
3712 @end deffn
3713
3714 \fmake-polar
3715 @c snarfed from numbers.c:5310
3716 @deffn {Scheme Procedure} make-polar x y
3717 @deffnx {C Function} scm_make_polar (x, y)
3718 Return the complex number @var{x} * e^(i * @var{y}).
3719 @end deffn
3720
3721 \finexact->exact
3722 @c snarfed from numbers.c:5513
3723 @deffn {Scheme Procedure} inexact->exact z
3724 @deffnx {C Function} scm_inexact_to_exact (z)
3725 Return an exact number that is numerically closest to @var{z}.
3726 @end deffn
3727
3728 \frationalize
3729 @c snarfed from numbers.c:5550
3730 @deffn {Scheme Procedure} rationalize x err
3731 @deffnx {C Function} scm_rationalize (x, err)
3732 Return an exact number that is within @var{err} of @var{x}.
3733 @end deffn
3734
3735 \fentity?
3736 @c snarfed from objects.c:192
3737 @deffn {Scheme Procedure} entity? obj
3738 @deffnx {C Function} scm_entity_p (obj)
3739 Return @code{#t} if @var{obj} is an entity.
3740 @end deffn
3741
3742 \foperator?
3743 @c snarfed from objects.c:201
3744 @deffn {Scheme Procedure} operator? obj
3745 @deffnx {C Function} scm_operator_p (obj)
3746 Return @code{#t} if @var{obj} is an operator.
3747 @end deffn
3748
3749 \fvalid-object-procedure?
3750 @c snarfed from objects.c:217
3751 @deffn {Scheme Procedure} valid-object-procedure? proc
3752 @deffnx {C Function} scm_valid_object_procedure_p (proc)
3753 Return @code{#t} iff @var{proc} is a procedure that can be used with @code{set-object-procedure}. It is always valid to use a closure constructed by @code{lambda}.
3754 @end deffn
3755
3756 \fset-object-procedure!
3757 @c snarfed from objects.c:239
3758 @deffn {Scheme Procedure} set-object-procedure! obj proc
3759 @deffnx {C Function} scm_set_object_procedure_x (obj, proc)
3760 Set the object procedure of @var{obj} to @var{proc}.
3761 @var{obj} must be either an entity or an operator.
3762 @end deffn
3763
3764 \fmake-class-object
3765 @c snarfed from objects.c:299
3766 @deffn {Scheme Procedure} make-class-object metaclass layout
3767 @deffnx {C Function} scm_make_class_object (metaclass, layout)
3768 Create a new class object of class @var{metaclass}, with the
3769 slot layout specified by @var{layout}.
3770 @end deffn
3771
3772 \fmake-subclass-object
3773 @c snarfed from objects.c:314
3774 @deffn {Scheme Procedure} make-subclass-object class layout
3775 @deffnx {C Function} scm_make_subclass_object (class, layout)
3776 Create a subclass object of @var{class}, with the slot layout
3777 specified by @var{layout}.
3778 @end deffn
3779
3780 \fobject-properties
3781 @c snarfed from objprop.c:36
3782 @deffn {Scheme Procedure} object-properties obj
3783 @deffnx {C Function} scm_object_properties (obj)
3784 Return @var{obj}'s property list.
3785 @end deffn
3786
3787 \fset-object-properties!
3788 @c snarfed from objprop.c:46
3789 @deffn {Scheme Procedure} set-object-properties! obj alist
3790 @deffnx {C Function} scm_set_object_properties_x (obj, alist)
3791 Set @var{obj}'s property list to @var{alist}.
3792 @end deffn
3793
3794 \fobject-property
3795 @c snarfed from objprop.c:57
3796 @deffn {Scheme Procedure} object-property obj key
3797 @deffnx {C Function} scm_object_property (obj, key)
3798 Return the property of @var{obj} with name @var{key}.
3799 @end deffn
3800
3801 \fset-object-property!
3802 @c snarfed from objprop.c:69
3803 @deffn {Scheme Procedure} set-object-property! obj key value
3804 @deffnx {C Function} scm_set_object_property_x (obj, key, value)
3805 In @var{obj}'s property list, set the property named @var{key}
3806 to @var{value}.
3807 @end deffn
3808
3809 \fcons
3810 @c snarfed from pairs.c:56
3811 @deffn {Scheme Procedure} cons x y
3812 @deffnx {C Function} scm_cons (x, y)
3813 Return a newly allocated pair whose car is @var{x} and whose
3814 cdr is @var{y}. The pair is guaranteed to be different (in the
3815 sense of @code{eq?}) from every previously existing object.
3816 @end deffn
3817
3818 \fpair?
3819 @c snarfed from pairs.c:74
3820 @deffn {Scheme Procedure} pair? x
3821 @deffnx {C Function} scm_pair_p (x)
3822 Return @code{#t} if @var{x} is a pair; otherwise return
3823 @code{#f}.
3824 @end deffn
3825
3826 \fset-car!
3827 @c snarfed from pairs.c:120
3828 @deffn {Scheme Procedure} set-car! pair value
3829 @deffnx {C Function} scm_set_car_x (pair, value)
3830 Stores @var{value} in the car field of @var{pair}. The value returned
3831 by @code{set-car!} is unspecified.
3832 @end deffn
3833
3834 \fset-cdr!
3835 @c snarfed from pairs.c:133
3836 @deffn {Scheme Procedure} set-cdr! pair value
3837 @deffnx {C Function} scm_set_cdr_x (pair, value)
3838 Stores @var{value} in the cdr field of @var{pair}. The value returned
3839 by @code{set-cdr!} is unspecified.
3840 @end deffn
3841
3842 \fchar-ready?
3843 @c snarfed from ports.c:245
3844 @deffn {Scheme Procedure} char-ready? [port]
3845 @deffnx {C Function} scm_char_ready_p (port)
3846 Return @code{#t} if a character is ready on input @var{port}
3847 and return @code{#f} otherwise. If @code{char-ready?} returns
3848 @code{#t} then the next @code{read-char} operation on
3849 @var{port} is guaranteed not to hang. If @var{port} is a file
3850 port at end of file then @code{char-ready?} returns @code{#t}.
3851
3852 @code{char-ready?} exists to make it possible for a
3853 program to accept characters from interactive ports without
3854 getting stuck waiting for input. Any input editors associated
3855 with such ports must make sure that characters whose existence
3856 has been asserted by @code{char-ready?} cannot be rubbed out.
3857 If @code{char-ready?} were to return @code{#f} at end of file,
3858 a port at end of file would be indistinguishable from an
3859 interactive port that has no ready characters.
3860 @end deffn
3861
3862 \fdrain-input
3863 @c snarfed from ports.c:322
3864 @deffn {Scheme Procedure} drain-input port
3865 @deffnx {C Function} scm_drain_input (port)
3866 This procedure clears a port's input buffers, similar
3867 to the way that force-output clears the output buffer. The
3868 contents of the buffers are returned as a single string, e.g.,
3869
3870 @lisp
3871 (define p (open-input-file ...))
3872 (drain-input p) => empty string, nothing buffered yet.
3873 (unread-char (read-char p) p)
3874 (drain-input p) => initial chars from p, up to the buffer size.
3875 @end lisp
3876
3877 Draining the buffers may be useful for cleanly finishing
3878 buffered I/O so that the file descriptor can be used directly
3879 for further input.
3880 @end deffn
3881
3882 \fcurrent-input-port
3883 @c snarfed from ports.c:355
3884 @deffn {Scheme Procedure} current-input-port
3885 @deffnx {C Function} scm_current_input_port ()
3886 Return the current input port. This is the default port used
3887 by many input procedures. Initially, @code{current-input-port}
3888 returns the @dfn{standard input} in Unix and C terminology.
3889 @end deffn
3890
3891 \fcurrent-output-port
3892 @c snarfed from ports.c:367
3893 @deffn {Scheme Procedure} current-output-port
3894 @deffnx {C Function} scm_current_output_port ()
3895 Return the current output port. This is the default port used
3896 by many output procedures. Initially,
3897 @code{current-output-port} returns the @dfn{standard output} in
3898 Unix and C terminology.
3899 @end deffn
3900
3901 \fcurrent-error-port
3902 @c snarfed from ports.c:377
3903 @deffn {Scheme Procedure} current-error-port
3904 @deffnx {C Function} scm_current_error_port ()
3905 Return the port to which errors and warnings should be sent (the
3906 @dfn{standard error} in Unix and C terminology).
3907 @end deffn
3908
3909 \fcurrent-load-port
3910 @c snarfed from ports.c:387
3911 @deffn {Scheme Procedure} current-load-port
3912 @deffnx {C Function} scm_current_load_port ()
3913 Return the current-load-port.
3914 The load port is used internally by @code{primitive-load}.
3915 @end deffn
3916
3917 \fset-current-input-port
3918 @c snarfed from ports.c:400
3919 @deffn {Scheme Procedure} set-current-input-port port
3920 @deffnx {Scheme Procedure} set-current-output-port port
3921 @deffnx {Scheme Procedure} set-current-error-port port
3922 @deffnx {C Function} scm_set_current_input_port (port)
3923 Change the ports returned by @code{current-input-port},
3924 @code{current-output-port} and @code{current-error-port}, respectively,
3925 so that they use the supplied @var{port} for input or output.
3926 @end deffn
3927
3928 \fset-current-output-port
3929 @c snarfed from ports.c:413
3930 @deffn {Scheme Procedure} set-current-output-port port
3931 @deffnx {C Function} scm_set_current_output_port (port)
3932 Set the current default output port to @var{port}.
3933 @end deffn
3934
3935 \fset-current-error-port
3936 @c snarfed from ports.c:427
3937 @deffn {Scheme Procedure} set-current-error-port port
3938 @deffnx {C Function} scm_set_current_error_port (port)
3939 Set the current default error port to @var{port}.
3940 @end deffn
3941
3942 \fport-revealed
3943 @c snarfed from ports.c:625
3944 @deffn {Scheme Procedure} port-revealed port
3945 @deffnx {C Function} scm_port_revealed (port)
3946 Return the revealed count for @var{port}.
3947 @end deffn
3948
3949 \fset-port-revealed!
3950 @c snarfed from ports.c:638
3951 @deffn {Scheme Procedure} set-port-revealed! port rcount
3952 @deffnx {C Function} scm_set_port_revealed_x (port, rcount)
3953 Sets the revealed count for a port to a given value.
3954 The return value is unspecified.
3955 @end deffn
3956
3957 \fport-mode
3958 @c snarfed from ports.c:699
3959 @deffn {Scheme Procedure} port-mode port
3960 @deffnx {C Function} scm_port_mode (port)
3961 Return the port modes associated with the open port @var{port}.
3962 These will not necessarily be identical to the modes used when
3963 the port was opened, since modes such as "append" which are
3964 used only during port creation are not retained.
3965 @end deffn
3966
3967 \fclose-port
3968 @c snarfed from ports.c:736
3969 @deffn {Scheme Procedure} close-port port
3970 @deffnx {C Function} scm_close_port (port)
3971 Close the specified port object. Return @code{#t} if it
3972 successfully closes a port or @code{#f} if it was already
3973 closed. An exception may be raised if an error occurs, for
3974 example when flushing buffered output. See also @ref{Ports and
3975 File Descriptors, close}, for a procedure which can close file
3976 descriptors.
3977 @end deffn
3978
3979 \fclose-input-port
3980 @c snarfed from ports.c:766
3981 @deffn {Scheme Procedure} close-input-port port
3982 @deffnx {C Function} scm_close_input_port (port)
3983 Close the specified input port object. The routine has no effect if
3984 the file has already been closed. An exception may be raised if an
3985 error occurs. The value returned is unspecified.
3986
3987 See also @ref{Ports and File Descriptors, close}, for a procedure
3988 which can close file descriptors.
3989 @end deffn
3990
3991 \fclose-output-port
3992 @c snarfed from ports.c:781
3993 @deffn {Scheme Procedure} close-output-port port
3994 @deffnx {C Function} scm_close_output_port (port)
3995 Close the specified output port object. The routine has no effect if
3996 the file has already been closed. An exception may be raised if an
3997 error occurs. The value returned is unspecified.
3998
3999 See also @ref{Ports and File Descriptors, close}, for a procedure
4000 which can close file descriptors.
4001 @end deffn
4002
4003 \fport-for-each
4004 @c snarfed from ports.c:827
4005 @deffn {Scheme Procedure} port-for-each proc
4006 @deffnx {C Function} scm_port_for_each (proc)
4007 Apply @var{proc} to each port in the Guile port table
4008 in turn. The return value is unspecified. More specifically,
4009 @var{proc} is applied exactly once to every port that exists
4010 in the system at the time @var{port-for-each} is invoked.
4011 Changes to the port table while @var{port-for-each} is running
4012 have no effect as far as @var{port-for-each} is concerned.
4013 @end deffn
4014
4015 \finput-port?
4016 @c snarfed from ports.c:845
4017 @deffn {Scheme Procedure} input-port? x
4018 @deffnx {C Function} scm_input_port_p (x)
4019 Return @code{#t} if @var{x} is an input port, otherwise return
4020 @code{#f}. Any object satisfying this predicate also satisfies
4021 @code{port?}.
4022 @end deffn
4023
4024 \foutput-port?
4025 @c snarfed from ports.c:856
4026 @deffn {Scheme Procedure} output-port? x
4027 @deffnx {C Function} scm_output_port_p (x)
4028 Return @code{#t} if @var{x} is an output port, otherwise return
4029 @code{#f}. Any object satisfying this predicate also satisfies
4030 @code{port?}.
4031 @end deffn
4032
4033 \fport?
4034 @c snarfed from ports.c:868
4035 @deffn {Scheme Procedure} port? x
4036 @deffnx {C Function} scm_port_p (x)
4037 Return a boolean indicating whether @var{x} is a port.
4038 Equivalent to @code{(or (input-port? @var{x}) (output-port?
4039 @var{x}))}.
4040 @end deffn
4041
4042 \fport-closed?
4043 @c snarfed from ports.c:878
4044 @deffn {Scheme Procedure} port-closed? port
4045 @deffnx {C Function} scm_port_closed_p (port)
4046 Return @code{#t} if @var{port} is closed or @code{#f} if it is
4047 open.
4048 @end deffn
4049
4050 \feof-object?
4051 @c snarfed from ports.c:889
4052 @deffn {Scheme Procedure} eof-object? x
4053 @deffnx {C Function} scm_eof_object_p (x)
4054 Return @code{#t} if @var{x} is an end-of-file object; otherwise
4055 return @code{#f}.
4056 @end deffn
4057
4058 \fforce-output
4059 @c snarfed from ports.c:903
4060 @deffn {Scheme Procedure} force-output [port]
4061 @deffnx {C Function} scm_force_output (port)
4062 Flush the specified output port, or the current output port if @var{port}
4063 is omitted. The current output buffer contents are passed to the
4064 underlying port implementation (e.g., in the case of fports, the
4065 data will be written to the file and the output buffer will be cleared.)
4066 It has no effect on an unbuffered port.
4067
4068 The return value is unspecified.
4069 @end deffn
4070
4071 \fflush-all-ports
4072 @c snarfed from ports.c:921
4073 @deffn {Scheme Procedure} flush-all-ports
4074 @deffnx {C Function} scm_flush_all_ports ()
4075 Equivalent to calling @code{force-output} on
4076 all open output ports. The return value is unspecified.
4077 @end deffn
4078
4079 \fread-char
4080 @c snarfed from ports.c:941
4081 @deffn {Scheme Procedure} read-char [port]
4082 @deffnx {C Function} scm_read_char (port)
4083 Return the next character available from @var{port}, updating
4084 @var{port} to point to the following character. If no more
4085 characters are available, the end-of-file object is returned.
4086 @end deffn
4087
4088 \fpeek-char
4089 @c snarfed from ports.c:1283
4090 @deffn {Scheme Procedure} peek-char [port]
4091 @deffnx {C Function} scm_peek_char (port)
4092 Return the next character available from @var{port},
4093 @emph{without} updating @var{port} to point to the following
4094 character. If no more characters are available, the
4095 end-of-file object is returned.
4096
4097 The value returned by
4098 a call to @code{peek-char} is the same as the value that would
4099 have been returned by a call to @code{read-char} on the same
4100 port. The only difference is that the very next call to
4101 @code{read-char} or @code{peek-char} on that @var{port} will
4102 return the value returned by the preceding call to
4103 @code{peek-char}. In particular, a call to @code{peek-char} on
4104 an interactive port will hang waiting for input whenever a call
4105 to @code{read-char} would have hung.
4106 @end deffn
4107
4108 \funread-char
4109 @c snarfed from ports.c:1306
4110 @deffn {Scheme Procedure} unread-char cobj [port]
4111 @deffnx {C Function} scm_unread_char (cobj, port)
4112 Place @var{char} in @var{port} so that it will be read by the
4113 next read operation. If called multiple times, the unread characters
4114 will be read again in last-in first-out order. If @var{port} is
4115 not supplied, the current input port is used.
4116 @end deffn
4117
4118 \funread-string
4119 @c snarfed from ports.c:1329
4120 @deffn {Scheme Procedure} unread-string str port
4121 @deffnx {C Function} scm_unread_string (str, port)
4122 Place the string @var{str} in @var{port} so that its characters will be
4123 read in subsequent read operations. If called multiple times, the
4124 unread characters will be read again in last-in first-out order. If
4125 @var{port} is not supplied, the current-input-port is used.
4126 @end deffn
4127
4128 \fseek
4129 @c snarfed from ports.c:1368
4130 @deffn {Scheme Procedure} seek fd_port offset whence
4131 @deffnx {C Function} scm_seek (fd_port, offset, whence)
4132 Sets the current position of @var{fd/port} to the integer
4133 @var{offset}, which is interpreted according to the value of
4134 @var{whence}.
4135
4136 One of the following variables should be supplied for
4137 @var{whence}:
4138 @defvar SEEK_SET
4139 Seek from the beginning of the file.
4140 @end defvar
4141 @defvar SEEK_CUR
4142 Seek from the current position.
4143 @end defvar
4144 @defvar SEEK_END
4145 Seek from the end of the file.
4146 @end defvar
4147 If @var{fd/port} is a file descriptor, the underlying system
4148 call is @code{lseek}. @var{port} may be a string port.
4149
4150 The value returned is the new position in the file. This means
4151 that the current position of a port can be obtained using:
4152 @lisp
4153 (seek port 0 SEEK_CUR)
4154 @end lisp
4155 @end deffn
4156
4157 \ftruncate-file
4158 @c snarfed from ports.c:1426
4159 @deffn {Scheme Procedure} truncate-file object [length]
4160 @deffnx {C Function} scm_truncate_file (object, length)
4161 Truncates the object referred to by @var{object} to at most
4162 @var{length} bytes. @var{object} can be a string containing a
4163 file name or an integer file descriptor or a port.
4164 @var{length} may be omitted if @var{object} is not a file name,
4165 in which case the truncation occurs at the current port
4166 position. The return value is unspecified.
4167 @end deffn
4168
4169 \fport-line
4170 @c snarfed from ports.c:1486
4171 @deffn {Scheme Procedure} port-line port
4172 @deffnx {C Function} scm_port_line (port)
4173 Return the current line number for @var{port}.
4174
4175 The first line of a file is 0. But you might want to add 1
4176 when printing line numbers, since starting from 1 is
4177 traditional in error messages, and likely to be more natural to
4178 non-programmers.
4179 @end deffn
4180
4181 \fset-port-line!
4182 @c snarfed from ports.c:1498
4183 @deffn {Scheme Procedure} set-port-line! port line
4184 @deffnx {C Function} scm_set_port_line_x (port, line)
4185 Set the current line number for @var{port} to @var{line}. The
4186 first line of a file is 0.
4187 @end deffn
4188
4189 \fport-column
4190 @c snarfed from ports.c:1517
4191 @deffn {Scheme Procedure} port-column port
4192 @deffnx {C Function} scm_port_column (port)
4193 Return the current column number of @var{port}.
4194 If the number is
4195 unknown, the result is #f. Otherwise, the result is a 0-origin integer
4196 - i.e. the first character of the first line is line 0, column 0.
4197 (However, when you display a file position, for example in an error
4198 message, we recommend you add 1 to get 1-origin integers. This is
4199 because lines and column numbers traditionally start with 1, and that is
4200 what non-programmers will find most natural.)
4201 @end deffn
4202
4203 \fset-port-column!
4204 @c snarfed from ports.c:1529
4205 @deffn {Scheme Procedure} set-port-column! port column
4206 @deffnx {C Function} scm_set_port_column_x (port, column)
4207 Set the current column of @var{port}. Before reading the first
4208 character on a line the column should be 0.
4209 @end deffn
4210
4211 \fport-filename
4212 @c snarfed from ports.c:1543
4213 @deffn {Scheme Procedure} port-filename port
4214 @deffnx {C Function} scm_port_filename (port)
4215 Return the filename associated with @var{port}. This function returns
4216 the strings "standard input", "standard output" and "standard error"
4217 when called on the current input, output and error ports respectively.
4218 @end deffn
4219
4220 \fset-port-filename!
4221 @c snarfed from ports.c:1557
4222 @deffn {Scheme Procedure} set-port-filename! port filename
4223 @deffnx {C Function} scm_set_port_filename_x (port, filename)
4224 Change the filename associated with @var{port}, using the current input
4225 port if none is specified. Note that this does not change the port's
4226 source of data, but only the value that is returned by
4227 @code{port-filename} and reported in diagnostic output.
4228 @end deffn
4229
4230 \f%make-void-port
4231 @c snarfed from ports.c:1651
4232 @deffn {Scheme Procedure} %make-void-port mode
4233 @deffnx {C Function} scm_sys_make_void_port (mode)
4234 Create and return a new void port. A void port acts like
4235 @file{/dev/null}. The @var{mode} argument
4236 specifies the input/output modes for this port: see the
4237 documentation for @code{open-file} in @ref{File Ports}.
4238 @end deffn
4239
4240 \fprint-options-interface
4241 @c snarfed from print.c:87
4242 @deffn {Scheme Procedure} print-options-interface [setting]
4243 @deffnx {C Function} scm_print_options (setting)
4244 Option interface for the print options. Instead of using
4245 this procedure directly, use the procedures
4246 @code{print-enable}, @code{print-disable}, @code{print-set!}
4247 and @code{print-options}.
4248 @end deffn
4249
4250 \fsimple-format
4251 @c snarfed from print.c:929
4252 @deffn {Scheme Procedure} simple-format destination message . args
4253 @deffnx {C Function} scm_simple_format (destination, message, args)
4254 Write @var{message} to @var{destination}, defaulting to
4255 the current output port.
4256 @var{message} can contain @code{~A} (was @code{%s}) and
4257 @code{~S} (was @code{%S}) escapes. When printed,
4258 the escapes are replaced with corresponding members of
4259 @var{ARGS}:
4260 @code{~A} formats using @code{display} and @code{~S} formats
4261 using @code{write}.
4262 If @var{destination} is @code{#t}, then use the current output
4263 port, if @var{destination} is @code{#f}, then return a string
4264 containing the formatted text. Does not add a trailing newline.
4265 @end deffn
4266
4267 \fnewline
4268 @c snarfed from print.c:1019
4269 @deffn {Scheme Procedure} newline [port]
4270 @deffnx {C Function} scm_newline (port)
4271 Send a newline to @var{port}.
4272 If @var{port} is omitted, send to the current output port.
4273 @end deffn
4274
4275 \fwrite-char
4276 @c snarfed from print.c:1034
4277 @deffn {Scheme Procedure} write-char chr [port]
4278 @deffnx {C Function} scm_write_char (chr, port)
4279 Send character @var{chr} to @var{port}.
4280 @end deffn
4281
4282 \fport-with-print-state
4283 @c snarfed from print.c:1088
4284 @deffn {Scheme Procedure} port-with-print-state port [pstate]
4285 @deffnx {C Function} scm_port_with_print_state (port, pstate)
4286 Create a new port which behaves like @var{port}, but with an
4287 included print state @var{pstate}. @var{pstate} is optional.
4288 If @var{pstate} isn't supplied and @var{port} already has
4289 a print state, the old print state is reused.
4290 @end deffn
4291
4292 \fget-print-state
4293 @c snarfed from print.c:1101
4294 @deffn {Scheme Procedure} get-print-state port
4295 @deffnx {C Function} scm_get_print_state (port)
4296 Return the print state of the port @var{port}. If @var{port}
4297 has no associated print state, @code{#f} is returned.
4298 @end deffn
4299
4300 \fprocedure-properties
4301 @c snarfed from procprop.c:160
4302 @deffn {Scheme Procedure} procedure-properties proc
4303 @deffnx {C Function} scm_procedure_properties (proc)
4304 Return @var{obj}'s property list.
4305 @end deffn
4306
4307 \fset-procedure-properties!
4308 @c snarfed from procprop.c:173
4309 @deffn {Scheme Procedure} set-procedure-properties! proc new_val
4310 @deffnx {C Function} scm_set_procedure_properties_x (proc, new_val)
4311 Set @var{obj}'s property list to @var{alist}.
4312 @end deffn
4313
4314 \fprocedure-property
4315 @c snarfed from procprop.c:186
4316 @deffn {Scheme Procedure} procedure-property p k
4317 @deffnx {C Function} scm_procedure_property (p, k)
4318 Return the property of @var{obj} with name @var{key}.
4319 @end deffn
4320
4321 \fset-procedure-property!
4322 @c snarfed from procprop.c:209
4323 @deffn {Scheme Procedure} set-procedure-property! p k v
4324 @deffnx {C Function} scm_set_procedure_property_x (p, k, v)
4325 In @var{obj}'s property list, set the property named @var{key} to
4326 @var{value}.
4327 @end deffn
4328
4329 \fprocedure?
4330 @c snarfed from procs.c:162
4331 @deffn {Scheme Procedure} procedure? obj
4332 @deffnx {C Function} scm_procedure_p (obj)
4333 Return @code{#t} if @var{obj} is a procedure.
4334 @end deffn
4335
4336 \fclosure?
4337 @c snarfed from procs.c:189
4338 @deffn {Scheme Procedure} closure? obj
4339 @deffnx {C Function} scm_closure_p (obj)
4340 Return @code{#t} if @var{obj} is a closure.
4341 @end deffn
4342
4343 \fthunk?
4344 @c snarfed from procs.c:198
4345 @deffn {Scheme Procedure} thunk? obj
4346 @deffnx {C Function} scm_thunk_p (obj)
4347 Return @code{#t} if @var{obj} is a thunk.
4348 @end deffn
4349
4350 \fprocedure-documentation
4351 @c snarfed from procs.c:248
4352 @deffn {Scheme Procedure} procedure-documentation proc
4353 @deffnx {C Function} scm_procedure_documentation (proc)
4354 Return the documentation string associated with @code{proc}. By
4355 convention, if a procedure contains more than one expression and the
4356 first expression is a string constant, that string is assumed to contain
4357 documentation for that procedure.
4358 @end deffn
4359
4360 \fprocedure-with-setter?
4361 @c snarfed from procs.c:284
4362 @deffn {Scheme Procedure} procedure-with-setter? obj
4363 @deffnx {C Function} scm_procedure_with_setter_p (obj)
4364 Return @code{#t} if @var{obj} is a procedure with an
4365 associated setter procedure.
4366 @end deffn
4367
4368 \fmake-procedure-with-setter
4369 @c snarfed from procs.c:294
4370 @deffn {Scheme Procedure} make-procedure-with-setter procedure setter
4371 @deffnx {C Function} scm_make_procedure_with_setter (procedure, setter)
4372 Create a new procedure which behaves like @var{procedure}, but
4373 with the associated setter @var{setter}.
4374 @end deffn
4375
4376 \fprocedure
4377 @c snarfed from procs.c:308
4378 @deffn {Scheme Procedure} procedure proc
4379 @deffnx {C Function} scm_procedure (proc)
4380 Return the procedure of @var{proc}, which must be either a
4381 procedure with setter, or an operator struct.
4382 @end deffn
4383
4384 \fprimitive-make-property
4385 @c snarfed from properties.c:40
4386 @deffn {Scheme Procedure} primitive-make-property not_found_proc
4387 @deffnx {C Function} scm_primitive_make_property (not_found_proc)
4388 Create a @dfn{property token} that can be used with
4389 @code{primitive-property-ref} and @code{primitive-property-set!}.
4390 See @code{primitive-property-ref} for the significance of
4391 @var{not_found_proc}.
4392 @end deffn
4393
4394 \fprimitive-property-ref
4395 @c snarfed from properties.c:59
4396 @deffn {Scheme Procedure} primitive-property-ref prop obj
4397 @deffnx {C Function} scm_primitive_property_ref (prop, obj)
4398 Return the property @var{prop} of @var{obj}.
4399
4400 When no value has yet been associated with @var{prop} and
4401 @var{obj}, the @var{not-found-proc} from @var{prop} is used. A
4402 call @code{(@var{not-found-proc} @var{prop} @var{obj})} is made
4403 and the result set as the property value. If
4404 @var{not-found-proc} is @code{#f} then @code{#f} is the
4405 property value.
4406 @end deffn
4407
4408 \fprimitive-property-set!
4409 @c snarfed from properties.c:90
4410 @deffn {Scheme Procedure} primitive-property-set! prop obj val
4411 @deffnx {C Function} scm_primitive_property_set_x (prop, obj, val)
4412 Set the property @var{prop} of @var{obj} to @var{val}.
4413 @end deffn
4414
4415 \fprimitive-property-del!
4416 @c snarfed from properties.c:111
4417 @deffn {Scheme Procedure} primitive-property-del! prop obj
4418 @deffnx {C Function} scm_primitive_property_del_x (prop, obj)
4419 Remove any value associated with @var{prop} and @var{obj}.
4420 @end deffn
4421
4422 \frandom
4423 @c snarfed from random.c:347
4424 @deffn {Scheme Procedure} random n [state]
4425 @deffnx {C Function} scm_random (n, state)
4426 Return a number in [0, N).
4427
4428 Accepts a positive integer or real n and returns a
4429 number of the same type between zero (inclusive) and
4430 N (exclusive). The values returned have a uniform
4431 distribution.
4432
4433 The optional argument @var{state} must be of the type produced
4434 by @code{seed->random-state}. It defaults to the value of the
4435 variable @var{*random-state*}. This object is used to maintain
4436 the state of the pseudo-random-number generator and is altered
4437 as a side effect of the random operation.
4438 @end deffn
4439
4440 \fcopy-random-state
4441 @c snarfed from random.c:372
4442 @deffn {Scheme Procedure} copy-random-state [state]
4443 @deffnx {C Function} scm_copy_random_state (state)
4444 Return a copy of the random state @var{state}.
4445 @end deffn
4446
4447 \fseed->random-state
4448 @c snarfed from random.c:384
4449 @deffn {Scheme Procedure} seed->random-state seed
4450 @deffnx {C Function} scm_seed_to_random_state (seed)
4451 Return a new random state using @var{seed}.
4452 @end deffn
4453
4454 \frandom:uniform
4455 @c snarfed from random.c:402
4456 @deffn {Scheme Procedure} random:uniform [state]
4457 @deffnx {C Function} scm_random_uniform (state)
4458 Return a uniformly distributed inexact real random number in
4459 [0,1).
4460 @end deffn
4461
4462 \frandom:normal
4463 @c snarfed from random.c:417
4464 @deffn {Scheme Procedure} random:normal [state]
4465 @deffnx {C Function} scm_random_normal (state)
4466 Return an inexact real in a normal distribution. The
4467 distribution used has mean 0 and standard deviation 1. For a
4468 normal distribution with mean m and standard deviation d use
4469 @code{(+ m (* d (random:normal)))}.
4470 @end deffn
4471
4472 \frandom:solid-sphere!
4473 @c snarfed from random.c:500
4474 @deffn {Scheme Procedure} random:solid-sphere! v [state]
4475 @deffnx {C Function} scm_random_solid_sphere_x (v, state)
4476 Fills @var{vect} with inexact real random numbers the sum of
4477 whose squares is less than 1.0. Thinking of @var{vect} as
4478 coordinates in space of dimension @var{n} @math{=}
4479 @code{(vector-length @var{vect})}, the coordinates are
4480 uniformly distributed within the unit @var{n}-sphere.
4481 @end deffn
4482
4483 \frandom:hollow-sphere!
4484 @c snarfed from random.c:522
4485 @deffn {Scheme Procedure} random:hollow-sphere! v [state]
4486 @deffnx {C Function} scm_random_hollow_sphere_x (v, state)
4487 Fills vect with inexact real random numbers
4488 the sum of whose squares is equal to 1.0.
4489 Thinking of vect as coordinates in space of
4490 dimension n = (vector-length vect), the coordinates
4491 are uniformly distributed over the surface of the
4492 unit n-sphere.
4493 @end deffn
4494
4495 \frandom:normal-vector!
4496 @c snarfed from random.c:539
4497 @deffn {Scheme Procedure} random:normal-vector! v [state]
4498 @deffnx {C Function} scm_random_normal_vector_x (v, state)
4499 Fills vect with inexact real random numbers that are
4500 independent and standard normally distributed
4501 (i.e., with mean 0 and variance 1).
4502 @end deffn
4503
4504 \frandom:exp
4505 @c snarfed from random.c:577
4506 @deffn {Scheme Procedure} random:exp [state]
4507 @deffnx {C Function} scm_random_exp (state)
4508 Return an inexact real in an exponential distribution with mean
4509 1. For an exponential distribution with mean u use (* u
4510 (random:exp)).
4511 @end deffn
4512
4513 \f%read-delimited!
4514 @c snarfed from rdelim.c:55
4515 @deffn {Scheme Procedure} %read-delimited! delims str gobble [port [start [end]]]
4516 @deffnx {C Function} scm_read_delimited_x (delims, str, gobble, port, start, end)
4517 Read characters from @var{port} into @var{str} until one of the
4518 characters in the @var{delims} string is encountered. If
4519 @var{gobble} is true, discard the delimiter character;
4520 otherwise, leave it in the input stream for the next read. If
4521 @var{port} is not specified, use the value of
4522 @code{(current-input-port)}. If @var{start} or @var{end} are
4523 specified, store data only into the substring of @var{str}
4524 bounded by @var{start} and @var{end} (which default to the
4525 beginning and end of the string, respectively).
4526
4527 Return a pair consisting of the delimiter that terminated the
4528 string and the number of characters read. If reading stopped
4529 at the end of file, the delimiter returned is the
4530 @var{eof-object}; if the string was filled without encountering
4531 a delimiter, this value is @code{#f}.
4532 @end deffn
4533
4534 \f%read-line
4535 @c snarfed from rdelim.c:202
4536 @deffn {Scheme Procedure} %read-line [port]
4537 @deffnx {C Function} scm_read_line (port)
4538 Read a newline-terminated line from @var{port}, allocating storage as
4539 necessary. The newline terminator (if any) is removed from the string,
4540 and a pair consisting of the line and its delimiter is returned. The
4541 delimiter may be either a newline or the @var{eof-object}; if
4542 @code{%read-line} is called at the end of file, it returns the pair
4543 @code{(#<eof> . #<eof>)}.
4544 @end deffn
4545
4546 \fwrite-line
4547 @c snarfed from rdelim.c:255
4548 @deffn {Scheme Procedure} write-line obj [port]
4549 @deffnx {C Function} scm_write_line (obj, port)
4550 Display @var{obj} and a newline character to @var{port}. If
4551 @var{port} is not specified, @code{(current-output-port)} is
4552 used. This function is equivalent to:
4553 @lisp
4554 (display obj [port])
4555 (newline [port])
4556 @end lisp
4557 @end deffn
4558
4559 \fread-options-interface
4560 @c snarfed from read.c:110
4561 @deffn {Scheme Procedure} read-options-interface [setting]
4562 @deffnx {C Function} scm_read_options (setting)
4563 Option interface for the read options. Instead of using
4564 this procedure directly, use the procedures @code{read-enable},
4565 @code{read-disable}, @code{read-set!} and @code{read-options}.
4566 @end deffn
4567
4568 \fread
4569 @c snarfed from read.c:130
4570 @deffn {Scheme Procedure} read [port]
4571 @deffnx {C Function} scm_read (port)
4572 Read an s-expression from the input port @var{port}, or from
4573 the current input port if @var{port} is not specified.
4574 Any whitespace before the next token is discarded.
4575 @end deffn
4576
4577 \fread-hash-extend
4578 @c snarfed from read.c:898
4579 @deffn {Scheme Procedure} read-hash-extend chr proc
4580 @deffnx {C Function} scm_read_hash_extend (chr, proc)
4581 Install the procedure @var{proc} for reading expressions
4582 starting with the character sequence @code{#} and @var{chr}.
4583 @var{proc} will be called with two arguments: the character
4584 @var{chr} and the port to read further data from. The object
4585 returned will be the return value of @code{read}.
4586 @end deffn
4587
4588 \fcall-with-dynamic-root
4589 @c snarfed from root.c:160
4590 @deffn {Scheme Procedure} call-with-dynamic-root thunk handler
4591 @deffnx {C Function} scm_call_with_dynamic_root (thunk, handler)
4592 Call @var{thunk} with a new dynamic state and withina continuation barrier. The @var{handler} catches allotherwise uncaught throws and executes within the samedynamic context as @var{thunk}.
4593 @end deffn
4594
4595 \fdynamic-root
4596 @c snarfed from root.c:171
4597 @deffn {Scheme Procedure} dynamic-root
4598 @deffnx {C Function} scm_dynamic_root ()
4599 Return an object representing the current dynamic root.
4600
4601 These objects are only useful for comparison using @code{eq?}.
4602
4603 @end deffn
4604
4605 \fread-string!/partial
4606 @c snarfed from rw.c:101
4607 @deffn {Scheme Procedure} read-string!/partial str [port_or_fdes [start [end]]]
4608 @deffnx {C Function} scm_read_string_x_partial (str, port_or_fdes, start, end)
4609 Read characters from a port or file descriptor into a
4610 string @var{str}. A port must have an underlying file
4611 descriptor --- a so-called fport. This procedure is
4612 scsh-compatible and can efficiently read large strings.
4613 It will:
4614
4615 @itemize
4616 @item
4617 attempt to fill the entire string, unless the @var{start}
4618 and/or @var{end} arguments are supplied. i.e., @var{start}
4619 defaults to 0 and @var{end} defaults to
4620 @code{(string-length str)}
4621 @item
4622 use the current input port if @var{port_or_fdes} is not
4623 supplied.
4624 @item
4625 return fewer than the requested number of characters in some
4626 cases, e.g., on end of file, if interrupted by a signal, or if
4627 not all the characters are immediately available.
4628 @item
4629 wait indefinitely for some input if no characters are
4630 currently available,
4631 unless the port is in non-blocking mode.
4632 @item
4633 read characters from the port's input buffers if available,
4634 instead from the underlying file descriptor.
4635 @item
4636 return @code{#f} if end-of-file is encountered before reading
4637 any characters, otherwise return the number of characters
4638 read.
4639 @item
4640 return 0 if the port is in non-blocking mode and no characters
4641 are immediately available.
4642 @item
4643 return 0 if the request is for 0 bytes, with no
4644 end-of-file check.
4645 @end itemize
4646 @end deffn
4647
4648 \fwrite-string/partial
4649 @c snarfed from rw.c:205
4650 @deffn {Scheme Procedure} write-string/partial str [port_or_fdes [start [end]]]
4651 @deffnx {C Function} scm_write_string_partial (str, port_or_fdes, start, end)
4652 Write characters from a string @var{str} to a port or file
4653 descriptor. A port must have an underlying file descriptor
4654 --- a so-called fport. This procedure is
4655 scsh-compatible and can efficiently write large strings.
4656 It will:
4657
4658 @itemize
4659 @item
4660 attempt to write the entire string, unless the @var{start}
4661 and/or @var{end} arguments are supplied. i.e., @var{start}
4662 defaults to 0 and @var{end} defaults to
4663 @code{(string-length str)}
4664 @item
4665 use the current output port if @var{port_of_fdes} is not
4666 supplied.
4667 @item
4668 in the case of a buffered port, store the characters in the
4669 port's output buffer, if all will fit. If they will not fit
4670 then any existing buffered characters will be flushed
4671 before attempting
4672 to write the new characters directly to the underlying file
4673 descriptor. If the port is in non-blocking mode and
4674 buffered characters can not be flushed immediately, then an
4675 @code{EAGAIN} system-error exception will be raised (Note:
4676 scsh does not support the use of non-blocking buffered ports.)
4677 @item
4678 write fewer than the requested number of
4679 characters in some cases, e.g., if interrupted by a signal or
4680 if not all of the output can be accepted immediately.
4681 @item
4682 wait indefinitely for at least one character
4683 from @var{str} to be accepted by the port, unless the port is
4684 in non-blocking mode.
4685 @item
4686 return the number of characters accepted by the port.
4687 @item
4688 return 0 if the port is in non-blocking mode and can not accept
4689 at least one character from @var{str} immediately
4690 @item
4691 return 0 immediately if the request size is 0 bytes.
4692 @end itemize
4693 @end deffn
4694
4695 \fsigaction
4696 @c snarfed from scmsigs.c:253
4697 @deffn {Scheme Procedure} sigaction signum [handler [flags [thread]]]
4698 @deffnx {C Function} scm_sigaction_for_thread (signum, handler, flags, thread)
4699 Install or report the signal handler for a specified signal.
4700
4701 @var{signum} is the signal number, which can be specified using the value
4702 of variables such as @code{SIGINT}.
4703
4704 If @var{handler} is omitted, @code{sigaction} returns a pair: the
4705 CAR is the current
4706 signal hander, which will be either an integer with the value @code{SIG_DFL}
4707 (default action) or @code{SIG_IGN} (ignore), or the Scheme procedure which
4708 handles the signal, or @code{#f} if a non-Scheme procedure handles the
4709 signal. The CDR contains the current @code{sigaction} flags for the handler.
4710
4711 If @var{handler} is provided, it is installed as the new handler for
4712 @var{signum}. @var{handler} can be a Scheme procedure taking one
4713 argument, or the value of @code{SIG_DFL} (default action) or
4714 @code{SIG_IGN} (ignore), or @code{#f} to restore whatever signal handler
4715 was installed before @code{sigaction} was first used. When
4716 a scheme procedure has been specified, that procedure will run
4717 in the given @var{thread}. When no thread has been given, the
4718 thread that made this call to @code{sigaction} is used.
4719 Flags can optionally be specified for the new handler (@code{SA_RESTART} will
4720 always be added if it's available and the system is using restartable
4721 system calls.) The return value is a pair with information about the
4722 old handler as described above.
4723
4724 This interface does not provide access to the "signal blocking"
4725 facility. Maybe this is not needed, since the thread support may
4726 provide solutions to the problem of consistent access to data
4727 structures.
4728 @end deffn
4729
4730 \frestore-signals
4731 @c snarfed from scmsigs.c:427
4732 @deffn {Scheme Procedure} restore-signals
4733 @deffnx {C Function} scm_restore_signals ()
4734 Return all signal handlers to the values they had before any call to
4735 @code{sigaction} was made. The return value is unspecified.
4736 @end deffn
4737
4738 \falarm
4739 @c snarfed from scmsigs.c:464
4740 @deffn {Scheme Procedure} alarm i
4741 @deffnx {C Function} scm_alarm (i)
4742 Set a timer to raise a @code{SIGALRM} signal after the specified
4743 number of seconds (an integer). It's advisable to install a signal
4744 handler for
4745 @code{SIGALRM} beforehand, since the default action is to terminate
4746 the process.
4747
4748 The return value indicates the time remaining for the previous alarm,
4749 if any. The new value replaces the previous alarm. If there was
4750 no previous alarm, the return value is zero.
4751 @end deffn
4752
4753 \fsetitimer
4754 @c snarfed from scmsigs.c:491
4755 @deffn {Scheme Procedure} setitimer which_timer interval_seconds interval_microseconds value_seconds value_microseconds
4756 @deffnx {C Function} scm_setitimer (which_timer, interval_seconds, interval_microseconds, value_seconds, value_microseconds)
4757 Set the timer specified by @var{which_timer} according to the given
4758 @var{interval_seconds}, @var{interval_microseconds},
4759 @var{value_seconds}, and @var{value_microseconds} values.
4760
4761 Return information about the timer's previous setting.
4762 Errors are handled as described in the guile info pages under ``POSIX
4763 Interface Conventions''.
4764
4765 The timers available are: @code{ITIMER_REAL}, @code{ITIMER_VIRTUAL},
4766 and @code{ITIMER_PROF}.
4767
4768 The return value will be a list of two cons pairs representing the
4769 current state of the given timer. The first pair is the seconds and
4770 microseconds of the timer @code{it_interval}, and the second pair is
4771 the seconds and microseconds of the timer @code{it_value}.
4772 @end deffn
4773
4774 \fgetitimer
4775 @c snarfed from scmsigs.c:532
4776 @deffn {Scheme Procedure} getitimer which_timer
4777 @deffnx {C Function} scm_getitimer (which_timer)
4778 Return information about the timer specified by @var{which_timer}
4779 Errors are handled as described in the guile info pages under ``POSIX
4780 Interface Conventions''.
4781
4782 The timers available are: @code{ITIMER_REAL}, @code{ITIMER_VIRTUAL},
4783 and @code{ITIMER_PROF}.
4784
4785 The return value will be a list of two cons pairs representing the
4786 current state of the given timer. The first pair is the seconds and
4787 microseconds of the timer @code{it_interval}, and the second pair is
4788 the seconds and microseconds of the timer @code{it_value}.
4789 @end deffn
4790
4791 \fpause
4792 @c snarfed from scmsigs.c:559
4793 @deffn {Scheme Procedure} pause
4794 @deffnx {C Function} scm_pause ()
4795 Pause the current process (thread?) until a signal arrives whose
4796 action is to either terminate the current process or invoke a
4797 handler procedure. The return value is unspecified.
4798 @end deffn
4799
4800 \fsleep
4801 @c snarfed from scmsigs.c:572
4802 @deffn {Scheme Procedure} sleep i
4803 @deffnx {C Function} scm_sleep (i)
4804 Wait for the given number of seconds (an integer) or until a signal
4805 arrives. The return value is zero if the time elapses or the number
4806 of seconds remaining otherwise.
4807 @end deffn
4808
4809 \fusleep
4810 @c snarfed from scmsigs.c:581
4811 @deffn {Scheme Procedure} usleep i
4812 @deffnx {C Function} scm_usleep (i)
4813 Sleep for @var{i} microseconds.
4814 @end deffn
4815
4816 \fraise
4817 @c snarfed from scmsigs.c:591
4818 @deffn {Scheme Procedure} raise sig
4819 @deffnx {C Function} scm_raise (sig)
4820 Sends a specified signal @var{sig} to the current process, where
4821 @var{sig} is as described for the kill procedure.
4822 @end deffn
4823
4824 \fsystem
4825 @c snarfed from simpos.c:64
4826 @deffn {Scheme Procedure} system [cmd]
4827 @deffnx {C Function} scm_system (cmd)
4828 Execute @var{cmd} using the operating system's "command
4829 processor". Under Unix this is usually the default shell
4830 @code{sh}. The value returned is @var{cmd}'s exit status as
4831 returned by @code{waitpid}, which can be interpreted using
4832 @code{status:exit-val} and friends.
4833
4834 If @code{system} is called without arguments, return a boolean
4835 indicating whether the command processor is available.
4836 @end deffn
4837
4838 \fsystem*
4839 @c snarfed from simpos.c:114
4840 @deffn {Scheme Procedure} system* . args
4841 @deffnx {C Function} scm_system_star (args)
4842 Execute the command indicated by @var{args}. The first element must
4843 be a string indicating the command to be executed, and the remaining
4844 items must be strings representing each of the arguments to that
4845 command.
4846
4847 This function returns the exit status of the command as provided by
4848 @code{waitpid}. This value can be handled with @code{status:exit-val}
4849 and the related functions.
4850
4851 @code{system*} is similar to @code{system}, but accepts only one
4852 string per-argument, and performs no shell interpretation. The
4853 command is executed using fork and execlp. Accordingly this function
4854 may be safer than @code{system} in situations where shell
4855 interpretation is not required.
4856
4857 Example: (system* "echo" "foo" "bar")
4858 @end deffn
4859
4860 \fgetenv
4861 @c snarfed from simpos.c:184
4862 @deffn {Scheme Procedure} getenv nam
4863 @deffnx {C Function} scm_getenv (nam)
4864 Looks up the string @var{name} in the current environment. The return
4865 value is @code{#f} unless a string of the form @code{NAME=VALUE} is
4866 found, in which case the string @code{VALUE} is returned.
4867 @end deffn
4868
4869 \fprimitive-exit
4870 @c snarfed from simpos.c:200
4871 @deffn {Scheme Procedure} primitive-exit [status]
4872 @deffnx {C Function} scm_primitive_exit (status)
4873 Terminate the current process without unwinding the Scheme stack.
4874 This is would typically be useful after a fork. The exit status
4875 is @var{status} if supplied, otherwise zero.
4876 @end deffn
4877
4878 \frestricted-vector-sort!
4879 @c snarfed from sort.c:78
4880 @deffn {Scheme Procedure} restricted-vector-sort! vec less startpos endpos
4881 @deffnx {C Function} scm_restricted_vector_sort_x (vec, less, startpos, endpos)
4882 Sort the vector @var{vec}, using @var{less} for comparing
4883 the vector elements. @var{startpos} (inclusively) and
4884 @var{endpos} (exclusively) delimit
4885 the range of the vector which gets sorted. The return value
4886 is not specified.
4887 @end deffn
4888
4889 \fsorted?
4890 @c snarfed from sort.c:111
4891 @deffn {Scheme Procedure} sorted? items less
4892 @deffnx {C Function} scm_sorted_p (items, less)
4893 Return @code{#t} iff @var{items} is a list or a vector such that
4894 for all 1 <= i <= m, the predicate @var{less} returns true when
4895 applied to all elements i - 1 and i
4896 @end deffn
4897
4898 \fmerge
4899 @c snarfed from sort.c:186
4900 @deffn {Scheme Procedure} merge alist blist less
4901 @deffnx {C Function} scm_merge (alist, blist, less)
4902 Merge two already sorted lists into one.
4903 Given two lists @var{alist} and @var{blist}, such that
4904 @code{(sorted? alist less?)} and @code{(sorted? blist less?)},
4905 return a new list in which the elements of @var{alist} and
4906 @var{blist} have been stably interleaved so that
4907 @code{(sorted? (merge alist blist less?) less?)}.
4908 Note: this does _not_ accept vectors.
4909 @end deffn
4910
4911 \fmerge!
4912 @c snarfed from sort.c:303
4913 @deffn {Scheme Procedure} merge! alist blist less
4914 @deffnx {C Function} scm_merge_x (alist, blist, less)
4915 Takes two lists @var{alist} and @var{blist} such that
4916 @code{(sorted? alist less?)} and @code{(sorted? blist less?)} and
4917 returns a new list in which the elements of @var{alist} and
4918 @var{blist} have been stably interleaved so that
4919 @code{(sorted? (merge alist blist less?) less?)}.
4920 This is the destructive variant of @code{merge}
4921 Note: this does _not_ accept vectors.
4922 @end deffn
4923
4924 \fsort!
4925 @c snarfed from sort.c:373
4926 @deffn {Scheme Procedure} sort! items less
4927 @deffnx {C Function} scm_sort_x (items, less)
4928 Sort the sequence @var{items}, which may be a list or a
4929 vector. @var{less} is used for comparing the sequence
4930 elements. The sorting is destructive, that means that the
4931 input sequence is modified to produce the sorted result.
4932 This is not a stable sort.
4933 @end deffn
4934
4935 \fsort
4936 @c snarfed from sort.c:404
4937 @deffn {Scheme Procedure} sort items less
4938 @deffnx {C Function} scm_sort (items, less)
4939 Sort the sequence @var{items}, which may be a list or a
4940 vector. @var{less} is used for comparing the sequence
4941 elements. This is not a stable sort.
4942 @end deffn
4943
4944 \fstable-sort!
4945 @c snarfed from sort.c:487
4946 @deffn {Scheme Procedure} stable-sort! items less
4947 @deffnx {C Function} scm_stable_sort_x (items, less)
4948 Sort the sequence @var{items}, which may be a list or a
4949 vector. @var{less} is used for comparing the sequence elements.
4950 The sorting is destructive, that means that the input sequence
4951 is modified to produce the sorted result.
4952 This is a stable sort.
4953 @end deffn
4954
4955 \fstable-sort
4956 @c snarfed from sort.c:531
4957 @deffn {Scheme Procedure} stable-sort items less
4958 @deffnx {C Function} scm_stable_sort (items, less)
4959 Sort the sequence @var{items}, which may be a list or a
4960 vector. @var{less} is used for comparing the sequence elements.
4961 This is a stable sort.
4962 @end deffn
4963
4964 \fsort-list!
4965 @c snarfed from sort.c:549
4966 @deffn {Scheme Procedure} sort-list! items less
4967 @deffnx {C Function} scm_sort_list_x (items, less)
4968 Sort the list @var{items}, using @var{less} for comparing the
4969 list elements. The sorting is destructive, that means that the
4970 input list is modified to produce the sorted result.
4971 This is a stable sort.
4972 @end deffn
4973
4974 \fsort-list
4975 @c snarfed from sort.c:564
4976 @deffn {Scheme Procedure} sort-list items less
4977 @deffnx {C Function} scm_sort_list (items, less)
4978 Sort the list @var{items}, using @var{less} for comparing the
4979 list elements. This is a stable sort.
4980 @end deffn
4981
4982 \fsource-properties
4983 @c snarfed from srcprop.c:153
4984 @deffn {Scheme Procedure} source-properties obj
4985 @deffnx {C Function} scm_source_properties (obj)
4986 Return the source property association list of @var{obj}.
4987 @end deffn
4988
4989 \fset-source-properties!
4990 @c snarfed from srcprop.c:176
4991 @deffn {Scheme Procedure} set-source-properties! obj plist
4992 @deffnx {C Function} scm_set_source_properties_x (obj, plist)
4993 Install the association list @var{plist} as the source property
4994 list for @var{obj}.
4995 @end deffn
4996
4997 \fsource-property
4998 @c snarfed from srcprop.c:194
4999 @deffn {Scheme Procedure} source-property obj key
5000 @deffnx {C Function} scm_source_property (obj, key)
5001 Return the source property specified by @var{key} from
5002 @var{obj}'s source property list.
5003 @end deffn
5004
5005 \fset-source-property!
5006 @c snarfed from srcprop.c:225
5007 @deffn {Scheme Procedure} set-source-property! obj key datum
5008 @deffnx {C Function} scm_set_source_property_x (obj, key, datum)
5009 Set the source property of object @var{obj}, which is specified by
5010 @var{key} to @var{datum}. Normally, the key will be a symbol.
5011 @end deffn
5012
5013 \fstack?
5014 @c snarfed from stacks.c:391
5015 @deffn {Scheme Procedure} stack? obj
5016 @deffnx {C Function} scm_stack_p (obj)
5017 Return @code{#t} if @var{obj} is a calling stack.
5018 @end deffn
5019
5020 \fmake-stack
5021 @c snarfed from stacks.c:422
5022 @deffn {Scheme Procedure} make-stack obj . args
5023 @deffnx {C Function} scm_make_stack (obj, args)
5024 Create a new stack. If @var{obj} is @code{#t}, the current
5025 evaluation stack is used for creating the stack frames,
5026 otherwise the frames are taken from @var{obj} (which must be
5027 either a debug object or a continuation).
5028
5029 @var{args} should be a list containing any combination of
5030 integer, procedure and @code{#t} values.
5031
5032 These values specify various ways of cutting away uninteresting
5033 stack frames from the top and bottom of the stack that
5034 @code{make-stack} returns. They come in pairs like this:
5035 @code{(@var{inner_cut_1} @var{outer_cut_1} @var{inner_cut_2}
5036 @var{outer_cut_2} @dots{})}.
5037
5038 Each @var{inner_cut_N} can be @code{#t}, an integer, or a
5039 procedure. @code{#t} means to cut away all frames up to but
5040 excluding the first user module frame. An integer means to cut
5041 away exactly that number of frames. A procedure means to cut
5042 away all frames up to but excluding the application frame whose
5043 procedure matches the specified one.
5044
5045 Each @var{outer_cut_N} can be an integer or a procedure. An
5046 integer means to cut away that number of frames. A procedure
5047 means to cut away frames down to but excluding the application
5048 frame whose procedure matches the specified one.
5049
5050 If the @var{outer_cut_N} of the last pair is missing, it is
5051 taken as 0.
5052 @end deffn
5053
5054 \fstack-id
5055 @c snarfed from stacks.c:511
5056 @deffn {Scheme Procedure} stack-id stack
5057 @deffnx {C Function} scm_stack_id (stack)
5058 Return the identifier given to @var{stack} by @code{start-stack}.
5059 @end deffn
5060
5061 \fstack-ref
5062 @c snarfed from stacks.c:549
5063 @deffn {Scheme Procedure} stack-ref stack index
5064 @deffnx {C Function} scm_stack_ref (stack, index)
5065 Return the @var{index}'th frame from @var{stack}.
5066 @end deffn
5067
5068 \fstack-length
5069 @c snarfed from stacks.c:562
5070 @deffn {Scheme Procedure} stack-length stack
5071 @deffnx {C Function} scm_stack_length (stack)
5072 Return the length of @var{stack}.
5073 @end deffn
5074
5075 \fframe?
5076 @c snarfed from stacks.c:575
5077 @deffn {Scheme Procedure} frame? obj
5078 @deffnx {C Function} scm_frame_p (obj)
5079 Return @code{#t} if @var{obj} is a stack frame.
5080 @end deffn
5081
5082 \flast-stack-frame
5083 @c snarfed from stacks.c:586
5084 @deffn {Scheme Procedure} last-stack-frame obj
5085 @deffnx {C Function} scm_last_stack_frame (obj)
5086 Return a stack which consists of a single frame, which is the
5087 last stack frame for @var{obj}. @var{obj} must be either a
5088 debug object or a continuation.
5089 @end deffn
5090
5091 \fframe-number
5092 @c snarfed from stacks.c:625
5093 @deffn {Scheme Procedure} frame-number frame
5094 @deffnx {C Function} scm_frame_number (frame)
5095 Return the frame number of @var{frame}.
5096 @end deffn
5097
5098 \fframe-source
5099 @c snarfed from stacks.c:635
5100 @deffn {Scheme Procedure} frame-source frame
5101 @deffnx {C Function} scm_frame_source (frame)
5102 Return the source of @var{frame}.
5103 @end deffn
5104
5105 \fframe-procedure
5106 @c snarfed from stacks.c:646
5107 @deffn {Scheme Procedure} frame-procedure frame
5108 @deffnx {C Function} scm_frame_procedure (frame)
5109 Return the procedure for @var{frame}, or @code{#f} if no
5110 procedure is associated with @var{frame}.
5111 @end deffn
5112
5113 \fframe-arguments
5114 @c snarfed from stacks.c:658
5115 @deffn {Scheme Procedure} frame-arguments frame
5116 @deffnx {C Function} scm_frame_arguments (frame)
5117 Return the arguments of @var{frame}.
5118 @end deffn
5119
5120 \fframe-previous
5121 @c snarfed from stacks.c:669
5122 @deffn {Scheme Procedure} frame-previous frame
5123 @deffnx {C Function} scm_frame_previous (frame)
5124 Return the previous frame of @var{frame}, or @code{#f} if
5125 @var{frame} is the first frame in its stack.
5126 @end deffn
5127
5128 \fframe-next
5129 @c snarfed from stacks.c:685
5130 @deffn {Scheme Procedure} frame-next frame
5131 @deffnx {C Function} scm_frame_next (frame)
5132 Return the next frame of @var{frame}, or @code{#f} if
5133 @var{frame} is the last frame in its stack.
5134 @end deffn
5135
5136 \fframe-real?
5137 @c snarfed from stacks.c:700
5138 @deffn {Scheme Procedure} frame-real? frame
5139 @deffnx {C Function} scm_frame_real_p (frame)
5140 Return @code{#t} if @var{frame} is a real frame.
5141 @end deffn
5142
5143 \fframe-procedure?
5144 @c snarfed from stacks.c:710
5145 @deffn {Scheme Procedure} frame-procedure? frame
5146 @deffnx {C Function} scm_frame_procedure_p (frame)
5147 Return @code{#t} if a procedure is associated with @var{frame}.
5148 @end deffn
5149
5150 \fframe-evaluating-args?
5151 @c snarfed from stacks.c:720
5152 @deffn {Scheme Procedure} frame-evaluating-args? frame
5153 @deffnx {C Function} scm_frame_evaluating_args_p (frame)
5154 Return @code{#t} if @var{frame} contains evaluated arguments.
5155 @end deffn
5156
5157 \fframe-overflow?
5158 @c snarfed from stacks.c:730
5159 @deffn {Scheme Procedure} frame-overflow? frame
5160 @deffnx {C Function} scm_frame_overflow_p (frame)
5161 Return @code{#t} if @var{frame} is an overflow frame.
5162 @end deffn
5163
5164 \fget-internal-real-time
5165 @c snarfed from stime.c:133
5166 @deffn {Scheme Procedure} get-internal-real-time
5167 @deffnx {C Function} scm_get_internal_real_time ()
5168 Return the number of time units since the interpreter was
5169 started.
5170 @end deffn
5171
5172 \ftimes
5173 @c snarfed from stime.c:180
5174 @deffn {Scheme Procedure} times
5175 @deffnx {C Function} scm_times ()
5176 Return an object with information about real and processor
5177 time. The following procedures accept such an object as an
5178 argument and return a selected component:
5179
5180 @table @code
5181 @item tms:clock
5182 The current real time, expressed as time units relative to an
5183 arbitrary base.
5184 @item tms:utime
5185 The CPU time units used by the calling process.
5186 @item tms:stime
5187 The CPU time units used by the system on behalf of the calling
5188 process.
5189 @item tms:cutime
5190 The CPU time units used by terminated child processes of the
5191 calling process, whose status has been collected (e.g., using
5192 @code{waitpid}).
5193 @item tms:cstime
5194 Similarly, the CPU times units used by the system on behalf of
5195 terminated child processes.
5196 @end table
5197 @end deffn
5198
5199 \fget-internal-run-time
5200 @c snarfed from stime.c:212
5201 @deffn {Scheme Procedure} get-internal-run-time
5202 @deffnx {C Function} scm_get_internal_run_time ()
5203 Return the number of time units of processor time used by the
5204 interpreter. Both @emph{system} and @emph{user} time are
5205 included but subprocesses are not.
5206 @end deffn
5207
5208 \fcurrent-time
5209 @c snarfed from stime.c:229
5210 @deffn {Scheme Procedure} current-time
5211 @deffnx {C Function} scm_current_time ()
5212 Return the number of seconds since 1970-01-01 00:00:00 UTC,
5213 excluding leap seconds.
5214 @end deffn
5215
5216 \fgettimeofday
5217 @c snarfed from stime.c:248
5218 @deffn {Scheme Procedure} gettimeofday
5219 @deffnx {C Function} scm_gettimeofday ()
5220 Return a pair containing the number of seconds and microseconds
5221 since 1970-01-01 00:00:00 UTC, excluding leap seconds. Note:
5222 whether true microsecond resolution is available depends on the
5223 operating system.
5224 @end deffn
5225
5226 \flocaltime
5227 @c snarfed from stime.c:364
5228 @deffn {Scheme Procedure} localtime time [zone]
5229 @deffnx {C Function} scm_localtime (time, zone)
5230 Return an object representing the broken down components of
5231 @var{time}, an integer like the one returned by
5232 @code{current-time}. The time zone for the calculation is
5233 optionally specified by @var{zone} (a string), otherwise the
5234 @code{TZ} environment variable or the system default is used.
5235 @end deffn
5236
5237 \fgmtime
5238 @c snarfed from stime.c:449
5239 @deffn {Scheme Procedure} gmtime time
5240 @deffnx {C Function} scm_gmtime (time)
5241 Return an object representing the broken down components of
5242 @var{time}, an integer like the one returned by
5243 @code{current-time}. The values are calculated for UTC.
5244 @end deffn
5245
5246 \fmktime
5247 @c snarfed from stime.c:517
5248 @deffn {Scheme Procedure} mktime sbd_time [zone]
5249 @deffnx {C Function} scm_mktime (sbd_time, zone)
5250 @var{bd-time} is an object representing broken down time and @code{zone}
5251 is an optional time zone specifier (otherwise the TZ environment variable
5252 or the system default is used).
5253
5254 Returns a pair: the car is a corresponding
5255 integer time value like that returned
5256 by @code{current-time}; the cdr is a broken down time object, similar to
5257 as @var{bd-time} but with normalized values.
5258 @end deffn
5259
5260 \ftzset
5261 @c snarfed from stime.c:603
5262 @deffn {Scheme Procedure} tzset
5263 @deffnx {C Function} scm_tzset ()
5264 Initialize the timezone from the TZ environment variable
5265 or the system default. It's not usually necessary to call this procedure
5266 since it's done automatically by other procedures that depend on the
5267 timezone.
5268 @end deffn
5269
5270 \fstrftime
5271 @c snarfed from stime.c:620
5272 @deffn {Scheme Procedure} strftime format stime
5273 @deffnx {C Function} scm_strftime (format, stime)
5274 Formats a time specification @var{time} using @var{template}. @var{time}
5275 is an object with time components in the form returned by @code{localtime}
5276 or @code{gmtime}. @var{template} is a string which can include formatting
5277 specifications introduced by a @code{%} character. The formatting of
5278 month and day names is dependent on the current locale. The value returned
5279 is the formatted string.
5280 @xref{Formatting Date and Time, , , libc, The GNU C Library Reference Manual}.)
5281 @end deffn
5282
5283 \fstrptime
5284 @c snarfed from stime.c:721
5285 @deffn {Scheme Procedure} strptime format string
5286 @deffnx {C Function} scm_strptime (format, string)
5287 Performs the reverse action to @code{strftime}, parsing
5288 @var{string} according to the specification supplied in
5289 @var{template}. The interpretation of month and day names is
5290 dependent on the current locale. The value returned is a pair.
5291 The car has an object with time components
5292 in the form returned by @code{localtime} or @code{gmtime},
5293 but the time zone components
5294 are not usefully set.
5295 The cdr reports the number of characters from @var{string}
5296 which were used for the conversion.
5297 @end deffn
5298
5299 \fstring?
5300 @c snarfed from strings.c:526
5301 @deffn {Scheme Procedure} string? obj
5302 @deffnx {C Function} scm_string_p (obj)
5303 Return @code{#t} if @var{obj} is a string, else @code{#f}.
5304 @end deffn
5305
5306 \flist->string
5307 @c snarfed from strings.c:534
5308 @deffn {Scheme Procedure} list->string
5309 implemented by the C function "scm_string"
5310 @end deffn
5311
5312 \fstring
5313 @c snarfed from strings.c:540
5314 @deffn {Scheme Procedure} string . chrs
5315 @deffnx {Scheme Procedure} list->string chrs
5316 @deffnx {C Function} scm_string (chrs)
5317 Return a newly allocated string composed of the arguments,
5318 @var{chrs}.
5319 @end deffn
5320
5321 \fmake-string
5322 @c snarfed from strings.c:578
5323 @deffn {Scheme Procedure} make-string k [chr]
5324 @deffnx {C Function} scm_make_string (k, chr)
5325 Return a newly allocated string of
5326 length @var{k}. If @var{chr} is given, then all elements of
5327 the string are initialized to @var{chr}, otherwise the contents
5328 of the @var{string} are unspecified.
5329 @end deffn
5330
5331 \fstring-length
5332 @c snarfed from strings.c:604
5333 @deffn {Scheme Procedure} string-length string
5334 @deffnx {C Function} scm_string_length (string)
5335 Return the number of characters in @var{string}.
5336 @end deffn
5337
5338 \fstring-ref
5339 @c snarfed from strings.c:623
5340 @deffn {Scheme Procedure} string-ref str k
5341 @deffnx {C Function} scm_string_ref (str, k)
5342 Return character @var{k} of @var{str} using zero-origin
5343 indexing. @var{k} must be a valid index of @var{str}.
5344 @end deffn
5345
5346 \fstring-set!
5347 @c snarfed from strings.c:646
5348 @deffn {Scheme Procedure} string-set! str k chr
5349 @deffnx {C Function} scm_string_set_x (str, k, chr)
5350 Store @var{chr} in element @var{k} of @var{str} and return
5351 an unspecified value. @var{k} must be a valid index of
5352 @var{str}.
5353 @end deffn
5354
5355 \fsubstring
5356 @c snarfed from strings.c:682
5357 @deffn {Scheme Procedure} substring str start [end]
5358 @deffnx {C Function} scm_substring (str, start, end)
5359 Return a newly allocated string formed from the characters
5360 of @var{str} beginning with index @var{start} (inclusive) and
5361 ending with index @var{end} (exclusive).
5362 @var{str} must be a string, @var{start} and @var{end} must be
5363 exact integers satisfying:
5364
5365 0 <= @var{start} <= @var{end} <= (string-length @var{str}).
5366 @end deffn
5367
5368 \fsubstring/read-only
5369 @c snarfed from strings.c:708
5370 @deffn {Scheme Procedure} substring/read-only str start [end]
5371 @deffnx {C Function} scm_substring_read_only (str, start, end)
5372 Return a newly allocated string formed from the characters
5373 of @var{str} beginning with index @var{start} (inclusive) and
5374 ending with index @var{end} (exclusive).
5375 @var{str} must be a string, @var{start} and @var{end} must be
5376 exact integers satisfying:
5377
5378 0 <= @var{start} <= @var{end} <= (string-length @var{str}).
5379
5380 The returned string is read-only.
5381
5382 @end deffn
5383
5384 \fsubstring/copy
5385 @c snarfed from strings.c:731
5386 @deffn {Scheme Procedure} substring/copy str start [end]
5387 @deffnx {C Function} scm_substring_copy (str, start, end)
5388 Return a newly allocated string formed from the characters
5389 of @var{str} beginning with index @var{start} (inclusive) and
5390 ending with index @var{end} (exclusive).
5391 @var{str} must be a string, @var{start} and @var{end} must be
5392 exact integers satisfying:
5393
5394 0 <= @var{start} <= @var{end} <= (string-length @var{str}).
5395 @end deffn
5396
5397 \fsubstring/shared
5398 @c snarfed from strings.c:755
5399 @deffn {Scheme Procedure} substring/shared str start [end]
5400 @deffnx {C Function} scm_substring_shared (str, start, end)
5401 Return string that indirectly refers to the characters
5402 of @var{str} beginning with index @var{start} (inclusive) and
5403 ending with index @var{end} (exclusive).
5404 @var{str} must be a string, @var{start} and @var{end} must be
5405 exact integers satisfying:
5406
5407 0 <= @var{start} <= @var{end} <= (string-length @var{str}).
5408 @end deffn
5409
5410 \fstring-append
5411 @c snarfed from strings.c:774
5412 @deffn {Scheme Procedure} string-append . args
5413 @deffnx {C Function} scm_string_append (args)
5414 Return a newly allocated string whose characters form the
5415 concatenation of the given strings, @var{args}.
5416 @end deffn
5417
5418 \funiform-vector?
5419 @c snarfed from srfi-4.c:651
5420 @deffn {Scheme Procedure} uniform-vector? obj
5421 @deffnx {C Function} scm_uniform_vector_p (obj)
5422 Return @code{#t} if @var{obj} is a uniform vector.
5423 @end deffn
5424
5425 \funiform-vector-ref
5426 @c snarfed from srfi-4.c:677
5427 @deffn {Scheme Procedure} uniform-vector-ref v idx
5428 @deffnx {C Function} scm_uniform_vector_ref (v, idx)
5429 Return the element at index @var{idx} of the
5430 homogenous numeric vector @var{v}.
5431 @end deffn
5432
5433 \funiform-vector-set!
5434 @c snarfed from srfi-4.c:714
5435 @deffn {Scheme Procedure} uniform-vector-set! v idx val
5436 @deffnx {C Function} scm_uniform_vector_set_x (v, idx, val)
5437 Set the element at index @var{idx} of the
5438 homogenous numeric vector @var{v} to @var{val}.
5439 @end deffn
5440
5441 \funiform-vector->list
5442 @c snarfed from srfi-4.c:737
5443 @deffn {Scheme Procedure} uniform-vector->list uvec
5444 @deffnx {C Function} scm_uniform_vector_to_list (uvec)
5445 Convert the uniform numeric vector @var{uvec} to a list.
5446 @end deffn
5447
5448 \funiform-vector-length
5449 @c snarfed from srfi-4.c:820
5450 @deffn {Scheme Procedure} uniform-vector-length v
5451 @deffnx {C Function} scm_uniform_vector_length (v)
5452 Return the number of elements in the uniform vector @var{v}.
5453 @end deffn
5454
5455 \funiform-vector-read!
5456 @c snarfed from srfi-4.c:845
5457 @deffn {Scheme Procedure} uniform-vector-read! uvec [port_or_fd [start [end]]]
5458 @deffnx {C Function} scm_uniform_vector_read_x (uvec, port_or_fd, start, end)
5459 Fill the elements of @var{uvec} by reading
5460 raw bytes from @var{port-or-fdes}, using host byte order.
5461
5462 The optional arguments @var{start} (inclusive) and @var{end}
5463 (exclusive) allow a specified region to be read,
5464 leaving the remainder of the vector unchanged.
5465
5466 When @var{port-or-fdes} is a port, all specified elements
5467 of @var{uvec} are attempted to be read, potentially blocking
5468 while waiting formore input or end-of-file.
5469 When @var{port-or-fd} is an integer, a single call to
5470 read(2) is made.
5471
5472 An error is signalled when the last element has only
5473 been partially filled before reaching end-of-file or in
5474 the single call to read(2).
5475
5476 @code{uniform-vector-read!} returns the number of elements
5477 read.
5478
5479 @var{port-or-fdes} may be omitted, in which case it defaults
5480 to the value returned by @code{(current-input-port)}.
5481 @end deffn
5482
5483 \funiform-vector-write
5484 @c snarfed from srfi-4.c:958
5485 @deffn {Scheme Procedure} uniform-vector-write uvec [port_or_fd [start [end]]]
5486 @deffnx {C Function} scm_uniform_vector_write (uvec, port_or_fd, start, end)
5487 Write the elements of @var{uvec} as raw bytes to
5488 @var{port-or-fdes}, in the host byte order.
5489
5490 The optional arguments @var{start} (inclusive)
5491 and @var{end} (exclusive) allow
5492 a specified region to be written.
5493
5494 When @var{port-or-fdes} is a port, all specified elements
5495 of @var{uvec} are attempted to be written, potentially blocking
5496 while waiting for more room.
5497 When @var{port-or-fd} is an integer, a single call to
5498 write(2) is made.
5499
5500 An error is signalled when the last element has only
5501 been partially written in the single call to write(2).
5502
5503 The number of objects actually written is returned.
5504 @var{port-or-fdes} may be
5505 omitted, in which case it defaults to the value returned by
5506 @code{(current-output-port)}.
5507 @end deffn
5508
5509 \fu8vector?
5510 @c snarfed from ../libguile/srfi-4.i.c:41
5511 @deffn {Scheme Procedure} u8vector? obj
5512 @deffnx {C Function} scm_u8vector_p (obj)
5513 Return @code{#t} if @var{obj} is a vector of type u8,
5514 @code{#f} otherwise.
5515 @end deffn
5516
5517 \fmake-u8vector
5518 @c snarfed from ../libguile/srfi-4.i.c:53
5519 @deffn {Scheme Procedure} make-u8vector len [fill]
5520 @deffnx {C Function} scm_make_u8vector (len, fill)
5521 Return a newly allocated uniform numeric vector which can
5522 hold @var{len} elements. If @var{fill} is given, it is used to
5523 initialize the elements, otherwise the contents of the vector
5524 is unspecified.
5525 @end deffn
5526
5527 \fu8vector
5528 @c snarfed from ../libguile/srfi-4.i.c:63
5529 @deffn {Scheme Procedure} u8vector . l
5530 @deffnx {C Function} scm_u8vector (l)
5531 Return a newly allocated uniform numeric vector containing
5532 all argument values.
5533 @end deffn
5534
5535 \fu8vector-length
5536 @c snarfed from ../libguile/srfi-4.i.c:74
5537 @deffn {Scheme Procedure} u8vector-length uvec
5538 @deffnx {C Function} scm_u8vector_length (uvec)
5539 Return the number of elements in the uniform numeric vector
5540 @var{uvec}.
5541 @end deffn
5542
5543 \fu8vector-ref
5544 @c snarfed from ../libguile/srfi-4.i.c:85
5545 @deffn {Scheme Procedure} u8vector-ref uvec index
5546 @deffnx {C Function} scm_u8vector_ref (uvec, index)
5547 Return the element at @var{index} in the uniform numeric
5548 vector @var{uvec}.
5549 @end deffn
5550
5551 \fu8vector-set!
5552 @c snarfed from ../libguile/srfi-4.i.c:97
5553 @deffn {Scheme Procedure} u8vector-set! uvec index value
5554 @deffnx {C Function} scm_u8vector_set_x (uvec, index, value)
5555 Set the element at @var{index} in the uniform numeric
5556 vector @var{uvec} to @var{value}. The return value is not
5557 specified.
5558 @end deffn
5559
5560 \fu8vector->list
5561 @c snarfed from ../libguile/srfi-4.i.c:107
5562 @deffn {Scheme Procedure} u8vector->list uvec
5563 @deffnx {C Function} scm_u8vector_to_list (uvec)
5564 Convert the uniform numeric vector @var{uvec} to a list.
5565 @end deffn
5566
5567 \flist->u8vector
5568 @c snarfed from ../libguile/srfi-4.i.c:117
5569 @deffn {Scheme Procedure} list->u8vector l
5570 @deffnx {C Function} scm_list_to_u8vector (l)
5571 Convert the list @var{l} to a numeric uniform vector.
5572 @end deffn
5573
5574 \fany->u8vector
5575 @c snarfed from ../libguile/srfi-4.i.c:128
5576 @deffn {Scheme Procedure} any->u8vector obj
5577 @deffnx {C Function} scm_any_to_u8vector (obj)
5578 Convert @var{obj}, which can be a list, vector, or
5579 uniform vector, to a numeric uniform vector of
5580 type u8.
5581 @end deffn
5582
5583 \fs8vector?
5584 @c snarfed from ../libguile/srfi-4.i.c:41
5585 @deffn {Scheme Procedure} s8vector? obj
5586 @deffnx {C Function} scm_s8vector_p (obj)
5587 Return @code{#t} if @var{obj} is a vector of type s8,
5588 @code{#f} otherwise.
5589 @end deffn
5590
5591 \fmake-s8vector
5592 @c snarfed from ../libguile/srfi-4.i.c:53
5593 @deffn {Scheme Procedure} make-s8vector len [fill]
5594 @deffnx {C Function} scm_make_s8vector (len, fill)
5595 Return a newly allocated uniform numeric vector which can
5596 hold @var{len} elements. If @var{fill} is given, it is used to
5597 initialize the elements, otherwise the contents of the vector
5598 is unspecified.
5599 @end deffn
5600
5601 \fs8vector
5602 @c snarfed from ../libguile/srfi-4.i.c:63
5603 @deffn {Scheme Procedure} s8vector . l
5604 @deffnx {C Function} scm_s8vector (l)
5605 Return a newly allocated uniform numeric vector containing
5606 all argument values.
5607 @end deffn
5608
5609 \fs8vector-length
5610 @c snarfed from ../libguile/srfi-4.i.c:74
5611 @deffn {Scheme Procedure} s8vector-length uvec
5612 @deffnx {C Function} scm_s8vector_length (uvec)
5613 Return the number of elements in the uniform numeric vector
5614 @var{uvec}.
5615 @end deffn
5616
5617 \fs8vector-ref
5618 @c snarfed from ../libguile/srfi-4.i.c:85
5619 @deffn {Scheme Procedure} s8vector-ref uvec index
5620 @deffnx {C Function} scm_s8vector_ref (uvec, index)
5621 Return the element at @var{index} in the uniform numeric
5622 vector @var{uvec}.
5623 @end deffn
5624
5625 \fs8vector-set!
5626 @c snarfed from ../libguile/srfi-4.i.c:97
5627 @deffn {Scheme Procedure} s8vector-set! uvec index value
5628 @deffnx {C Function} scm_s8vector_set_x (uvec, index, value)
5629 Set the element at @var{index} in the uniform numeric
5630 vector @var{uvec} to @var{value}. The return value is not
5631 specified.
5632 @end deffn
5633
5634 \fs8vector->list
5635 @c snarfed from ../libguile/srfi-4.i.c:107
5636 @deffn {Scheme Procedure} s8vector->list uvec
5637 @deffnx {C Function} scm_s8vector_to_list (uvec)
5638 Convert the uniform numeric vector @var{uvec} to a list.
5639 @end deffn
5640
5641 \flist->s8vector
5642 @c snarfed from ../libguile/srfi-4.i.c:117
5643 @deffn {Scheme Procedure} list->s8vector l
5644 @deffnx {C Function} scm_list_to_s8vector (l)
5645 Convert the list @var{l} to a numeric uniform vector.
5646 @end deffn
5647
5648 \fany->s8vector
5649 @c snarfed from ../libguile/srfi-4.i.c:128
5650 @deffn {Scheme Procedure} any->s8vector obj
5651 @deffnx {C Function} scm_any_to_s8vector (obj)
5652 Convert @var{obj}, which can be a list, vector, or
5653 uniform vector, to a numeric uniform vector of
5654 type s8.
5655 @end deffn
5656
5657 \fu16vector?
5658 @c snarfed from ../libguile/srfi-4.i.c:41
5659 @deffn {Scheme Procedure} u16vector? obj
5660 @deffnx {C Function} scm_u16vector_p (obj)
5661 Return @code{#t} if @var{obj} is a vector of type u16,
5662 @code{#f} otherwise.
5663 @end deffn
5664
5665 \fmake-u16vector
5666 @c snarfed from ../libguile/srfi-4.i.c:53
5667 @deffn {Scheme Procedure} make-u16vector len [fill]
5668 @deffnx {C Function} scm_make_u16vector (len, fill)
5669 Return a newly allocated uniform numeric vector which can
5670 hold @var{len} elements. If @var{fill} is given, it is used to
5671 initialize the elements, otherwise the contents of the vector
5672 is unspecified.
5673 @end deffn
5674
5675 \fu16vector
5676 @c snarfed from ../libguile/srfi-4.i.c:63
5677 @deffn {Scheme Procedure} u16vector . l
5678 @deffnx {C Function} scm_u16vector (l)
5679 Return a newly allocated uniform numeric vector containing
5680 all argument values.
5681 @end deffn
5682
5683 \fu16vector-length
5684 @c snarfed from ../libguile/srfi-4.i.c:74
5685 @deffn {Scheme Procedure} u16vector-length uvec
5686 @deffnx {C Function} scm_u16vector_length (uvec)
5687 Return the number of elements in the uniform numeric vector
5688 @var{uvec}.
5689 @end deffn
5690
5691 \fu16vector-ref
5692 @c snarfed from ../libguile/srfi-4.i.c:85
5693 @deffn {Scheme Procedure} u16vector-ref uvec index
5694 @deffnx {C Function} scm_u16vector_ref (uvec, index)
5695 Return the element at @var{index} in the uniform numeric
5696 vector @var{uvec}.
5697 @end deffn
5698
5699 \fu16vector-set!
5700 @c snarfed from ../libguile/srfi-4.i.c:97
5701 @deffn {Scheme Procedure} u16vector-set! uvec index value
5702 @deffnx {C Function} scm_u16vector_set_x (uvec, index, value)
5703 Set the element at @var{index} in the uniform numeric
5704 vector @var{uvec} to @var{value}. The return value is not
5705 specified.
5706 @end deffn
5707
5708 \fu16vector->list
5709 @c snarfed from ../libguile/srfi-4.i.c:107
5710 @deffn {Scheme Procedure} u16vector->list uvec
5711 @deffnx {C Function} scm_u16vector_to_list (uvec)
5712 Convert the uniform numeric vector @var{uvec} to a list.
5713 @end deffn
5714
5715 \flist->u16vector
5716 @c snarfed from ../libguile/srfi-4.i.c:117
5717 @deffn {Scheme Procedure} list->u16vector l
5718 @deffnx {C Function} scm_list_to_u16vector (l)
5719 Convert the list @var{l} to a numeric uniform vector.
5720 @end deffn
5721
5722 \fany->u16vector
5723 @c snarfed from ../libguile/srfi-4.i.c:128
5724 @deffn {Scheme Procedure} any->u16vector obj
5725 @deffnx {C Function} scm_any_to_u16vector (obj)
5726 Convert @var{obj}, which can be a list, vector, or
5727 uniform vector, to a numeric uniform vector of
5728 type u16.
5729 @end deffn
5730
5731 \fs16vector?
5732 @c snarfed from ../libguile/srfi-4.i.c:41
5733 @deffn {Scheme Procedure} s16vector? obj
5734 @deffnx {C Function} scm_s16vector_p (obj)
5735 Return @code{#t} if @var{obj} is a vector of type s16,
5736 @code{#f} otherwise.
5737 @end deffn
5738
5739 \fmake-s16vector
5740 @c snarfed from ../libguile/srfi-4.i.c:53
5741 @deffn {Scheme Procedure} make-s16vector len [fill]
5742 @deffnx {C Function} scm_make_s16vector (len, fill)
5743 Return a newly allocated uniform numeric vector which can
5744 hold @var{len} elements. If @var{fill} is given, it is used to
5745 initialize the elements, otherwise the contents of the vector
5746 is unspecified.
5747 @end deffn
5748
5749 \fs16vector
5750 @c snarfed from ../libguile/srfi-4.i.c:63
5751 @deffn {Scheme Procedure} s16vector . l
5752 @deffnx {C Function} scm_s16vector (l)
5753 Return a newly allocated uniform numeric vector containing
5754 all argument values.
5755 @end deffn
5756
5757 \fs16vector-length
5758 @c snarfed from ../libguile/srfi-4.i.c:74
5759 @deffn {Scheme Procedure} s16vector-length uvec
5760 @deffnx {C Function} scm_s16vector_length (uvec)
5761 Return the number of elements in the uniform numeric vector
5762 @var{uvec}.
5763 @end deffn
5764
5765 \fs16vector-ref
5766 @c snarfed from ../libguile/srfi-4.i.c:85
5767 @deffn {Scheme Procedure} s16vector-ref uvec index
5768 @deffnx {C Function} scm_s16vector_ref (uvec, index)
5769 Return the element at @var{index} in the uniform numeric
5770 vector @var{uvec}.
5771 @end deffn
5772
5773 \fs16vector-set!
5774 @c snarfed from ../libguile/srfi-4.i.c:97
5775 @deffn {Scheme Procedure} s16vector-set! uvec index value
5776 @deffnx {C Function} scm_s16vector_set_x (uvec, index, value)
5777 Set the element at @var{index} in the uniform numeric
5778 vector @var{uvec} to @var{value}. The return value is not
5779 specified.
5780 @end deffn
5781
5782 \fs16vector->list
5783 @c snarfed from ../libguile/srfi-4.i.c:107
5784 @deffn {Scheme Procedure} s16vector->list uvec
5785 @deffnx {C Function} scm_s16vector_to_list (uvec)
5786 Convert the uniform numeric vector @var{uvec} to a list.
5787 @end deffn
5788
5789 \flist->s16vector
5790 @c snarfed from ../libguile/srfi-4.i.c:117
5791 @deffn {Scheme Procedure} list->s16vector l
5792 @deffnx {C Function} scm_list_to_s16vector (l)
5793 Convert the list @var{l} to a numeric uniform vector.
5794 @end deffn
5795
5796 \fany->s16vector
5797 @c snarfed from ../libguile/srfi-4.i.c:128
5798 @deffn {Scheme Procedure} any->s16vector obj
5799 @deffnx {C Function} scm_any_to_s16vector (obj)
5800 Convert @var{obj}, which can be a list, vector, or
5801 uniform vector, to a numeric uniform vector of
5802 type s16.
5803 @end deffn
5804
5805 \fu32vector?
5806 @c snarfed from ../libguile/srfi-4.i.c:41
5807 @deffn {Scheme Procedure} u32vector? obj
5808 @deffnx {C Function} scm_u32vector_p (obj)
5809 Return @code{#t} if @var{obj} is a vector of type u32,
5810 @code{#f} otherwise.
5811 @end deffn
5812
5813 \fmake-u32vector
5814 @c snarfed from ../libguile/srfi-4.i.c:53
5815 @deffn {Scheme Procedure} make-u32vector len [fill]
5816 @deffnx {C Function} scm_make_u32vector (len, fill)
5817 Return a newly allocated uniform numeric vector which can
5818 hold @var{len} elements. If @var{fill} is given, it is used to
5819 initialize the elements, otherwise the contents of the vector
5820 is unspecified.
5821 @end deffn
5822
5823 \fu32vector
5824 @c snarfed from ../libguile/srfi-4.i.c:63
5825 @deffn {Scheme Procedure} u32vector . l
5826 @deffnx {C Function} scm_u32vector (l)
5827 Return a newly allocated uniform numeric vector containing
5828 all argument values.
5829 @end deffn
5830
5831 \fu32vector-length
5832 @c snarfed from ../libguile/srfi-4.i.c:74
5833 @deffn {Scheme Procedure} u32vector-length uvec
5834 @deffnx {C Function} scm_u32vector_length (uvec)
5835 Return the number of elements in the uniform numeric vector
5836 @var{uvec}.
5837 @end deffn
5838
5839 \fu32vector-ref
5840 @c snarfed from ../libguile/srfi-4.i.c:85
5841 @deffn {Scheme Procedure} u32vector-ref uvec index
5842 @deffnx {C Function} scm_u32vector_ref (uvec, index)
5843 Return the element at @var{index} in the uniform numeric
5844 vector @var{uvec}.
5845 @end deffn
5846
5847 \fu32vector-set!
5848 @c snarfed from ../libguile/srfi-4.i.c:97
5849 @deffn {Scheme Procedure} u32vector-set! uvec index value
5850 @deffnx {C Function} scm_u32vector_set_x (uvec, index, value)
5851 Set the element at @var{index} in the uniform numeric
5852 vector @var{uvec} to @var{value}. The return value is not
5853 specified.
5854 @end deffn
5855
5856 \fu32vector->list
5857 @c snarfed from ../libguile/srfi-4.i.c:107
5858 @deffn {Scheme Procedure} u32vector->list uvec
5859 @deffnx {C Function} scm_u32vector_to_list (uvec)
5860 Convert the uniform numeric vector @var{uvec} to a list.
5861 @end deffn
5862
5863 \flist->u32vector
5864 @c snarfed from ../libguile/srfi-4.i.c:117
5865 @deffn {Scheme Procedure} list->u32vector l
5866 @deffnx {C Function} scm_list_to_u32vector (l)
5867 Convert the list @var{l} to a numeric uniform vector.
5868 @end deffn
5869
5870 \fany->u32vector
5871 @c snarfed from ../libguile/srfi-4.i.c:128
5872 @deffn {Scheme Procedure} any->u32vector obj
5873 @deffnx {C Function} scm_any_to_u32vector (obj)
5874 Convert @var{obj}, which can be a list, vector, or
5875 uniform vector, to a numeric uniform vector of
5876 type u32.
5877 @end deffn
5878
5879 \fs32vector?
5880 @c snarfed from ../libguile/srfi-4.i.c:41
5881 @deffn {Scheme Procedure} s32vector? obj
5882 @deffnx {C Function} scm_s32vector_p (obj)
5883 Return @code{#t} if @var{obj} is a vector of type s32,
5884 @code{#f} otherwise.
5885 @end deffn
5886
5887 \fmake-s32vector
5888 @c snarfed from ../libguile/srfi-4.i.c:53
5889 @deffn {Scheme Procedure} make-s32vector len [fill]
5890 @deffnx {C Function} scm_make_s32vector (len, fill)
5891 Return a newly allocated uniform numeric vector which can
5892 hold @var{len} elements. If @var{fill} is given, it is used to
5893 initialize the elements, otherwise the contents of the vector
5894 is unspecified.
5895 @end deffn
5896
5897 \fs32vector
5898 @c snarfed from ../libguile/srfi-4.i.c:63
5899 @deffn {Scheme Procedure} s32vector . l
5900 @deffnx {C Function} scm_s32vector (l)
5901 Return a newly allocated uniform numeric vector containing
5902 all argument values.
5903 @end deffn
5904
5905 \fs32vector-length
5906 @c snarfed from ../libguile/srfi-4.i.c:74
5907 @deffn {Scheme Procedure} s32vector-length uvec
5908 @deffnx {C Function} scm_s32vector_length (uvec)
5909 Return the number of elements in the uniform numeric vector
5910 @var{uvec}.
5911 @end deffn
5912
5913 \fs32vector-ref
5914 @c snarfed from ../libguile/srfi-4.i.c:85
5915 @deffn {Scheme Procedure} s32vector-ref uvec index
5916 @deffnx {C Function} scm_s32vector_ref (uvec, index)
5917 Return the element at @var{index} in the uniform numeric
5918 vector @var{uvec}.
5919 @end deffn
5920
5921 \fs32vector-set!
5922 @c snarfed from ../libguile/srfi-4.i.c:97
5923 @deffn {Scheme Procedure} s32vector-set! uvec index value
5924 @deffnx {C Function} scm_s32vector_set_x (uvec, index, value)
5925 Set the element at @var{index} in the uniform numeric
5926 vector @var{uvec} to @var{value}. The return value is not
5927 specified.
5928 @end deffn
5929
5930 \fs32vector->list
5931 @c snarfed from ../libguile/srfi-4.i.c:107
5932 @deffn {Scheme Procedure} s32vector->list uvec
5933 @deffnx {C Function} scm_s32vector_to_list (uvec)
5934 Convert the uniform numeric vector @var{uvec} to a list.
5935 @end deffn
5936
5937 \flist->s32vector
5938 @c snarfed from ../libguile/srfi-4.i.c:117
5939 @deffn {Scheme Procedure} list->s32vector l
5940 @deffnx {C Function} scm_list_to_s32vector (l)
5941 Convert the list @var{l} to a numeric uniform vector.
5942 @end deffn
5943
5944 \fany->s32vector
5945 @c snarfed from ../libguile/srfi-4.i.c:128
5946 @deffn {Scheme Procedure} any->s32vector obj
5947 @deffnx {C Function} scm_any_to_s32vector (obj)
5948 Convert @var{obj}, which can be a list, vector, or
5949 uniform vector, to a numeric uniform vector of
5950 type s32.
5951 @end deffn
5952
5953 \fu64vector?
5954 @c snarfed from ../libguile/srfi-4.i.c:41
5955 @deffn {Scheme Procedure} u64vector? obj
5956 @deffnx {C Function} scm_u64vector_p (obj)
5957 Return @code{#t} if @var{obj} is a vector of type u64,
5958 @code{#f} otherwise.
5959 @end deffn
5960
5961 \fmake-u64vector
5962 @c snarfed from ../libguile/srfi-4.i.c:53
5963 @deffn {Scheme Procedure} make-u64vector len [fill]
5964 @deffnx {C Function} scm_make_u64vector (len, fill)
5965 Return a newly allocated uniform numeric vector which can
5966 hold @var{len} elements. If @var{fill} is given, it is used to
5967 initialize the elements, otherwise the contents of the vector
5968 is unspecified.
5969 @end deffn
5970
5971 \fu64vector
5972 @c snarfed from ../libguile/srfi-4.i.c:63
5973 @deffn {Scheme Procedure} u64vector . l
5974 @deffnx {C Function} scm_u64vector (l)
5975 Return a newly allocated uniform numeric vector containing
5976 all argument values.
5977 @end deffn
5978
5979 \fu64vector-length
5980 @c snarfed from ../libguile/srfi-4.i.c:74
5981 @deffn {Scheme Procedure} u64vector-length uvec
5982 @deffnx {C Function} scm_u64vector_length (uvec)
5983 Return the number of elements in the uniform numeric vector
5984 @var{uvec}.
5985 @end deffn
5986
5987 \fu64vector-ref
5988 @c snarfed from ../libguile/srfi-4.i.c:85
5989 @deffn {Scheme Procedure} u64vector-ref uvec index
5990 @deffnx {C Function} scm_u64vector_ref (uvec, index)
5991 Return the element at @var{index} in the uniform numeric
5992 vector @var{uvec}.
5993 @end deffn
5994
5995 \fu64vector-set!
5996 @c snarfed from ../libguile/srfi-4.i.c:97
5997 @deffn {Scheme Procedure} u64vector-set! uvec index value
5998 @deffnx {C Function} scm_u64vector_set_x (uvec, index, value)
5999 Set the element at @var{index} in the uniform numeric
6000 vector @var{uvec} to @var{value}. The return value is not
6001 specified.
6002 @end deffn
6003
6004 \fu64vector->list
6005 @c snarfed from ../libguile/srfi-4.i.c:107
6006 @deffn {Scheme Procedure} u64vector->list uvec
6007 @deffnx {C Function} scm_u64vector_to_list (uvec)
6008 Convert the uniform numeric vector @var{uvec} to a list.
6009 @end deffn
6010
6011 \flist->u64vector
6012 @c snarfed from ../libguile/srfi-4.i.c:117
6013 @deffn {Scheme Procedure} list->u64vector l
6014 @deffnx {C Function} scm_list_to_u64vector (l)
6015 Convert the list @var{l} to a numeric uniform vector.
6016 @end deffn
6017
6018 \fany->u64vector
6019 @c snarfed from ../libguile/srfi-4.i.c:128
6020 @deffn {Scheme Procedure} any->u64vector obj
6021 @deffnx {C Function} scm_any_to_u64vector (obj)
6022 Convert @var{obj}, which can be a list, vector, or
6023 uniform vector, to a numeric uniform vector of
6024 type u64.
6025 @end deffn
6026
6027 \fs64vector?
6028 @c snarfed from ../libguile/srfi-4.i.c:41
6029 @deffn {Scheme Procedure} s64vector? obj
6030 @deffnx {C Function} scm_s64vector_p (obj)
6031 Return @code{#t} if @var{obj} is a vector of type s64,
6032 @code{#f} otherwise.
6033 @end deffn
6034
6035 \fmake-s64vector
6036 @c snarfed from ../libguile/srfi-4.i.c:53
6037 @deffn {Scheme Procedure} make-s64vector len [fill]
6038 @deffnx {C Function} scm_make_s64vector (len, fill)
6039 Return a newly allocated uniform numeric vector which can
6040 hold @var{len} elements. If @var{fill} is given, it is used to
6041 initialize the elements, otherwise the contents of the vector
6042 is unspecified.
6043 @end deffn
6044
6045 \fs64vector
6046 @c snarfed from ../libguile/srfi-4.i.c:63
6047 @deffn {Scheme Procedure} s64vector . l
6048 @deffnx {C Function} scm_s64vector (l)
6049 Return a newly allocated uniform numeric vector containing
6050 all argument values.
6051 @end deffn
6052
6053 \fs64vector-length
6054 @c snarfed from ../libguile/srfi-4.i.c:74
6055 @deffn {Scheme Procedure} s64vector-length uvec
6056 @deffnx {C Function} scm_s64vector_length (uvec)
6057 Return the number of elements in the uniform numeric vector
6058 @var{uvec}.
6059 @end deffn
6060
6061 \fs64vector-ref
6062 @c snarfed from ../libguile/srfi-4.i.c:85
6063 @deffn {Scheme Procedure} s64vector-ref uvec index
6064 @deffnx {C Function} scm_s64vector_ref (uvec, index)
6065 Return the element at @var{index} in the uniform numeric
6066 vector @var{uvec}.
6067 @end deffn
6068
6069 \fs64vector-set!
6070 @c snarfed from ../libguile/srfi-4.i.c:97
6071 @deffn {Scheme Procedure} s64vector-set! uvec index value
6072 @deffnx {C Function} scm_s64vector_set_x (uvec, index, value)
6073 Set the element at @var{index} in the uniform numeric
6074 vector @var{uvec} to @var{value}. The return value is not
6075 specified.
6076 @end deffn
6077
6078 \fs64vector->list
6079 @c snarfed from ../libguile/srfi-4.i.c:107
6080 @deffn {Scheme Procedure} s64vector->list uvec
6081 @deffnx {C Function} scm_s64vector_to_list (uvec)
6082 Convert the uniform numeric vector @var{uvec} to a list.
6083 @end deffn
6084
6085 \flist->s64vector
6086 @c snarfed from ../libguile/srfi-4.i.c:117
6087 @deffn {Scheme Procedure} list->s64vector l
6088 @deffnx {C Function} scm_list_to_s64vector (l)
6089 Convert the list @var{l} to a numeric uniform vector.
6090 @end deffn
6091
6092 \fany->s64vector
6093 @c snarfed from ../libguile/srfi-4.i.c:128
6094 @deffn {Scheme Procedure} any->s64vector obj
6095 @deffnx {C Function} scm_any_to_s64vector (obj)
6096 Convert @var{obj}, which can be a list, vector, or
6097 uniform vector, to a numeric uniform vector of
6098 type s64.
6099 @end deffn
6100
6101 \ff32vector?
6102 @c snarfed from ../libguile/srfi-4.i.c:41
6103 @deffn {Scheme Procedure} f32vector? obj
6104 @deffnx {C Function} scm_f32vector_p (obj)
6105 Return @code{#t} if @var{obj} is a vector of type f32,
6106 @code{#f} otherwise.
6107 @end deffn
6108
6109 \fmake-f32vector
6110 @c snarfed from ../libguile/srfi-4.i.c:53
6111 @deffn {Scheme Procedure} make-f32vector len [fill]
6112 @deffnx {C Function} scm_make_f32vector (len, fill)
6113 Return a newly allocated uniform numeric vector which can
6114 hold @var{len} elements. If @var{fill} is given, it is used to
6115 initialize the elements, otherwise the contents of the vector
6116 is unspecified.
6117 @end deffn
6118
6119 \ff32vector
6120 @c snarfed from ../libguile/srfi-4.i.c:63
6121 @deffn {Scheme Procedure} f32vector . l
6122 @deffnx {C Function} scm_f32vector (l)
6123 Return a newly allocated uniform numeric vector containing
6124 all argument values.
6125 @end deffn
6126
6127 \ff32vector-length
6128 @c snarfed from ../libguile/srfi-4.i.c:74
6129 @deffn {Scheme Procedure} f32vector-length uvec
6130 @deffnx {C Function} scm_f32vector_length (uvec)
6131 Return the number of elements in the uniform numeric vector
6132 @var{uvec}.
6133 @end deffn
6134
6135 \ff32vector-ref
6136 @c snarfed from ../libguile/srfi-4.i.c:85
6137 @deffn {Scheme Procedure} f32vector-ref uvec index
6138 @deffnx {C Function} scm_f32vector_ref (uvec, index)
6139 Return the element at @var{index} in the uniform numeric
6140 vector @var{uvec}.
6141 @end deffn
6142
6143 \ff32vector-set!
6144 @c snarfed from ../libguile/srfi-4.i.c:97
6145 @deffn {Scheme Procedure} f32vector-set! uvec index value
6146 @deffnx {C Function} scm_f32vector_set_x (uvec, index, value)
6147 Set the element at @var{index} in the uniform numeric
6148 vector @var{uvec} to @var{value}. The return value is not
6149 specified.
6150 @end deffn
6151
6152 \ff32vector->list
6153 @c snarfed from ../libguile/srfi-4.i.c:107
6154 @deffn {Scheme Procedure} f32vector->list uvec
6155 @deffnx {C Function} scm_f32vector_to_list (uvec)
6156 Convert the uniform numeric vector @var{uvec} to a list.
6157 @end deffn
6158
6159 \flist->f32vector
6160 @c snarfed from ../libguile/srfi-4.i.c:117
6161 @deffn {Scheme Procedure} list->f32vector l
6162 @deffnx {C Function} scm_list_to_f32vector (l)
6163 Convert the list @var{l} to a numeric uniform vector.
6164 @end deffn
6165
6166 \fany->f32vector
6167 @c snarfed from ../libguile/srfi-4.i.c:128
6168 @deffn {Scheme Procedure} any->f32vector obj
6169 @deffnx {C Function} scm_any_to_f32vector (obj)
6170 Convert @var{obj}, which can be a list, vector, or
6171 uniform vector, to a numeric uniform vector of
6172 type f32.
6173 @end deffn
6174
6175 \ff64vector?
6176 @c snarfed from ../libguile/srfi-4.i.c:41
6177 @deffn {Scheme Procedure} f64vector? obj
6178 @deffnx {C Function} scm_f64vector_p (obj)
6179 Return @code{#t} if @var{obj} is a vector of type f64,
6180 @code{#f} otherwise.
6181 @end deffn
6182
6183 \fmake-f64vector
6184 @c snarfed from ../libguile/srfi-4.i.c:53
6185 @deffn {Scheme Procedure} make-f64vector len [fill]
6186 @deffnx {C Function} scm_make_f64vector (len, fill)
6187 Return a newly allocated uniform numeric vector which can
6188 hold @var{len} elements. If @var{fill} is given, it is used to
6189 initialize the elements, otherwise the contents of the vector
6190 is unspecified.
6191 @end deffn
6192
6193 \ff64vector
6194 @c snarfed from ../libguile/srfi-4.i.c:63
6195 @deffn {Scheme Procedure} f64vector . l
6196 @deffnx {C Function} scm_f64vector (l)
6197 Return a newly allocated uniform numeric vector containing
6198 all argument values.
6199 @end deffn
6200
6201 \ff64vector-length
6202 @c snarfed from ../libguile/srfi-4.i.c:74
6203 @deffn {Scheme Procedure} f64vector-length uvec
6204 @deffnx {C Function} scm_f64vector_length (uvec)
6205 Return the number of elements in the uniform numeric vector
6206 @var{uvec}.
6207 @end deffn
6208
6209 \ff64vector-ref
6210 @c snarfed from ../libguile/srfi-4.i.c:85
6211 @deffn {Scheme Procedure} f64vector-ref uvec index
6212 @deffnx {C Function} scm_f64vector_ref (uvec, index)
6213 Return the element at @var{index} in the uniform numeric
6214 vector @var{uvec}.
6215 @end deffn
6216
6217 \ff64vector-set!
6218 @c snarfed from ../libguile/srfi-4.i.c:97
6219 @deffn {Scheme Procedure} f64vector-set! uvec index value
6220 @deffnx {C Function} scm_f64vector_set_x (uvec, index, value)
6221 Set the element at @var{index} in the uniform numeric
6222 vector @var{uvec} to @var{value}. The return value is not
6223 specified.
6224 @end deffn
6225
6226 \ff64vector->list
6227 @c snarfed from ../libguile/srfi-4.i.c:107
6228 @deffn {Scheme Procedure} f64vector->list uvec
6229 @deffnx {C Function} scm_f64vector_to_list (uvec)
6230 Convert the uniform numeric vector @var{uvec} to a list.
6231 @end deffn
6232
6233 \flist->f64vector
6234 @c snarfed from ../libguile/srfi-4.i.c:117
6235 @deffn {Scheme Procedure} list->f64vector l
6236 @deffnx {C Function} scm_list_to_f64vector (l)
6237 Convert the list @var{l} to a numeric uniform vector.
6238 @end deffn
6239
6240 \fany->f64vector
6241 @c snarfed from ../libguile/srfi-4.i.c:128
6242 @deffn {Scheme Procedure} any->f64vector obj
6243 @deffnx {C Function} scm_any_to_f64vector (obj)
6244 Convert @var{obj}, which can be a list, vector, or
6245 uniform vector, to a numeric uniform vector of
6246 type f64.
6247 @end deffn
6248
6249 \fc32vector?
6250 @c snarfed from ../libguile/srfi-4.i.c:41
6251 @deffn {Scheme Procedure} c32vector? obj
6252 @deffnx {C Function} scm_c32vector_p (obj)
6253 Return @code{#t} if @var{obj} is a vector of type c32,
6254 @code{#f} otherwise.
6255 @end deffn
6256
6257 \fmake-c32vector
6258 @c snarfed from ../libguile/srfi-4.i.c:53
6259 @deffn {Scheme Procedure} make-c32vector len [fill]
6260 @deffnx {C Function} scm_make_c32vector (len, fill)
6261 Return a newly allocated uniform numeric vector which can
6262 hold @var{len} elements. If @var{fill} is given, it is used to
6263 initialize the elements, otherwise the contents of the vector
6264 is unspecified.
6265 @end deffn
6266
6267 \fc32vector
6268 @c snarfed from ../libguile/srfi-4.i.c:63
6269 @deffn {Scheme Procedure} c32vector . l
6270 @deffnx {C Function} scm_c32vector (l)
6271 Return a newly allocated uniform numeric vector containing
6272 all argument values.
6273 @end deffn
6274
6275 \fc32vector-length
6276 @c snarfed from ../libguile/srfi-4.i.c:74
6277 @deffn {Scheme Procedure} c32vector-length uvec
6278 @deffnx {C Function} scm_c32vector_length (uvec)
6279 Return the number of elements in the uniform numeric vector
6280 @var{uvec}.
6281 @end deffn
6282
6283 \fc32vector-ref
6284 @c snarfed from ../libguile/srfi-4.i.c:85
6285 @deffn {Scheme Procedure} c32vector-ref uvec index
6286 @deffnx {C Function} scm_c32vector_ref (uvec, index)
6287 Return the element at @var{index} in the uniform numeric
6288 vector @var{uvec}.
6289 @end deffn
6290
6291 \fc32vector-set!
6292 @c snarfed from ../libguile/srfi-4.i.c:97
6293 @deffn {Scheme Procedure} c32vector-set! uvec index value
6294 @deffnx {C Function} scm_c32vector_set_x (uvec, index, value)
6295 Set the element at @var{index} in the uniform numeric
6296 vector @var{uvec} to @var{value}. The return value is not
6297 specified.
6298 @end deffn
6299
6300 \fc32vector->list
6301 @c snarfed from ../libguile/srfi-4.i.c:107
6302 @deffn {Scheme Procedure} c32vector->list uvec
6303 @deffnx {C Function} scm_c32vector_to_list (uvec)
6304 Convert the uniform numeric vector @var{uvec} to a list.
6305 @end deffn
6306
6307 \flist->c32vector
6308 @c snarfed from ../libguile/srfi-4.i.c:117
6309 @deffn {Scheme Procedure} list->c32vector l
6310 @deffnx {C Function} scm_list_to_c32vector (l)
6311 Convert the list @var{l} to a numeric uniform vector.
6312 @end deffn
6313
6314 \fany->c32vector
6315 @c snarfed from ../libguile/srfi-4.i.c:128
6316 @deffn {Scheme Procedure} any->c32vector obj
6317 @deffnx {C Function} scm_any_to_c32vector (obj)
6318 Convert @var{obj}, which can be a list, vector, or
6319 uniform vector, to a numeric uniform vector of
6320 type c32.
6321 @end deffn
6322
6323 \fc64vector?
6324 @c snarfed from ../libguile/srfi-4.i.c:41
6325 @deffn {Scheme Procedure} c64vector? obj
6326 @deffnx {C Function} scm_c64vector_p (obj)
6327 Return @code{#t} if @var{obj} is a vector of type c64,
6328 @code{#f} otherwise.
6329 @end deffn
6330
6331 \fmake-c64vector
6332 @c snarfed from ../libguile/srfi-4.i.c:53
6333 @deffn {Scheme Procedure} make-c64vector len [fill]
6334 @deffnx {C Function} scm_make_c64vector (len, fill)
6335 Return a newly allocated uniform numeric vector which can
6336 hold @var{len} elements. If @var{fill} is given, it is used to
6337 initialize the elements, otherwise the contents of the vector
6338 is unspecified.
6339 @end deffn
6340
6341 \fc64vector
6342 @c snarfed from ../libguile/srfi-4.i.c:63
6343 @deffn {Scheme Procedure} c64vector . l
6344 @deffnx {C Function} scm_c64vector (l)
6345 Return a newly allocated uniform numeric vector containing
6346 all argument values.
6347 @end deffn
6348
6349 \fc64vector-length
6350 @c snarfed from ../libguile/srfi-4.i.c:74
6351 @deffn {Scheme Procedure} c64vector-length uvec
6352 @deffnx {C Function} scm_c64vector_length (uvec)
6353 Return the number of elements in the uniform numeric vector
6354 @var{uvec}.
6355 @end deffn
6356
6357 \fc64vector-ref
6358 @c snarfed from ../libguile/srfi-4.i.c:85
6359 @deffn {Scheme Procedure} c64vector-ref uvec index
6360 @deffnx {C Function} scm_c64vector_ref (uvec, index)
6361 Return the element at @var{index} in the uniform numeric
6362 vector @var{uvec}.
6363 @end deffn
6364
6365 \fc64vector-set!
6366 @c snarfed from ../libguile/srfi-4.i.c:97
6367 @deffn {Scheme Procedure} c64vector-set! uvec index value
6368 @deffnx {C Function} scm_c64vector_set_x (uvec, index, value)
6369 Set the element at @var{index} in the uniform numeric
6370 vector @var{uvec} to @var{value}. The return value is not
6371 specified.
6372 @end deffn
6373
6374 \fc64vector->list
6375 @c snarfed from ../libguile/srfi-4.i.c:107
6376 @deffn {Scheme Procedure} c64vector->list uvec
6377 @deffnx {C Function} scm_c64vector_to_list (uvec)
6378 Convert the uniform numeric vector @var{uvec} to a list.
6379 @end deffn
6380
6381 \flist->c64vector
6382 @c snarfed from ../libguile/srfi-4.i.c:117
6383 @deffn {Scheme Procedure} list->c64vector l
6384 @deffnx {C Function} scm_list_to_c64vector (l)
6385 Convert the list @var{l} to a numeric uniform vector.
6386 @end deffn
6387
6388 \fany->c64vector
6389 @c snarfed from ../libguile/srfi-4.i.c:128
6390 @deffn {Scheme Procedure} any->c64vector obj
6391 @deffnx {C Function} scm_any_to_c64vector (obj)
6392 Convert @var{obj}, which can be a list, vector, or
6393 uniform vector, to a numeric uniform vector of
6394 type c64.
6395 @end deffn
6396
6397 \fstring-null?
6398 @c snarfed from srfi-13.c:62
6399 @deffn {Scheme Procedure} string-null? str
6400 @deffnx {C Function} scm_string_null_p (str)
6401 Return @code{#t} if @var{str}'s length is zero, and
6402 @code{#f} otherwise.
6403 @lisp
6404 (string-null? "") @result{} #t
6405 y @result{} "foo"
6406 (string-null? y) @result{} #f
6407 @end lisp
6408 @end deffn
6409
6410 \fstring-any-c-code
6411 @c snarfed from srfi-13.c:94
6412 @deffn {Scheme Procedure} string-any-c-code char_pred s [start [end]]
6413 @deffnx {C Function} scm_string_any (char_pred, s, start, end)
6414 Check if @var{char_pred} is true for any character in string @var{s}.
6415
6416 @var{char_pred} can be a character to check for any equal to that, or
6417 a character set (@pxref{Character Sets}) to check for any in that set,
6418 or a predicate procedure to call.
6419
6420 For a procedure, calls @code{(@var{char_pred} c)} are made
6421 successively on the characters from @var{start} to @var{end}. If
6422 @var{char_pred} returns true (ie.@: non-@code{#f}), @code{string-any}
6423 stops and that return value is the return from @code{string-any}. The
6424 call on the last character (ie.@: at @math{@var{end}-1}), if that
6425 point is reached, is a tail call.
6426
6427 If there are no characters in @var{s} (ie.@: @var{start} equals
6428 @var{end}) then the return is @code{#f}.
6429
6430 @end deffn
6431
6432 \fstring-every-c-code
6433 @c snarfed from srfi-13.c:158
6434 @deffn {Scheme Procedure} string-every-c-code char_pred s [start [end]]
6435 @deffnx {C Function} scm_string_every (char_pred, s, start, end)
6436 Check if @var{char_pred} is true for every character in string
6437 @var{s}.
6438
6439 @var{char_pred} can be a character to check for every character equal
6440 to that, or a character set (@pxref{Character Sets}) to check for
6441 every character being in that set, or a predicate procedure to call.
6442
6443 For a procedure, calls @code{(@var{char_pred} c)} are made
6444 successively on the characters from @var{start} to @var{end}. If
6445 @var{char_pred} returns @code{#f}, @code{string-every} stops and
6446 returns @code{#f}. The call on the last character (ie.@: at
6447 @math{@var{end}-1}), if that point is reached, is a tail call and the
6448 return from that call is the return from @code{string-every}.
6449
6450 If there are no characters in @var{s} (ie.@: @var{start} equals
6451 @var{end}) then the return is @code{#t}.
6452
6453 @end deffn
6454
6455 \fstring-tabulate
6456 @c snarfed from srfi-13.c:214
6457 @deffn {Scheme Procedure} string-tabulate proc len
6458 @deffnx {C Function} scm_string_tabulate (proc, len)
6459 @var{proc} is an integer->char procedure. Construct a string
6460 of size @var{len} by applying @var{proc} to each index to
6461 produce the corresponding string element. The order in which
6462 @var{proc} is applied to the indices is not specified.
6463 @end deffn
6464
6465 \fstring->list
6466 @c snarfed from srfi-13.c:246
6467 @deffn {Scheme Procedure} string->list str [start [end]]
6468 @deffnx {C Function} scm_substring_to_list (str, start, end)
6469 Convert the string @var{str} into a list of characters.
6470 @end deffn
6471
6472 \freverse-list->string
6473 @c snarfed from srfi-13.c:285
6474 @deffn {Scheme Procedure} reverse-list->string chrs
6475 @deffnx {C Function} scm_reverse_list_to_string (chrs)
6476 An efficient implementation of @code{(compose string->list
6477 reverse)}:
6478
6479 @smalllisp
6480 (reverse-list->string '(#\a #\B #\c)) @result{} "cBa"
6481 @end smalllisp
6482 @end deffn
6483
6484 \fstring-join
6485 @c snarfed from srfi-13.c:352
6486 @deffn {Scheme Procedure} string-join ls [delimiter [grammar]]
6487 @deffnx {C Function} scm_string_join (ls, delimiter, grammar)
6488 Append the string in the string list @var{ls}, using the string
6489 @var{delim} as a delimiter between the elements of @var{ls}.
6490 @var{grammar} is a symbol which specifies how the delimiter is
6491 placed between the strings, and defaults to the symbol
6492 @code{infix}.
6493
6494 @table @code
6495 @item infix
6496 Insert the separator between list elements. An empty string
6497 will produce an empty list.
6498 @item string-infix
6499 Like @code{infix}, but will raise an error if given the empty
6500 list.
6501 @item suffix
6502 Insert the separator after every list element.
6503 @item prefix
6504 Insert the separator before each list element.
6505 @end table
6506 @end deffn
6507
6508 \fstring-copy
6509 @c snarfed from srfi-13.c:486
6510 @deffn {Scheme Procedure} string-copy str [start [end]]
6511 @deffnx {C Function} scm_srfi13_substring_copy (str, start, end)
6512 Return a freshly allocated copy of the string @var{str}. If
6513 given, @var{start} and @var{end} delimit the portion of
6514 @var{str} which is copied.
6515 @end deffn
6516
6517 \fstring-copy!
6518 @c snarfed from srfi-13.c:513
6519 @deffn {Scheme Procedure} string-copy! target tstart s [start [end]]
6520 @deffnx {C Function} scm_string_copy_x (target, tstart, s, start, end)
6521 Copy the sequence of characters from index range [@var{start},
6522 @var{end}) in string @var{s} to string @var{target}, beginning
6523 at index @var{tstart}. The characters are copied left-to-right
6524 or right-to-left as needed -- the copy is guaranteed to work,
6525 even if @var{target} and @var{s} are the same string. It is an
6526 error if the copy operation runs off the end of the target
6527 string.
6528 @end deffn
6529
6530 \fsubstring-move!
6531 @c snarfed from srfi-13.c:543
6532 @deffn {Scheme Procedure} substring-move! str1 start1 end1 str2 start2
6533 @deffnx {C Function} scm_substring_move_x (str1, start1, end1, str2, start2)
6534 Copy the substring of @var{str1} bounded by @var{start1} and @var{end1}
6535 into @var{str2} beginning at position @var{start2}.
6536 @var{str1} and @var{str2} can be the same string.
6537 @end deffn
6538
6539 \fstring-take
6540 @c snarfed from srfi-13.c:552
6541 @deffn {Scheme Procedure} string-take s n
6542 @deffnx {C Function} scm_string_take (s, n)
6543 Return the @var{n} first characters of @var{s}.
6544 @end deffn
6545
6546 \fstring-drop
6547 @c snarfed from srfi-13.c:562
6548 @deffn {Scheme Procedure} string-drop s n
6549 @deffnx {C Function} scm_string_drop (s, n)
6550 Return all but the first @var{n} characters of @var{s}.
6551 @end deffn
6552
6553 \fstring-take-right
6554 @c snarfed from srfi-13.c:572
6555 @deffn {Scheme Procedure} string-take-right s n
6556 @deffnx {C Function} scm_string_take_right (s, n)
6557 Return the @var{n} last characters of @var{s}.
6558 @end deffn
6559
6560 \fstring-drop-right
6561 @c snarfed from srfi-13.c:584
6562 @deffn {Scheme Procedure} string-drop-right s n
6563 @deffnx {C Function} scm_string_drop_right (s, n)
6564 Return all but the last @var{n} characters of @var{s}.
6565 @end deffn
6566
6567 \fstring-pad
6568 @c snarfed from srfi-13.c:599
6569 @deffn {Scheme Procedure} string-pad s len [chr [start [end]]]
6570 @deffnx {C Function} scm_string_pad (s, len, chr, start, end)
6571 Take that characters from @var{start} to @var{end} from the
6572 string @var{s} and return a new string, right-padded by the
6573 character @var{chr} to length @var{len}. If the resulting
6574 string is longer than @var{len}, it is truncated on the right.
6575 @end deffn
6576
6577 \fstring-pad-right
6578 @c snarfed from srfi-13.c:639
6579 @deffn {Scheme Procedure} string-pad-right s len [chr [start [end]]]
6580 @deffnx {C Function} scm_string_pad_right (s, len, chr, start, end)
6581 Take that characters from @var{start} to @var{end} from the
6582 string @var{s} and return a new string, left-padded by the
6583 character @var{chr} to length @var{len}. If the resulting
6584 string is longer than @var{len}, it is truncated on the left.
6585 @end deffn
6586
6587 \fstring-trim
6588 @c snarfed from srfi-13.c:692
6589 @deffn {Scheme Procedure} string-trim s [char_pred [start [end]]]
6590 @deffnx {C Function} scm_string_trim (s, char_pred, start, end)
6591 Trim @var{s} by skipping over all characters on the left
6592 that satisfy the parameter @var{char_pred}:
6593
6594 @itemize @bullet
6595 @item
6596 if it is the character @var{ch}, characters equal to
6597 @var{ch} are trimmed,
6598
6599 @item
6600 if it is a procedure @var{pred} characters that
6601 satisfy @var{pred} are trimmed,
6602
6603 @item
6604 if it is a character set, characters in that set are trimmed.
6605 @end itemize
6606
6607 If called without a @var{char_pred} argument, all whitespace is
6608 trimmed.
6609 @end deffn
6610
6611 \fstring-trim-right
6612 @c snarfed from srfi-13.c:768
6613 @deffn {Scheme Procedure} string-trim-right s [char_pred [start [end]]]
6614 @deffnx {C Function} scm_string_trim_right (s, char_pred, start, end)
6615 Trim @var{s} by skipping over all characters on the rightt
6616 that satisfy the parameter @var{char_pred}:
6617
6618 @itemize @bullet
6619 @item
6620 if it is the character @var{ch}, characters equal to @var{ch}
6621 are trimmed,
6622
6623 @item
6624 if it is a procedure @var{pred} characters that satisfy
6625 @var{pred} are trimmed,
6626
6627 @item
6628 if it is a character sets, all characters in that set are
6629 trimmed.
6630 @end itemize
6631
6632 If called without a @var{char_pred} argument, all whitespace is
6633 trimmed.
6634 @end deffn
6635
6636 \fstring-trim-both
6637 @c snarfed from srfi-13.c:844
6638 @deffn {Scheme Procedure} string-trim-both s [char_pred [start [end]]]
6639 @deffnx {C Function} scm_string_trim_both (s, char_pred, start, end)
6640 Trim @var{s} by skipping over all characters on both sides of
6641 the string that satisfy the parameter @var{char_pred}:
6642
6643 @itemize @bullet
6644 @item
6645 if it is the character @var{ch}, characters equal to @var{ch}
6646 are trimmed,
6647
6648 @item
6649 if it is a procedure @var{pred} characters that satisfy
6650 @var{pred} are trimmed,
6651
6652 @item
6653 if it is a character set, the characters in the set are
6654 trimmed.
6655 @end itemize
6656
6657 If called without a @var{char_pred} argument, all whitespace is
6658 trimmed.
6659 @end deffn
6660
6661 \fstring-fill!
6662 @c snarfed from srfi-13.c:931
6663 @deffn {Scheme Procedure} string-fill! str chr [start [end]]
6664 @deffnx {C Function} scm_substring_fill_x (str, chr, start, end)
6665 Stores @var{chr} in every element of the given @var{str} and
6666 returns an unspecified value.
6667 @end deffn
6668
6669 \fstring-compare
6670 @c snarfed from srfi-13.c:983
6671 @deffn {Scheme Procedure} string-compare s1 s2 proc_lt proc_eq proc_gt [start1 [end1 [start2 [end2]]]]
6672 @deffnx {C Function} scm_string_compare (s1, s2, proc_lt, proc_eq, proc_gt, start1, end1, start2, end2)
6673 Apply @var{proc_lt}, @var{proc_eq}, @var{proc_gt} to the
6674 mismatch index, depending upon whether @var{s1} is less than,
6675 equal to, or greater than @var{s2}. The mismatch index is the
6676 largest index @var{i} such that for every 0 <= @var{j} <
6677 @var{i}, @var{s1}[@var{j}] = @var{s2}[@var{j}] -- that is,
6678 @var{i} is the first position that does not match.
6679 @end deffn
6680
6681 \fstring-compare-ci
6682 @c snarfed from srfi-13.c:1037
6683 @deffn {Scheme Procedure} string-compare-ci s1 s2 proc_lt proc_eq proc_gt [start1 [end1 [start2 [end2]]]]
6684 @deffnx {C Function} scm_string_compare_ci (s1, s2, proc_lt, proc_eq, proc_gt, start1, end1, start2, end2)
6685 Apply @var{proc_lt}, @var{proc_eq}, @var{proc_gt} to the
6686 mismatch index, depending upon whether @var{s1} is less than,
6687 equal to, or greater than @var{s2}. The mismatch index is the
6688 largest index @var{i} such that for every 0 <= @var{j} <
6689 @var{i}, @var{s1}[@var{j}] = @var{s2}[@var{j}] -- that is,
6690 @var{i} is the first position that does not match. The
6691 character comparison is done case-insensitively.
6692 @end deffn
6693
6694 \fstring=
6695 @c snarfed from srfi-13.c:1088
6696 @deffn {Scheme Procedure} string= s1 s2 [start1 [end1 [start2 [end2]]]]
6697 @deffnx {C Function} scm_string_eq (s1, s2, start1, end1, start2, end2)
6698 Return @code{#f} if @var{s1} and @var{s2} are not equal, a true
6699 value otherwise.
6700 @end deffn
6701
6702 \fstring<>
6703 @c snarfed from srfi-13.c:1127
6704 @deffn {Scheme Procedure} string<> s1 s2 [start1 [end1 [start2 [end2]]]]
6705 @deffnx {C Function} scm_string_neq (s1, s2, start1, end1, start2, end2)
6706 Return @code{#f} if @var{s1} and @var{s2} are equal, a true
6707 value otherwise.
6708 @end deffn
6709
6710 \fstring<
6711 @c snarfed from srfi-13.c:1170
6712 @deffn {Scheme Procedure} string< s1 s2 [start1 [end1 [start2 [end2]]]]
6713 @deffnx {C Function} scm_string_lt (s1, s2, start1, end1, start2, end2)
6714 Return @code{#f} if @var{s1} is greater or equal to @var{s2}, a
6715 true value otherwise.
6716 @end deffn
6717
6718 \fstring>
6719 @c snarfed from srfi-13.c:1213
6720 @deffn {Scheme Procedure} string> s1 s2 [start1 [end1 [start2 [end2]]]]
6721 @deffnx {C Function} scm_string_gt (s1, s2, start1, end1, start2, end2)
6722 Return @code{#f} if @var{s1} is less or equal to @var{s2}, a
6723 true value otherwise.
6724 @end deffn
6725
6726 \fstring<=
6727 @c snarfed from srfi-13.c:1256
6728 @deffn {Scheme Procedure} string<= s1 s2 [start1 [end1 [start2 [end2]]]]
6729 @deffnx {C Function} scm_string_le (s1, s2, start1, end1, start2, end2)
6730 Return @code{#f} if @var{s1} is greater to @var{s2}, a true
6731 value otherwise.
6732 @end deffn
6733
6734 \fstring>=
6735 @c snarfed from srfi-13.c:1299
6736 @deffn {Scheme Procedure} string>= s1 s2 [start1 [end1 [start2 [end2]]]]
6737 @deffnx {C Function} scm_string_ge (s1, s2, start1, end1, start2, end2)
6738 Return @code{#f} if @var{s1} is less to @var{s2}, a true value
6739 otherwise.
6740 @end deffn
6741
6742 \fstring-ci=
6743 @c snarfed from srfi-13.c:1343
6744 @deffn {Scheme Procedure} string-ci= s1 s2 [start1 [end1 [start2 [end2]]]]
6745 @deffnx {C Function} scm_string_ci_eq (s1, s2, start1, end1, start2, end2)
6746 Return @code{#f} if @var{s1} and @var{s2} are not equal, a true
6747 value otherwise. The character comparison is done
6748 case-insensitively.
6749 @end deffn
6750
6751 \fstring-ci<>
6752 @c snarfed from srfi-13.c:1387
6753 @deffn {Scheme Procedure} string-ci<> s1 s2 [start1 [end1 [start2 [end2]]]]
6754 @deffnx {C Function} scm_string_ci_neq (s1, s2, start1, end1, start2, end2)
6755 Return @code{#f} if @var{s1} and @var{s2} are equal, a true
6756 value otherwise. The character comparison is done
6757 case-insensitively.
6758 @end deffn
6759
6760 \fstring-ci<
6761 @c snarfed from srfi-13.c:1431
6762 @deffn {Scheme Procedure} string-ci< s1 s2 [start1 [end1 [start2 [end2]]]]
6763 @deffnx {C Function} scm_string_ci_lt (s1, s2, start1, end1, start2, end2)
6764 Return @code{#f} if @var{s1} is greater or equal to @var{s2}, a
6765 true value otherwise. The character comparison is done
6766 case-insensitively.
6767 @end deffn
6768
6769 \fstring-ci>
6770 @c snarfed from srfi-13.c:1475
6771 @deffn {Scheme Procedure} string-ci> s1 s2 [start1 [end1 [start2 [end2]]]]
6772 @deffnx {C Function} scm_string_ci_gt (s1, s2, start1, end1, start2, end2)
6773 Return @code{#f} if @var{s1} is less or equal to @var{s2}, a
6774 true value otherwise. The character comparison is done
6775 case-insensitively.
6776 @end deffn
6777
6778 \fstring-ci<=
6779 @c snarfed from srfi-13.c:1519
6780 @deffn {Scheme Procedure} string-ci<= s1 s2 [start1 [end1 [start2 [end2]]]]
6781 @deffnx {C Function} scm_string_ci_le (s1, s2, start1, end1, start2, end2)
6782 Return @code{#f} if @var{s1} is greater to @var{s2}, a true
6783 value otherwise. The character comparison is done
6784 case-insensitively.
6785 @end deffn
6786
6787 \fstring-ci>=
6788 @c snarfed from srfi-13.c:1563
6789 @deffn {Scheme Procedure} string-ci>= s1 s2 [start1 [end1 [start2 [end2]]]]
6790 @deffnx {C Function} scm_string_ci_ge (s1, s2, start1, end1, start2, end2)
6791 Return @code{#f} if @var{s1} is less to @var{s2}, a true value
6792 otherwise. The character comparison is done
6793 case-insensitively.
6794 @end deffn
6795
6796 \fstring-hash
6797 @c snarfed from srfi-13.c:1608
6798 @deffn {Scheme Procedure} string-hash s [bound [start [end]]]
6799 @deffnx {C Function} scm_substring_hash (s, bound, start, end)
6800 Compute a hash value for @var{S}. the optional argument @var{bound} is a non-negative exact integer specifying the range of the hash function. A positive value restricts the return value to the range [0,bound).
6801 @end deffn
6802
6803 \fstring-hash-ci
6804 @c snarfed from srfi-13.c:1625
6805 @deffn {Scheme Procedure} string-hash-ci s [bound [start [end]]]
6806 @deffnx {C Function} scm_substring_hash_ci (s, bound, start, end)
6807 Compute a hash value for @var{S}. the optional argument @var{bound} is a non-negative exact integer specifying the range of the hash function. A positive value restricts the return value to the range [0,bound).
6808 @end deffn
6809
6810 \fstring-prefix-length
6811 @c snarfed from srfi-13.c:1637
6812 @deffn {Scheme Procedure} string-prefix-length s1 s2 [start1 [end1 [start2 [end2]]]]
6813 @deffnx {C Function} scm_string_prefix_length (s1, s2, start1, end1, start2, end2)
6814 Return the length of the longest common prefix of the two
6815 strings.
6816 @end deffn
6817
6818 \fstring-prefix-length-ci
6819 @c snarfed from srfi-13.c:1669
6820 @deffn {Scheme Procedure} string-prefix-length-ci s1 s2 [start1 [end1 [start2 [end2]]]]
6821 @deffnx {C Function} scm_string_prefix_length_ci (s1, s2, start1, end1, start2, end2)
6822 Return the length of the longest common prefix of the two
6823 strings, ignoring character case.
6824 @end deffn
6825
6826 \fstring-suffix-length
6827 @c snarfed from srfi-13.c:1701
6828 @deffn {Scheme Procedure} string-suffix-length s1 s2 [start1 [end1 [start2 [end2]]]]
6829 @deffnx {C Function} scm_string_suffix_length (s1, s2, start1, end1, start2, end2)
6830 Return the length of the longest common suffix of the two
6831 strings.
6832 @end deffn
6833
6834 \fstring-suffix-length-ci
6835 @c snarfed from srfi-13.c:1733
6836 @deffn {Scheme Procedure} string-suffix-length-ci s1 s2 [start1 [end1 [start2 [end2]]]]
6837 @deffnx {C Function} scm_string_suffix_length_ci (s1, s2, start1, end1, start2, end2)
6838 Return the length of the longest common suffix of the two
6839 strings, ignoring character case.
6840 @end deffn
6841
6842 \fstring-prefix?
6843 @c snarfed from srfi-13.c:1764
6844 @deffn {Scheme Procedure} string-prefix? s1 s2 [start1 [end1 [start2 [end2]]]]
6845 @deffnx {C Function} scm_string_prefix_p (s1, s2, start1, end1, start2, end2)
6846 Is @var{s1} a prefix of @var{s2}?
6847 @end deffn
6848
6849 \fstring-prefix-ci?
6850 @c snarfed from srfi-13.c:1796
6851 @deffn {Scheme Procedure} string-prefix-ci? s1 s2 [start1 [end1 [start2 [end2]]]]
6852 @deffnx {C Function} scm_string_prefix_ci_p (s1, s2, start1, end1, start2, end2)
6853 Is @var{s1} a prefix of @var{s2}, ignoring character case?
6854 @end deffn
6855
6856 \fstring-suffix?
6857 @c snarfed from srfi-13.c:1828
6858 @deffn {Scheme Procedure} string-suffix? s1 s2 [start1 [end1 [start2 [end2]]]]
6859 @deffnx {C Function} scm_string_suffix_p (s1, s2, start1, end1, start2, end2)
6860 Is @var{s1} a suffix of @var{s2}?
6861 @end deffn
6862
6863 \fstring-suffix-ci?
6864 @c snarfed from srfi-13.c:1860
6865 @deffn {Scheme Procedure} string-suffix-ci? s1 s2 [start1 [end1 [start2 [end2]]]]
6866 @deffnx {C Function} scm_string_suffix_ci_p (s1, s2, start1, end1, start2, end2)
6867 Is @var{s1} a suffix of @var{s2}, ignoring character case?
6868 @end deffn
6869
6870 \fstring-index
6871 @c snarfed from srfi-13.c:1904
6872 @deffn {Scheme Procedure} string-index s char_pred [start [end]]
6873 @deffnx {C Function} scm_string_index (s, char_pred, start, end)
6874 Search through the string @var{s} from left to right, returning
6875 the index of the first occurence of a character which
6876
6877 @itemize @bullet
6878 @item
6879 equals @var{char_pred}, if it is character,
6880
6881 @item
6882 satisifies the predicate @var{char_pred}, if it is a procedure,
6883
6884 @item
6885 is in the set @var{char_pred}, if it is a character set.
6886 @end itemize
6887 @end deffn
6888
6889 \fstring-index-right
6890 @c snarfed from srfi-13.c:1969
6891 @deffn {Scheme Procedure} string-index-right s char_pred [start [end]]
6892 @deffnx {C Function} scm_string_index_right (s, char_pred, start, end)
6893 Search through the string @var{s} from right to left, returning
6894 the index of the last occurence of a character which
6895
6896 @itemize @bullet
6897 @item
6898 equals @var{char_pred}, if it is character,
6899
6900 @item
6901 satisifies the predicate @var{char_pred}, if it is a procedure,
6902
6903 @item
6904 is in the set if @var{char_pred} is a character set.
6905 @end itemize
6906 @end deffn
6907
6908 \fstring-rindex
6909 @c snarfed from srfi-13.c:2034
6910 @deffn {Scheme Procedure} string-rindex s char_pred [start [end]]
6911 @deffnx {C Function} scm_string_rindex (s, char_pred, start, end)
6912 Search through the string @var{s} from right to left, returning
6913 the index of the last occurence of a character which
6914
6915 @itemize @bullet
6916 @item
6917 equals @var{char_pred}, if it is character,
6918
6919 @item
6920 satisifies the predicate @var{char_pred}, if it is a procedure,
6921
6922 @item
6923 is in the set if @var{char_pred} is a character set.
6924 @end itemize
6925 @end deffn
6926
6927 \fstring-skip
6928 @c snarfed from srfi-13.c:2056
6929 @deffn {Scheme Procedure} string-skip s char_pred [start [end]]
6930 @deffnx {C Function} scm_string_skip (s, char_pred, start, end)
6931 Search through the string @var{s} from left to right, returning
6932 the index of the first occurence of a character which
6933
6934 @itemize @bullet
6935 @item
6936 does not equal @var{char_pred}, if it is character,
6937
6938 @item
6939 does not satisify the predicate @var{char_pred}, if it is a
6940 procedure,
6941
6942 @item
6943 is not in the set if @var{char_pred} is a character set.
6944 @end itemize
6945 @end deffn
6946
6947 \fstring-skip-right
6948 @c snarfed from srfi-13.c:2123
6949 @deffn {Scheme Procedure} string-skip-right s char_pred [start [end]]
6950 @deffnx {C Function} scm_string_skip_right (s, char_pred, start, end)
6951 Search through the string @var{s} from right to left, returning
6952 the index of the last occurence of a character which
6953
6954 @itemize @bullet
6955 @item
6956 does not equal @var{char_pred}, if it is character,
6957
6958 @item
6959 does not satisfy the predicate @var{char_pred}, if it is a
6960 procedure,
6961
6962 @item
6963 is not in the set if @var{char_pred} is a character set.
6964 @end itemize
6965 @end deffn
6966
6967 \fstring-count
6968 @c snarfed from srfi-13.c:2190
6969 @deffn {Scheme Procedure} string-count s char_pred [start [end]]
6970 @deffnx {C Function} scm_string_count (s, char_pred, start, end)
6971 Return the count of the number of characters in the string
6972 @var{s} which
6973
6974 @itemize @bullet
6975 @item
6976 equals @var{char_pred}, if it is character,
6977
6978 @item
6979 satisifies the predicate @var{char_pred}, if it is a procedure.
6980
6981 @item
6982 is in the set @var{char_pred}, if it is a character set.
6983 @end itemize
6984 @end deffn
6985
6986 \fstring-contains
6987 @c snarfed from srfi-13.c:2247
6988 @deffn {Scheme Procedure} string-contains s1 s2 [start1 [end1 [start2 [end2]]]]
6989 @deffnx {C Function} scm_string_contains (s1, s2, start1, end1, start2, end2)
6990 Does string @var{s1} contain string @var{s2}? Return the index
6991 in @var{s1} where @var{s2} occurs as a substring, or false.
6992 The optional start/end indices restrict the operation to the
6993 indicated substrings.
6994 @end deffn
6995
6996 \fstring-contains-ci
6997 @c snarfed from srfi-13.c:2294
6998 @deffn {Scheme Procedure} string-contains-ci s1 s2 [start1 [end1 [start2 [end2]]]]
6999 @deffnx {C Function} scm_string_contains_ci (s1, s2, start1, end1, start2, end2)
7000 Does string @var{s1} contain string @var{s2}? Return the index
7001 in @var{s1} where @var{s2} occurs as a substring, or false.
7002 The optional start/end indices restrict the operation to the
7003 indicated substrings. Character comparison is done
7004 case-insensitively.
7005 @end deffn
7006
7007 \fstring-upcase!
7008 @c snarfed from srfi-13.c:2359
7009 @deffn {Scheme Procedure} string-upcase! str [start [end]]
7010 @deffnx {C Function} scm_substring_upcase_x (str, start, end)
7011 Destructively upcase every character in @code{str}.
7012
7013 @lisp
7014 (string-upcase! y)
7015 @result{} "ARRDEFG"
7016 y
7017 @result{} "ARRDEFG"
7018 @end lisp
7019 @end deffn
7020
7021 \fstring-upcase
7022 @c snarfed from srfi-13.c:2380
7023 @deffn {Scheme Procedure} string-upcase str [start [end]]
7024 @deffnx {C Function} scm_substring_upcase (str, start, end)
7025 Upcase every character in @code{str}.
7026 @end deffn
7027
7028 \fstring-downcase!
7029 @c snarfed from srfi-13.c:2427
7030 @deffn {Scheme Procedure} string-downcase! str [start [end]]
7031 @deffnx {C Function} scm_substring_downcase_x (str, start, end)
7032 Destructively downcase every character in @var{str}.
7033
7034 @lisp
7035 y
7036 @result{} "ARRDEFG"
7037 (string-downcase! y)
7038 @result{} "arrdefg"
7039 y
7040 @result{} "arrdefg"
7041 @end lisp
7042 @end deffn
7043
7044 \fstring-downcase
7045 @c snarfed from srfi-13.c:2448
7046 @deffn {Scheme Procedure} string-downcase str [start [end]]
7047 @deffnx {C Function} scm_substring_downcase (str, start, end)
7048 Downcase every character in @var{str}.
7049 @end deffn
7050
7051 \fstring-titlecase!
7052 @c snarfed from srfi-13.c:2504
7053 @deffn {Scheme Procedure} string-titlecase! str [start [end]]
7054 @deffnx {C Function} scm_string_titlecase_x (str, start, end)
7055 Destructively titlecase every first character in a word in
7056 @var{str}.
7057 @end deffn
7058
7059 \fstring-titlecase
7060 @c snarfed from srfi-13.c:2520
7061 @deffn {Scheme Procedure} string-titlecase str [start [end]]
7062 @deffnx {C Function} scm_string_titlecase (str, start, end)
7063 Titlecase every first character in a word in @var{str}.
7064 @end deffn
7065
7066 \fstring-capitalize!
7067 @c snarfed from srfi-13.c:2542
7068 @deffn {Scheme Procedure} string-capitalize! str
7069 @deffnx {C Function} scm_string_capitalize_x (str)
7070 Upcase the first character of every word in @var{str}
7071 destructively and return @var{str}.
7072
7073 @lisp
7074 y @result{} "hello world"
7075 (string-capitalize! y) @result{} "Hello World"
7076 y @result{} "Hello World"
7077 @end lisp
7078 @end deffn
7079
7080 \fstring-capitalize
7081 @c snarfed from srfi-13.c:2554
7082 @deffn {Scheme Procedure} string-capitalize str
7083 @deffnx {C Function} scm_string_capitalize (str)
7084 Return a freshly allocated string with the characters in
7085 @var{str}, where the first character of every word is
7086 capitalized.
7087 @end deffn
7088
7089 \fstring-reverse
7090 @c snarfed from srfi-13.c:2588
7091 @deffn {Scheme Procedure} string-reverse str [start [end]]
7092 @deffnx {C Function} scm_string_reverse (str, start, end)
7093 Reverse the string @var{str}. The optional arguments
7094 @var{start} and @var{end} delimit the region of @var{str} to
7095 operate on.
7096 @end deffn
7097
7098 \fstring-reverse!
7099 @c snarfed from srfi-13.c:2613
7100 @deffn {Scheme Procedure} string-reverse! str [start [end]]
7101 @deffnx {C Function} scm_string_reverse_x (str, start, end)
7102 Reverse the string @var{str} in-place. The optional arguments
7103 @var{start} and @var{end} delimit the region of @var{str} to
7104 operate on. The return value is unspecified.
7105 @end deffn
7106
7107 \fstring-append/shared
7108 @c snarfed from srfi-13.c:2635
7109 @deffn {Scheme Procedure} string-append/shared . ls
7110 @deffnx {C Function} scm_string_append_shared (ls)
7111 Like @code{string-append}, but the result may share memory
7112 with the argument strings.
7113 @end deffn
7114
7115 \fstring-concatenate
7116 @c snarfed from srfi-13.c:2656
7117 @deffn {Scheme Procedure} string-concatenate ls
7118 @deffnx {C Function} scm_string_concatenate (ls)
7119 Append the elements of @var{ls} (which must be strings)
7120 together into a single string. Guaranteed to return a freshly
7121 allocated string.
7122 @end deffn
7123
7124 \fstring-concatenate-reverse
7125 @c snarfed from srfi-13.c:2678
7126 @deffn {Scheme Procedure} string-concatenate-reverse ls [final_string [end]]
7127 @deffnx {C Function} scm_string_concatenate_reverse (ls, final_string, end)
7128 Without optional arguments, this procedure is equivalent to
7129
7130 @smalllisp
7131 (string-concatenate (reverse ls))
7132 @end smalllisp
7133
7134 If the optional argument @var{final_string} is specified, it is
7135 consed onto the beginning to @var{ls} before performing the
7136 list-reverse and string-concatenate operations. If @var{end}
7137 is given, only the characters of @var{final_string} up to index
7138 @var{end} are used.
7139
7140 Guaranteed to return a freshly allocated string.
7141 @end deffn
7142
7143 \fstring-concatenate/shared
7144 @c snarfed from srfi-13.c:2695
7145 @deffn {Scheme Procedure} string-concatenate/shared ls
7146 @deffnx {C Function} scm_string_concatenate_shared (ls)
7147 Like @code{string-concatenate}, but the result may share memory
7148 with the strings in the list @var{ls}.
7149 @end deffn
7150
7151 \fstring-concatenate-reverse/shared
7152 @c snarfed from srfi-13.c:2706
7153 @deffn {Scheme Procedure} string-concatenate-reverse/shared ls [final_string [end]]
7154 @deffnx {C Function} scm_string_concatenate_reverse_shared (ls, final_string, end)
7155 Like @code{string-concatenate-reverse}, but the result may
7156 share memory with the the strings in the @var{ls} arguments.
7157 @end deffn
7158
7159 \fstring-map
7160 @c snarfed from srfi-13.c:2719
7161 @deffn {Scheme Procedure} string-map proc s [start [end]]
7162 @deffnx {C Function} scm_string_map (proc, s, start, end)
7163 @var{proc} is a char->char procedure, it is mapped over
7164 @var{s}. The order in which the procedure is applied to the
7165 string elements is not specified.
7166 @end deffn
7167
7168 \fstring-map!
7169 @c snarfed from srfi-13.c:2749
7170 @deffn {Scheme Procedure} string-map! proc s [start [end]]
7171 @deffnx {C Function} scm_string_map_x (proc, s, start, end)
7172 @var{proc} is a char->char procedure, it is mapped over
7173 @var{s}. The order in which the procedure is applied to the
7174 string elements is not specified. The string @var{s} is
7175 modified in-place, the return value is not specified.
7176 @end deffn
7177
7178 \fstring-fold
7179 @c snarfed from srfi-13.c:2776
7180 @deffn {Scheme Procedure} string-fold kons knil s [start [end]]
7181 @deffnx {C Function} scm_string_fold (kons, knil, s, start, end)
7182 Fold @var{kons} over the characters of @var{s}, with @var{knil}
7183 as the terminating element, from left to right. @var{kons}
7184 must expect two arguments: The actual character and the last
7185 result of @var{kons}' application.
7186 @end deffn
7187
7188 \fstring-fold-right
7189 @c snarfed from srfi-13.c:2807
7190 @deffn {Scheme Procedure} string-fold-right kons knil s [start [end]]
7191 @deffnx {C Function} scm_string_fold_right (kons, knil, s, start, end)
7192 Fold @var{kons} over the characters of @var{s}, with @var{knil}
7193 as the terminating element, from right to left. @var{kons}
7194 must expect two arguments: The actual character and the last
7195 result of @var{kons}' application.
7196 @end deffn
7197
7198 \fstring-unfold
7199 @c snarfed from srfi-13.c:2852
7200 @deffn {Scheme Procedure} string-unfold p f g seed [base [make_final]]
7201 @deffnx {C Function} scm_string_unfold (p, f, g, seed, base, make_final)
7202 @itemize @bullet
7203 @item @var{g} is used to generate a series of @emph{seed}
7204 values from the initial @var{seed}: @var{seed}, (@var{g}
7205 @var{seed}), (@var{g}^2 @var{seed}), (@var{g}^3 @var{seed}),
7206 @dots{}
7207 @item @var{p} tells us when to stop -- when it returns true
7208 when applied to one of these seed values.
7209 @item @var{f} maps each seed value to the corresponding
7210 character in the result string. These chars are assembled
7211 into the string in a left-to-right order.
7212 @item @var{base} is the optional initial/leftmost portion
7213 of the constructed string; it default to the empty
7214 string.
7215 @item @var{make_final} is applied to the terminal seed
7216 value (on which @var{p} returns true) to produce
7217 the final/rightmost portion of the constructed string.
7218 It defaults to @code{(lambda (x) )}.
7219 @end itemize
7220 @end deffn
7221
7222 \fstring-unfold-right
7223 @c snarfed from srfi-13.c:2915
7224 @deffn {Scheme Procedure} string-unfold-right p f g seed [base [make_final]]
7225 @deffnx {C Function} scm_string_unfold_right (p, f, g, seed, base, make_final)
7226 @itemize @bullet
7227 @item @var{g} is used to generate a series of @emph{seed}
7228 values from the initial @var{seed}: @var{seed}, (@var{g}
7229 @var{seed}), (@var{g}^2 @var{seed}), (@var{g}^3 @var{seed}),
7230 @dots{}
7231 @item @var{p} tells us when to stop -- when it returns true
7232 when applied to one of these seed values.
7233 @item @var{f} maps each seed value to the corresponding
7234 character in the result string. These chars are assembled
7235 into the string in a right-to-left order.
7236 @item @var{base} is the optional initial/rightmost portion
7237 of the constructed string; it default to the empty
7238 string.
7239 @item @var{make_final} is applied to the terminal seed
7240 value (on which @var{p} returns true) to produce
7241 the final/leftmost portion of the constructed string.
7242 It defaults to @code{(lambda (x) )}.
7243 @end itemize
7244 @end deffn
7245
7246 \fstring-for-each
7247 @c snarfed from srfi-13.c:2962
7248 @deffn {Scheme Procedure} string-for-each proc s [start [end]]
7249 @deffnx {C Function} scm_string_for_each (proc, s, start, end)
7250 @var{proc} is mapped over @var{s} in left-to-right order. The
7251 return value is not specified.
7252 @end deffn
7253
7254 \fstring-for-each-index
7255 @c snarfed from srfi-13.c:2988
7256 @deffn {Scheme Procedure} string-for-each-index proc s [start [end]]
7257 @deffnx {C Function} scm_string_for_each_index (proc, s, start, end)
7258 @var{proc} is mapped over @var{s} in left-to-right order. The
7259 return value is not specified.
7260 @end deffn
7261
7262 \fxsubstring
7263 @c snarfed from srfi-13.c:3020
7264 @deffn {Scheme Procedure} xsubstring s from [to [start [end]]]
7265 @deffnx {C Function} scm_xsubstring (s, from, to, start, end)
7266 This is the @emph{extended substring} procedure that implements
7267 replicated copying of a substring of some string.
7268
7269 @var{s} is a string, @var{start} and @var{end} are optional
7270 arguments that demarcate a substring of @var{s}, defaulting to
7271 0 and the length of @var{s}. Replicate this substring up and
7272 down index space, in both the positive and negative directions.
7273 @code{xsubstring} returns the substring of this string
7274 beginning at index @var{from}, and ending at @var{to}, which
7275 defaults to @var{from} + (@var{end} - @var{start}).
7276 @end deffn
7277
7278 \fstring-xcopy!
7279 @c snarfed from srfi-13.c:3067
7280 @deffn {Scheme Procedure} string-xcopy! target tstart s sfrom [sto [start [end]]]
7281 @deffnx {C Function} scm_string_xcopy_x (target, tstart, s, sfrom, sto, start, end)
7282 Exactly the same as @code{xsubstring}, but the extracted text
7283 is written into the string @var{target} starting at index
7284 @var{tstart}. The operation is not defined if @code{(eq?
7285 @var{target} @var{s})} or these arguments share storage -- you
7286 cannot copy a string on top of itself.
7287 @end deffn
7288
7289 \fstring-replace
7290 @c snarfed from srfi-13.c:3117
7291 @deffn {Scheme Procedure} string-replace s1 s2 [start1 [end1 [start2 [end2]]]]
7292 @deffnx {C Function} scm_string_replace (s1, s2, start1, end1, start2, end2)
7293 Return the string @var{s1}, but with the characters
7294 @var{start1} @dots{} @var{end1} replaced by the characters
7295 @var{start2} @dots{} @var{end2} from @var{s2}.
7296 @end deffn
7297
7298 \fstring-tokenize
7299 @c snarfed from srfi-13.c:3154
7300 @deffn {Scheme Procedure} string-tokenize s [token_set [start [end]]]
7301 @deffnx {C Function} scm_string_tokenize (s, token_set, start, end)
7302 Split the string @var{s} into a list of substrings, where each
7303 substring is a maximal non-empty contiguous sequence of
7304 characters from the character set @var{token_set}, which
7305 defaults to @code{char-set:graphic}.
7306 If @var{start} or @var{end} indices are provided, they restrict
7307 @code{string-tokenize} to operating on the indicated substring
7308 of @var{s}.
7309 @end deffn
7310
7311 \fstring-split
7312 @c snarfed from srfi-13.c:3220
7313 @deffn {Scheme Procedure} string-split str chr
7314 @deffnx {C Function} scm_string_split (str, chr)
7315 Split the string @var{str} into the a list of the substrings delimited
7316 by appearances of the character @var{chr}. Note that an empty substring
7317 between separator characters will result in an empty string in the
7318 result list.
7319
7320 @lisp
7321 (string-split "root:x:0:0:root:/root:/bin/bash" #\:)
7322 @result{}
7323 ("root" "x" "0" "0" "root" "/root" "/bin/bash")
7324
7325 (string-split "::" #\:)
7326 @result{}
7327 ("" "" "")
7328
7329 (string-split "" #\:)
7330 @result{}
7331 ("")
7332 @end lisp
7333 @end deffn
7334
7335 \fstring-filter
7336 @c snarfed from srfi-13.c:3258
7337 @deffn {Scheme Procedure} string-filter s char_pred [start [end]]
7338 @deffnx {C Function} scm_string_filter (s, char_pred, start, end)
7339 Filter the string @var{s}, retaining only those characters that
7340 satisfy the @var{char_pred} argument. If the argument is a
7341 procedure, it is applied to each character as a predicate, if
7342 it is a character, it is tested for equality and if it is a
7343 character set, it is tested for membership.
7344 @end deffn
7345
7346 \fstring-delete
7347 @c snarfed from srfi-13.c:3330
7348 @deffn {Scheme Procedure} string-delete s char_pred [start [end]]
7349 @deffnx {C Function} scm_string_delete (s, char_pred, start, end)
7350 Filter the string @var{s}, retaining only those characters that
7351 do not satisfy the @var{char_pred} argument. If the argument
7352 is a procedure, it is applied to each character as a predicate,
7353 if it is a character, it is tested for equality and if it is a
7354 character set, it is tested for membership.
7355 @end deffn
7356
7357 \fchar-set?
7358 @c snarfed from srfi-14.c:85
7359 @deffn {Scheme Procedure} char-set? obj
7360 @deffnx {C Function} scm_char_set_p (obj)
7361 Return @code{#t} if @var{obj} is a character set, @code{#f}
7362 otherwise.
7363 @end deffn
7364
7365 \fchar-set=
7366 @c snarfed from srfi-14.c:95
7367 @deffn {Scheme Procedure} char-set= . char_sets
7368 @deffnx {C Function} scm_char_set_eq (char_sets)
7369 Return @code{#t} if all given character sets are equal.
7370 @end deffn
7371
7372 \fchar-set<=
7373 @c snarfed from srfi-14.c:125
7374 @deffn {Scheme Procedure} char-set<= . char_sets
7375 @deffnx {C Function} scm_char_set_leq (char_sets)
7376 Return @code{#t} if every character set @var{cs}i is a subset
7377 of character set @var{cs}i+1.
7378 @end deffn
7379
7380 \fchar-set-hash
7381 @c snarfed from srfi-14.c:163
7382 @deffn {Scheme Procedure} char-set-hash cs [bound]
7383 @deffnx {C Function} scm_char_set_hash (cs, bound)
7384 Compute a hash value for the character set @var{cs}. If
7385 @var{bound} is given and non-zero, it restricts the
7386 returned value to the range 0 @dots{} @var{bound - 1}.
7387 @end deffn
7388
7389 \fchar-set-cursor
7390 @c snarfed from srfi-14.c:196
7391 @deffn {Scheme Procedure} char-set-cursor cs
7392 @deffnx {C Function} scm_char_set_cursor (cs)
7393 Return a cursor into the character set @var{cs}.
7394 @end deffn
7395
7396 \fchar-set-ref
7397 @c snarfed from srfi-14.c:216
7398 @deffn {Scheme Procedure} char-set-ref cs cursor
7399 @deffnx {C Function} scm_char_set_ref (cs, cursor)
7400 Return the character at the current cursor position
7401 @var{cursor} in the character set @var{cs}. It is an error to
7402 pass a cursor for which @code{end-of-char-set?} returns true.
7403 @end deffn
7404
7405 \fchar-set-cursor-next
7406 @c snarfed from srfi-14.c:233
7407 @deffn {Scheme Procedure} char-set-cursor-next cs cursor
7408 @deffnx {C Function} scm_char_set_cursor_next (cs, cursor)
7409 Advance the character set cursor @var{cursor} to the next
7410 character in the character set @var{cs}. It is an error if the
7411 cursor given satisfies @code{end-of-char-set?}.
7412 @end deffn
7413
7414 \fend-of-char-set?
7415 @c snarfed from srfi-14.c:254
7416 @deffn {Scheme Procedure} end-of-char-set? cursor
7417 @deffnx {C Function} scm_end_of_char_set_p (cursor)
7418 Return @code{#t} if @var{cursor} has reached the end of a
7419 character set, @code{#f} otherwise.
7420 @end deffn
7421
7422 \fchar-set-fold
7423 @c snarfed from srfi-14.c:266
7424 @deffn {Scheme Procedure} char-set-fold kons knil cs
7425 @deffnx {C Function} scm_char_set_fold (kons, knil, cs)
7426 Fold the procedure @var{kons} over the character set @var{cs},
7427 initializing it with @var{knil}.
7428 @end deffn
7429
7430 \fchar-set-unfold
7431 @c snarfed from srfi-14.c:296
7432 @deffn {Scheme Procedure} char-set-unfold p f g seed [base_cs]
7433 @deffnx {C Function} scm_char_set_unfold (p, f, g, seed, base_cs)
7434 This is a fundamental constructor for character sets.
7435 @itemize @bullet
7436 @item @var{g} is used to generate a series of ``seed'' values
7437 from the initial seed: @var{seed}, (@var{g} @var{seed}),
7438 (@var{g}^2 @var{seed}), (@var{g}^3 @var{seed}), @dots{}
7439 @item @var{p} tells us when to stop -- when it returns true
7440 when applied to one of the seed values.
7441 @item @var{f} maps each seed value to a character. These
7442 characters are added to the base character set @var{base_cs} to
7443 form the result; @var{base_cs} defaults to the empty set.
7444 @end itemize
7445 @end deffn
7446
7447 \fchar-set-unfold!
7448 @c snarfed from srfi-14.c:340
7449 @deffn {Scheme Procedure} char-set-unfold! p f g seed base_cs
7450 @deffnx {C Function} scm_char_set_unfold_x (p, f, g, seed, base_cs)
7451 This is a fundamental constructor for character sets.
7452 @itemize @bullet
7453 @item @var{g} is used to generate a series of ``seed'' values
7454 from the initial seed: @var{seed}, (@var{g} @var{seed}),
7455 (@var{g}^2 @var{seed}), (@var{g}^3 @var{seed}), @dots{}
7456 @item @var{p} tells us when to stop -- when it returns true
7457 when applied to one of the seed values.
7458 @item @var{f} maps each seed value to a character. These
7459 characters are added to the base character set @var{base_cs} to
7460 form the result; @var{base_cs} defaults to the empty set.
7461 @end itemize
7462 @end deffn
7463
7464 \fchar-set-for-each
7465 @c snarfed from srfi-14.c:369
7466 @deffn {Scheme Procedure} char-set-for-each proc cs
7467 @deffnx {C Function} scm_char_set_for_each (proc, cs)
7468 Apply @var{proc} to every character in the character set
7469 @var{cs}. The return value is not specified.
7470 @end deffn
7471
7472 \fchar-set-map
7473 @c snarfed from srfi-14.c:388
7474 @deffn {Scheme Procedure} char-set-map proc cs
7475 @deffnx {C Function} scm_char_set_map (proc, cs)
7476 Map the procedure @var{proc} over every character in @var{cs}.
7477 @var{proc} must be a character -> character procedure.
7478 @end deffn
7479
7480 \fchar-set-copy
7481 @c snarfed from srfi-14.c:414
7482 @deffn {Scheme Procedure} char-set-copy cs
7483 @deffnx {C Function} scm_char_set_copy (cs)
7484 Return a newly allocated character set containing all
7485 characters in @var{cs}.
7486 @end deffn
7487
7488 \fchar-set
7489 @c snarfed from srfi-14.c:434
7490 @deffn {Scheme Procedure} char-set . rest
7491 @deffnx {C Function} scm_char_set (rest)
7492 Return a character set containing all given characters.
7493 @end deffn
7494
7495 \flist->char-set
7496 @c snarfed from srfi-14.c:462
7497 @deffn {Scheme Procedure} list->char-set list [base_cs]
7498 @deffnx {C Function} scm_list_to_char_set (list, base_cs)
7499 Convert the character list @var{list} to a character set. If
7500 the character set @var{base_cs} is given, the character in this
7501 set are also included in the result.
7502 @end deffn
7503
7504 \flist->char-set!
7505 @c snarfed from srfi-14.c:496
7506 @deffn {Scheme Procedure} list->char-set! list base_cs
7507 @deffnx {C Function} scm_list_to_char_set_x (list, base_cs)
7508 Convert the character list @var{list} to a character set. The
7509 characters are added to @var{base_cs} and @var{base_cs} is
7510 returned.
7511 @end deffn
7512
7513 \fstring->char-set
7514 @c snarfed from srfi-14.c:523
7515 @deffn {Scheme Procedure} string->char-set str [base_cs]
7516 @deffnx {C Function} scm_string_to_char_set (str, base_cs)
7517 Convert the string @var{str} to a character set. If the
7518 character set @var{base_cs} is given, the characters in this
7519 set are also included in the result.
7520 @end deffn
7521
7522 \fstring->char-set!
7523 @c snarfed from srfi-14.c:557
7524 @deffn {Scheme Procedure} string->char-set! str base_cs
7525 @deffnx {C Function} scm_string_to_char_set_x (str, base_cs)
7526 Convert the string @var{str} to a character set. The
7527 characters from the string are added to @var{base_cs}, and
7528 @var{base_cs} is returned.
7529 @end deffn
7530
7531 \fchar-set-filter
7532 @c snarfed from srfi-14.c:584
7533 @deffn {Scheme Procedure} char-set-filter pred cs [base_cs]
7534 @deffnx {C Function} scm_char_set_filter (pred, cs, base_cs)
7535 Return a character set containing every character from @var{cs}
7536 so that it satisfies @var{pred}. If provided, the characters
7537 from @var{base_cs} are added to the result.
7538 @end deffn
7539
7540 \fchar-set-filter!
7541 @c snarfed from srfi-14.c:620
7542 @deffn {Scheme Procedure} char-set-filter! pred cs base_cs
7543 @deffnx {C Function} scm_char_set_filter_x (pred, cs, base_cs)
7544 Return a character set containing every character from @var{cs}
7545 so that it satisfies @var{pred}. The characters are added to
7546 @var{base_cs} and @var{base_cs} is returned.
7547 @end deffn
7548
7549 \fucs-range->char-set
7550 @c snarfed from srfi-14.c:658
7551 @deffn {Scheme Procedure} ucs-range->char-set lower upper [error [base_cs]]
7552 @deffnx {C Function} scm_ucs_range_to_char_set (lower, upper, error, base_cs)
7553 Return a character set containing all characters whose
7554 character codes lie in the half-open range
7555 [@var{lower},@var{upper}).
7556
7557 If @var{error} is a true value, an error is signalled if the
7558 specified range contains characters which are not contained in
7559 the implemented character range. If @var{error} is @code{#f},
7560 these characters are silently left out of the resultung
7561 character set.
7562
7563 The characters in @var{base_cs} are added to the result, if
7564 given.
7565 @end deffn
7566
7567 \fucs-range->char-set!
7568 @c snarfed from srfi-14.c:711
7569 @deffn {Scheme Procedure} ucs-range->char-set! lower upper error base_cs
7570 @deffnx {C Function} scm_ucs_range_to_char_set_x (lower, upper, error, base_cs)
7571 Return a character set containing all characters whose
7572 character codes lie in the half-open range
7573 [@var{lower},@var{upper}).
7574
7575 If @var{error} is a true value, an error is signalled if the
7576 specified range contains characters which are not contained in
7577 the implemented character range. If @var{error} is @code{#f},
7578 these characters are silently left out of the resultung
7579 character set.
7580
7581 The characters are added to @var{base_cs} and @var{base_cs} is
7582 returned.
7583 @end deffn
7584
7585 \f->char-set
7586 @c snarfed from srfi-14.c:741
7587 @deffn {Scheme Procedure} ->char-set x
7588 @deffnx {C Function} scm_to_char_set (x)
7589 Coerces x into a char-set. @var{x} may be a string, character or char-set. A string is converted to the set of its constituent characters; a character is converted to a singleton set; a char-set is returned as-is.
7590 @end deffn
7591
7592 \fchar-set-size
7593 @c snarfed from srfi-14.c:757
7594 @deffn {Scheme Procedure} char-set-size cs
7595 @deffnx {C Function} scm_char_set_size (cs)
7596 Return the number of elements in character set @var{cs}.
7597 @end deffn
7598
7599 \fchar-set-count
7600 @c snarfed from srfi-14.c:774
7601 @deffn {Scheme Procedure} char-set-count pred cs
7602 @deffnx {C Function} scm_char_set_count (pred, cs)
7603 Return the number of the elements int the character set
7604 @var{cs} which satisfy the predicate @var{pred}.
7605 @end deffn
7606
7607 \fchar-set->list
7608 @c snarfed from srfi-14.c:797
7609 @deffn {Scheme Procedure} char-set->list cs
7610 @deffnx {C Function} scm_char_set_to_list (cs)
7611 Return a list containing the elements of the character set
7612 @var{cs}.
7613 @end deffn
7614
7615 \fchar-set->string
7616 @c snarfed from srfi-14.c:816
7617 @deffn {Scheme Procedure} char-set->string cs
7618 @deffnx {C Function} scm_char_set_to_string (cs)
7619 Return a string containing the elements of the character set
7620 @var{cs}. The order in which the characters are placed in the
7621 string is not defined.
7622 @end deffn
7623
7624 \fchar-set-contains?
7625 @c snarfed from srfi-14.c:841
7626 @deffn {Scheme Procedure} char-set-contains? cs ch
7627 @deffnx {C Function} scm_char_set_contains_p (cs, ch)
7628 Return @code{#t} iff the character @var{ch} is contained in the
7629 character set @var{cs}.
7630 @end deffn
7631
7632 \fchar-set-every
7633 @c snarfed from srfi-14.c:854
7634 @deffn {Scheme Procedure} char-set-every pred cs
7635 @deffnx {C Function} scm_char_set_every (pred, cs)
7636 Return a true value if every character in the character set
7637 @var{cs} satisfies the predicate @var{pred}.
7638 @end deffn
7639
7640 \fchar-set-any
7641 @c snarfed from srfi-14.c:878
7642 @deffn {Scheme Procedure} char-set-any pred cs
7643 @deffnx {C Function} scm_char_set_any (pred, cs)
7644 Return a true value if any character in the character set
7645 @var{cs} satisfies the predicate @var{pred}.
7646 @end deffn
7647
7648 \fchar-set-adjoin
7649 @c snarfed from srfi-14.c:901
7650 @deffn {Scheme Procedure} char-set-adjoin cs . rest
7651 @deffnx {C Function} scm_char_set_adjoin (cs, rest)
7652 Add all character arguments to the first argument, which must
7653 be a character set.
7654 @end deffn
7655
7656 \fchar-set-delete
7657 @c snarfed from srfi-14.c:929
7658 @deffn {Scheme Procedure} char-set-delete cs . rest
7659 @deffnx {C Function} scm_char_set_delete (cs, rest)
7660 Delete all character arguments from the first argument, which
7661 must be a character set.
7662 @end deffn
7663
7664 \fchar-set-adjoin!
7665 @c snarfed from srfi-14.c:957
7666 @deffn {Scheme Procedure} char-set-adjoin! cs . rest
7667 @deffnx {C Function} scm_char_set_adjoin_x (cs, rest)
7668 Add all character arguments to the first argument, which must
7669 be a character set.
7670 @end deffn
7671
7672 \fchar-set-delete!
7673 @c snarfed from srfi-14.c:984
7674 @deffn {Scheme Procedure} char-set-delete! cs . rest
7675 @deffnx {C Function} scm_char_set_delete_x (cs, rest)
7676 Delete all character arguments from the first argument, which
7677 must be a character set.
7678 @end deffn
7679
7680 \fchar-set-complement
7681 @c snarfed from srfi-14.c:1010
7682 @deffn {Scheme Procedure} char-set-complement cs
7683 @deffnx {C Function} scm_char_set_complement (cs)
7684 Return the complement of the character set @var{cs}.
7685 @end deffn
7686
7687 \fchar-set-union
7688 @c snarfed from srfi-14.c:1031
7689 @deffn {Scheme Procedure} char-set-union . rest
7690 @deffnx {C Function} scm_char_set_union (rest)
7691 Return the union of all argument character sets.
7692 @end deffn
7693
7694 \fchar-set-intersection
7695 @c snarfed from srfi-14.c:1060
7696 @deffn {Scheme Procedure} char-set-intersection . rest
7697 @deffnx {C Function} scm_char_set_intersection (rest)
7698 Return the intersection of all argument character sets.
7699 @end deffn
7700
7701 \fchar-set-difference
7702 @c snarfed from srfi-14.c:1100
7703 @deffn {Scheme Procedure} char-set-difference cs1 . rest
7704 @deffnx {C Function} scm_char_set_difference (cs1, rest)
7705 Return the difference of all argument character sets.
7706 @end deffn
7707
7708 \fchar-set-xor
7709 @c snarfed from srfi-14.c:1130
7710 @deffn {Scheme Procedure} char-set-xor . rest
7711 @deffnx {C Function} scm_char_set_xor (rest)
7712 Return the exclusive-or of all argument character sets.
7713 @end deffn
7714
7715 \fchar-set-diff+intersection
7716 @c snarfed from srfi-14.c:1171
7717 @deffn {Scheme Procedure} char-set-diff+intersection cs1 . rest
7718 @deffnx {C Function} scm_char_set_diff_plus_intersection (cs1, rest)
7719 Return the difference and the intersection of all argument
7720 character sets.
7721 @end deffn
7722
7723 \fchar-set-complement!
7724 @c snarfed from srfi-14.c:1209
7725 @deffn {Scheme Procedure} char-set-complement! cs
7726 @deffnx {C Function} scm_char_set_complement_x (cs)
7727 Return the complement of the character set @var{cs}.
7728 @end deffn
7729
7730 \fchar-set-union!
7731 @c snarfed from srfi-14.c:1226
7732 @deffn {Scheme Procedure} char-set-union! cs1 . rest
7733 @deffnx {C Function} scm_char_set_union_x (cs1, rest)
7734 Return the union of all argument character sets.
7735 @end deffn
7736
7737 \fchar-set-intersection!
7738 @c snarfed from srfi-14.c:1254
7739 @deffn {Scheme Procedure} char-set-intersection! cs1 . rest
7740 @deffnx {C Function} scm_char_set_intersection_x (cs1, rest)
7741 Return the intersection of all argument character sets.
7742 @end deffn
7743
7744 \fchar-set-difference!
7745 @c snarfed from srfi-14.c:1282
7746 @deffn {Scheme Procedure} char-set-difference! cs1 . rest
7747 @deffnx {C Function} scm_char_set_difference_x (cs1, rest)
7748 Return the difference of all argument character sets.
7749 @end deffn
7750
7751 \fchar-set-xor!
7752 @c snarfed from srfi-14.c:1310
7753 @deffn {Scheme Procedure} char-set-xor! cs1 . rest
7754 @deffnx {C Function} scm_char_set_xor_x (cs1, rest)
7755 Return the exclusive-or of all argument character sets.
7756 @end deffn
7757
7758 \fchar-set-diff+intersection!
7759 @c snarfed from srfi-14.c:1349
7760 @deffn {Scheme Procedure} char-set-diff+intersection! cs1 cs2 . rest
7761 @deffnx {C Function} scm_char_set_diff_plus_intersection_x (cs1, cs2, rest)
7762 Return the difference and the intersection of all argument
7763 character sets.
7764 @end deffn
7765
7766 \fstring=?
7767 @c snarfed from strorder.c:50
7768 @deffn {Scheme Procedure} string=? s1 s2
7769 Lexicographic equality predicate; return @code{#t} if the two
7770 strings are the same length and contain the same characters in
7771 the same positions, otherwise return @code{#f}.
7772
7773 The procedure @code{string-ci=?} treats upper and lower case
7774 letters as though they were the same character, but
7775 @code{string=?} treats upper and lower case as distinct
7776 characters.
7777 @end deffn
7778
7779 \fstring-ci=?
7780 @c snarfed from strorder.c:62
7781 @deffn {Scheme Procedure} string-ci=? s1 s2
7782 Case-insensitive string equality predicate; return @code{#t} if
7783 the two strings are the same length and their component
7784 characters match (ignoring case) at each position; otherwise
7785 return @code{#f}.
7786 @end deffn
7787
7788 \fstring<?
7789 @c snarfed from strorder.c:72
7790 @deffn {Scheme Procedure} string<? s1 s2
7791 Lexicographic ordering predicate; return @code{#t} if @var{s1}
7792 is lexicographically less than @var{s2}.
7793 @end deffn
7794
7795 \fstring<=?
7796 @c snarfed from strorder.c:82
7797 @deffn {Scheme Procedure} string<=? s1 s2
7798 Lexicographic ordering predicate; return @code{#t} if @var{s1}
7799 is lexicographically less than or equal to @var{s2}.
7800 @end deffn
7801
7802 \fstring>?
7803 @c snarfed from strorder.c:92
7804 @deffn {Scheme Procedure} string>? s1 s2
7805 Lexicographic ordering predicate; return @code{#t} if @var{s1}
7806 is lexicographically greater than @var{s2}.
7807 @end deffn
7808
7809 \fstring>=?
7810 @c snarfed from strorder.c:102
7811 @deffn {Scheme Procedure} string>=? s1 s2
7812 Lexicographic ordering predicate; return @code{#t} if @var{s1}
7813 is lexicographically greater than or equal to @var{s2}.
7814 @end deffn
7815
7816 \fstring-ci<?
7817 @c snarfed from strorder.c:113
7818 @deffn {Scheme Procedure} string-ci<? s1 s2
7819 Case insensitive lexicographic ordering predicate; return
7820 @code{#t} if @var{s1} is lexicographically less than @var{s2}
7821 regardless of case.
7822 @end deffn
7823
7824 \fstring-ci<=?
7825 @c snarfed from strorder.c:124
7826 @deffn {Scheme Procedure} string-ci<=? s1 s2
7827 Case insensitive lexicographic ordering predicate; return
7828 @code{#t} if @var{s1} is lexicographically less than or equal
7829 to @var{s2} regardless of case.
7830 @end deffn
7831
7832 \fstring-ci>?
7833 @c snarfed from strorder.c:135
7834 @deffn {Scheme Procedure} string-ci>? s1 s2
7835 Case insensitive lexicographic ordering predicate; return
7836 @code{#t} if @var{s1} is lexicographically greater than
7837 @var{s2} regardless of case.
7838 @end deffn
7839
7840 \fstring-ci>=?
7841 @c snarfed from strorder.c:146
7842 @deffn {Scheme Procedure} string-ci>=? s1 s2
7843 Case insensitive lexicographic ordering predicate; return
7844 @code{#t} if @var{s1} is lexicographically greater than or
7845 equal to @var{s2} regardless of case.
7846 @end deffn
7847
7848 \fobject->string
7849 @c snarfed from strports.c:332
7850 @deffn {Scheme Procedure} object->string obj [printer]
7851 @deffnx {C Function} scm_object_to_string (obj, printer)
7852 Return a Scheme string obtained by printing @var{obj}.
7853 Printing function can be specified by the optional second
7854 argument @var{printer} (default: @code{write}).
7855 @end deffn
7856
7857 \fcall-with-output-string
7858 @c snarfed from strports.c:356
7859 @deffn {Scheme Procedure} call-with-output-string proc
7860 @deffnx {C Function} scm_call_with_output_string (proc)
7861 Calls the one-argument procedure @var{proc} with a newly created output
7862 port. When the function returns, the string composed of the characters
7863 written into the port is returned.
7864 @end deffn
7865
7866 \fcall-with-input-string
7867 @c snarfed from strports.c:375
7868 @deffn {Scheme Procedure} call-with-input-string string proc
7869 @deffnx {C Function} scm_call_with_input_string (string, proc)
7870 Calls the one-argument procedure @var{proc} with a newly
7871 created input port from which @var{string}'s contents may be
7872 read. The value yielded by the @var{proc} is returned.
7873 @end deffn
7874
7875 \fopen-input-string
7876 @c snarfed from strports.c:388
7877 @deffn {Scheme Procedure} open-input-string str
7878 @deffnx {C Function} scm_open_input_string (str)
7879 Take a string and return an input port that delivers characters
7880 from the string. The port can be closed by
7881 @code{close-input-port}, though its storage will be reclaimed
7882 by the garbage collector if it becomes inaccessible.
7883 @end deffn
7884
7885 \fopen-output-string
7886 @c snarfed from strports.c:402
7887 @deffn {Scheme Procedure} open-output-string
7888 @deffnx {C Function} scm_open_output_string ()
7889 Return an output port that will accumulate characters for
7890 retrieval by @code{get-output-string}. The port can be closed
7891 by the procedure @code{close-output-port}, though its storage
7892 will be reclaimed by the garbage collector if it becomes
7893 inaccessible.
7894 @end deffn
7895
7896 \fget-output-string
7897 @c snarfed from strports.c:419
7898 @deffn {Scheme Procedure} get-output-string port
7899 @deffnx {C Function} scm_get_output_string (port)
7900 Given an output port created by @code{open-output-string},
7901 return a string consisting of the characters that have been
7902 output to the port so far.
7903 @end deffn
7904
7905 \feval-string
7906 @c snarfed from strports.c:488
7907 @deffn {Scheme Procedure} eval-string string [module]
7908 @deffnx {C Function} scm_eval_string_in_module (string, module)
7909 Evaluate @var{string} as the text representation of a Scheme
7910 form or forms, and return whatever value they produce.
7911 Evaluation takes place in the given module, or the current
7912 module when no module is given.
7913 While the code is evaluated, the given module is made the
7914 current one. The current module is restored when this
7915 procedure returns.
7916 @end deffn
7917
7918 \fmake-struct-layout
7919 @c snarfed from struct.c:56
7920 @deffn {Scheme Procedure} make-struct-layout fields
7921 @deffnx {C Function} scm_make_struct_layout (fields)
7922 Return a new structure layout object.
7923
7924 @var{fields} must be a string made up of pairs of characters
7925 strung together. The first character of each pair describes a field
7926 type, the second a field protection. Allowed types are 'p' for
7927 GC-protected Scheme data, 'u' for unprotected binary data, and 's' for
7928 a field that points to the structure itself. Allowed protections
7929 are 'w' for mutable fields, 'r' for read-only fields, and 'o' for opaque
7930 fields. The last field protection specification may be capitalized to
7931 indicate that the field is a tail-array.
7932 @end deffn
7933
7934 \fstruct?
7935 @c snarfed from struct.c:223
7936 @deffn {Scheme Procedure} struct? x
7937 @deffnx {C Function} scm_struct_p (x)
7938 Return @code{#t} iff @var{x} is a structure object, else
7939 @code{#f}.
7940 @end deffn
7941
7942 \fstruct-vtable?
7943 @c snarfed from struct.c:232
7944 @deffn {Scheme Procedure} struct-vtable? x
7945 @deffnx {C Function} scm_struct_vtable_p (x)
7946 Return @code{#t} iff @var{x} is a vtable structure.
7947 @end deffn
7948
7949 \fmake-struct
7950 @c snarfed from struct.c:418
7951 @deffn {Scheme Procedure} make-struct vtable tail_array_size . init
7952 @deffnx {C Function} scm_make_struct (vtable, tail_array_size, init)
7953 Create a new structure.
7954
7955 @var{type} must be a vtable structure (@pxref{Vtables}).
7956
7957 @var{tail-elts} must be a non-negative integer. If the layout
7958 specification indicated by @var{type} includes a tail-array,
7959 this is the number of elements allocated to that array.
7960
7961 The @var{init1}, @dots{} are optional arguments describing how
7962 successive fields of the structure should be initialized. Only fields
7963 with protection 'r' or 'w' can be initialized, except for fields of
7964 type 's', which are automatically initialized to point to the new
7965 structure itself; fields with protection 'o' can not be initialized by
7966 Scheme programs.
7967
7968 If fewer optional arguments than initializable fields are supplied,
7969 fields of type 'p' get default value #f while fields of type 'u' are
7970 initialized to 0.
7971
7972 Structs are currently the basic representation for record-like data
7973 structures in Guile. The plan is to eventually replace them with a
7974 new representation which will at the same time be easier to use and
7975 more powerful.
7976
7977 For more information, see the documentation for @code{make-vtable-vtable}.
7978 @end deffn
7979
7980 \fmake-vtable-vtable
7981 @c snarfed from struct.c:502
7982 @deffn {Scheme Procedure} make-vtable-vtable user_fields tail_array_size . init
7983 @deffnx {C Function} scm_make_vtable_vtable (user_fields, tail_array_size, init)
7984 Return a new, self-describing vtable structure.
7985
7986 @var{user-fields} is a string describing user defined fields of the
7987 vtable beginning at index @code{vtable-offset-user}
7988 (see @code{make-struct-layout}).
7989
7990 @var{tail-size} specifies the size of the tail-array (if any) of
7991 this vtable.
7992
7993 @var{init1}, @dots{} are the optional initializers for the fields of
7994 the vtable.
7995
7996 Vtables have one initializable system field---the struct printer.
7997 This field comes before the user fields in the initializers passed
7998 to @code{make-vtable-vtable} and @code{make-struct}, and thus works as
7999 a third optional argument to @code{make-vtable-vtable} and a fourth to
8000 @code{make-struct} when creating vtables:
8001
8002 If the value is a procedure, it will be called instead of the standard
8003 printer whenever a struct described by this vtable is printed.
8004 The procedure will be called with arguments STRUCT and PORT.
8005
8006 The structure of a struct is described by a vtable, so the vtable is
8007 in essence the type of the struct. The vtable is itself a struct with
8008 a vtable. This could go on forever if it weren't for the
8009 vtable-vtables which are self-describing vtables, and thus terminate
8010 the chain.
8011
8012 There are several potential ways of using structs, but the standard
8013 one is to use three kinds of structs, together building up a type
8014 sub-system: one vtable-vtable working as the root and one or several
8015 "types", each with a set of "instances". (The vtable-vtable should be
8016 compared to the class <class> which is the class of itself.)
8017
8018 @lisp
8019 (define ball-root (make-vtable-vtable "pr" 0))
8020
8021 (define (make-ball-type ball-color)
8022 (make-struct ball-root 0
8023 (make-struct-layout "pw")
8024 (lambda (ball port)
8025 (format port "#<a ~A ball owned by ~A>"
8026 (color ball)
8027 (owner ball)))
8028 ball-color))
8029 (define (color ball) (struct-ref (struct-vtable ball) vtable-offset-user))
8030 (define (owner ball) (struct-ref ball 0))
8031
8032 (define red (make-ball-type 'red))
8033 (define green (make-ball-type 'green))
8034
8035 (define (make-ball type owner) (make-struct type 0 owner))
8036
8037 (define ball (make-ball green 'Nisse))
8038 ball @result{} #<a green ball owned by Nisse>
8039 @end lisp
8040 @end deffn
8041
8042 \fstruct-ref
8043 @c snarfed from struct.c:542
8044 @deffn {Scheme Procedure} struct-ref handle pos
8045 @deffnx {Scheme Procedure} struct-set! struct n value
8046 @deffnx {C Function} scm_struct_ref (handle, pos)
8047 Access (or modify) the @var{n}th field of @var{struct}.
8048
8049 If the field is of type 'p', then it can be set to an arbitrary value.
8050
8051 If the field is of type 'u', then it can only be set to a non-negative
8052 integer value small enough to fit in one machine word.
8053 @end deffn
8054
8055 \fstruct-set!
8056 @c snarfed from struct.c:621
8057 @deffn {Scheme Procedure} struct-set! handle pos val
8058 @deffnx {C Function} scm_struct_set_x (handle, pos, val)
8059 Set the slot of the structure @var{handle} with index @var{pos}
8060 to @var{val}. Signal an error if the slot can not be written
8061 to.
8062 @end deffn
8063
8064 \fstruct-vtable
8065 @c snarfed from struct.c:692
8066 @deffn {Scheme Procedure} struct-vtable handle
8067 @deffnx {C Function} scm_struct_vtable (handle)
8068 Return the vtable structure that describes the type of @var{struct}.
8069 @end deffn
8070
8071 \fstruct-vtable-tag
8072 @c snarfed from struct.c:703
8073 @deffn {Scheme Procedure} struct-vtable-tag handle
8074 @deffnx {C Function} scm_struct_vtable_tag (handle)
8075 Return the vtable tag of the structure @var{handle}.
8076 @end deffn
8077
8078 \fstruct-vtable-name
8079 @c snarfed from struct.c:742
8080 @deffn {Scheme Procedure} struct-vtable-name vtable
8081 @deffnx {C Function} scm_struct_vtable_name (vtable)
8082 Return the name of the vtable @var{vtable}.
8083 @end deffn
8084
8085 \fset-struct-vtable-name!
8086 @c snarfed from struct.c:752
8087 @deffn {Scheme Procedure} set-struct-vtable-name! vtable name
8088 @deffnx {C Function} scm_set_struct_vtable_name_x (vtable, name)
8089 Set the name of the vtable @var{vtable} to @var{name}.
8090 @end deffn
8091
8092 \fsymbol?
8093 @c snarfed from symbols.c:156
8094 @deffn {Scheme Procedure} symbol? obj
8095 @deffnx {C Function} scm_symbol_p (obj)
8096 Return @code{#t} if @var{obj} is a symbol, otherwise return
8097 @code{#f}.
8098 @end deffn
8099
8100 \fsymbol-interned?
8101 @c snarfed from symbols.c:166
8102 @deffn {Scheme Procedure} symbol-interned? symbol
8103 @deffnx {C Function} scm_symbol_interned_p (symbol)
8104 Return @code{#t} if @var{symbol} is interned, otherwise return
8105 @code{#f}.
8106 @end deffn
8107
8108 \fmake-symbol
8109 @c snarfed from symbols.c:178
8110 @deffn {Scheme Procedure} make-symbol name
8111 @deffnx {C Function} scm_make_symbol (name)
8112 Return a new uninterned symbol with the name @var{name}. The returned symbol is guaranteed to be unique and future calls to @code{string->symbol} will not return it.
8113 @end deffn
8114
8115 \fsymbol->string
8116 @c snarfed from symbols.c:210
8117 @deffn {Scheme Procedure} symbol->string s
8118 @deffnx {C Function} scm_symbol_to_string (s)
8119 Return the name of @var{symbol} as a string. If the symbol was
8120 part of an object returned as the value of a literal expression
8121 (section @pxref{Literal expressions,,,r5rs, The Revised^5
8122 Report on Scheme}) or by a call to the @code{read} procedure,
8123 and its name contains alphabetic characters, then the string
8124 returned will contain characters in the implementation's
8125 preferred standard case---some implementations will prefer
8126 upper case, others lower case. If the symbol was returned by
8127 @code{string->symbol}, the case of characters in the string
8128 returned will be the same as the case in the string that was
8129 passed to @code{string->symbol}. It is an error to apply
8130 mutation procedures like @code{string-set!} to strings returned
8131 by this procedure.
8132
8133 The following examples assume that the implementation's
8134 standard case is lower case:
8135
8136 @lisp
8137 (symbol->string 'flying-fish) @result{} "flying-fish"
8138 (symbol->string 'Martin) @result{} "martin"
8139 (symbol->string
8140 (string->symbol "Malvina")) @result{} "Malvina"
8141 @end lisp
8142 @end deffn
8143
8144 \fstring->symbol
8145 @c snarfed from symbols.c:240
8146 @deffn {Scheme Procedure} string->symbol string
8147 @deffnx {C Function} scm_string_to_symbol (string)
8148 Return the symbol whose name is @var{string}. This procedure
8149 can create symbols with names containing special characters or
8150 letters in the non-standard case, but it is usually a bad idea
8151 to create such symbols because in some implementations of
8152 Scheme they cannot be read as themselves. See
8153 @code{symbol->string}.
8154
8155 The following examples assume that the implementation's
8156 standard case is lower case:
8157
8158 @lisp
8159 (eq? 'mISSISSIppi 'mississippi) @result{} #t
8160 (string->symbol "mISSISSIppi") @result{} @r{the symbol with name "mISSISSIppi"}
8161 (eq? 'bitBlt (string->symbol "bitBlt")) @result{} #f
8162 (eq? 'JollyWog
8163 (string->symbol (symbol->string 'JollyWog))) @result{} #t
8164 (string=? "K. Harper, M.D."
8165 (symbol->string
8166 (string->symbol "K. Harper, M.D."))) @result{}#t
8167 @end lisp
8168 @end deffn
8169
8170 \fstring-ci->symbol
8171 @c snarfed from symbols.c:252
8172 @deffn {Scheme Procedure} string-ci->symbol str
8173 @deffnx {C Function} scm_string_ci_to_symbol (str)
8174 Return the symbol whose name is @var{str}. @var{str} is
8175 converted to lowercase before the conversion is done, if Guile
8176 is currently reading symbols case-insensitively.
8177 @end deffn
8178
8179 \fgensym
8180 @c snarfed from symbols.c:269
8181 @deffn {Scheme Procedure} gensym [prefix]
8182 @deffnx {C Function} scm_gensym (prefix)
8183 Create a new symbol with a name constructed from a prefix and
8184 a counter value. The string @var{prefix} can be specified as
8185 an optional argument. Default prefix is @code{ g}. The counter
8186 is increased by 1 at each call. There is no provision for
8187 resetting the counter.
8188 @end deffn
8189
8190 \fsymbol-hash
8191 @c snarfed from symbols.c:295
8192 @deffn {Scheme Procedure} symbol-hash symbol
8193 @deffnx {C Function} scm_symbol_hash (symbol)
8194 Return a hash value for @var{symbol}.
8195 @end deffn
8196
8197 \fsymbol-fref
8198 @c snarfed from symbols.c:305
8199 @deffn {Scheme Procedure} symbol-fref s
8200 @deffnx {C Function} scm_symbol_fref (s)
8201 Return the contents of @var{symbol}'s @dfn{function slot}.
8202 @end deffn
8203
8204 \fsymbol-pref
8205 @c snarfed from symbols.c:316
8206 @deffn {Scheme Procedure} symbol-pref s
8207 @deffnx {C Function} scm_symbol_pref (s)
8208 Return the @dfn{property list} currently associated with @var{symbol}.
8209 @end deffn
8210
8211 \fsymbol-fset!
8212 @c snarfed from symbols.c:327
8213 @deffn {Scheme Procedure} symbol-fset! s val
8214 @deffnx {C Function} scm_symbol_fset_x (s, val)
8215 Change the binding of @var{symbol}'s function slot.
8216 @end deffn
8217
8218 \fsymbol-pset!
8219 @c snarfed from symbols.c:339
8220 @deffn {Scheme Procedure} symbol-pset! s val
8221 @deffnx {C Function} scm_symbol_pset_x (s, val)
8222 Change the binding of @var{symbol}'s property slot.
8223 @end deffn
8224
8225 \fcall-with-new-thread
8226 @c snarfed from threads.c:611
8227 @deffn {Scheme Procedure} call-with-new-thread thunk [handler]
8228 @deffnx {C Function} scm_call_with_new_thread (thunk, handler)
8229 Call @code{thunk} in a new thread and with a new dynamic state,
8230 returning a new thread object representing the thread. The procedure
8231 @var{thunk} is called via @code{with-continuation-barrier}.
8232
8233 When @var{handler} is specified, then @var{thunk} is called from
8234 within a @code{catch} with tag @code{#t} that has @var{handler} as its
8235 handler. This catch is established inside the continuation barrier.
8236
8237 Once @var{thunk} or @var{handler} returns, the return value is made
8238 the @emph{exit value} of the thread and the thread is terminated.
8239 @end deffn
8240
8241 \fyield
8242 @c snarfed from threads.c:722
8243 @deffn {Scheme Procedure} yield
8244 @deffnx {C Function} scm_yield ()
8245 Move the calling thread to the end of the scheduling queue.
8246 @end deffn
8247
8248 \fjoin-thread
8249 @c snarfed from threads.c:732
8250 @deffn {Scheme Procedure} join-thread thread
8251 @deffnx {C Function} scm_join_thread (thread)
8252 Suspend execution of the calling thread until the target @var{thread} terminates, unless the target @var{thread} has already terminated.
8253 @end deffn
8254
8255 \fmake-mutex
8256 @c snarfed from threads.c:828
8257 @deffn {Scheme Procedure} make-mutex
8258 @deffnx {C Function} scm_make_mutex ()
8259 Create a new mutex.
8260 @end deffn
8261
8262 \fmake-recursive-mutex
8263 @c snarfed from threads.c:837
8264 @deffn {Scheme Procedure} make-recursive-mutex
8265 @deffnx {C Function} scm_make_recursive_mutex ()
8266 Create a new recursive mutex.
8267 @end deffn
8268
8269 \flock-mutex
8270 @c snarfed from threads.c:883
8271 @deffn {Scheme Procedure} lock-mutex mx
8272 @deffnx {C Function} scm_lock_mutex (mx)
8273 Lock @var{mutex}. If the mutex is already locked, the calling thread blocks until the mutex becomes available. The function returns when the calling thread owns the lock on @var{mutex}. Locking a mutex that a thread already owns will succeed right away and will not block the thread. That is, Guile's mutexes are @emph{recursive}.
8274 @end deffn
8275
8276 \ftry-mutex
8277 @c snarfed from threads.c:931
8278 @deffn {Scheme Procedure} try-mutex mutex
8279 @deffnx {C Function} scm_try_mutex (mutex)
8280 Try to lock @var{mutex}. If the mutex is already locked by someone else, return @code{#f}. Else lock the mutex and return @code{#t}.
8281 @end deffn
8282
8283 \funlock-mutex
8284 @c snarfed from threads.c:976
8285 @deffn {Scheme Procedure} unlock-mutex mx
8286 @deffnx {C Function} scm_unlock_mutex (mx)
8287 Unlocks @var{mutex} if the calling thread owns the lock on @var{mutex}. Calling unlock-mutex on a mutex not owned by the current thread results in undefined behaviour. Once a mutex has been unlocked, one thread blocked on @var{mutex} is awakened and grabs the mutex lock. Every call to @code{lock-mutex} by this thread must be matched with a call to @code{unlock-mutex}. Only the last call to @code{unlock-mutex} will actually unlock the mutex.
8288 @end deffn
8289
8290 \fmake-condition-variable
8291 @c snarfed from threads.c:1052
8292 @deffn {Scheme Procedure} make-condition-variable
8293 @deffnx {C Function} scm_make_condition_variable ()
8294 Make a new condition variable.
8295 @end deffn
8296
8297 \fwait-condition-variable
8298 @c snarfed from threads.c:1120
8299 @deffn {Scheme Procedure} wait-condition-variable cv mx [t]
8300 @deffnx {C Function} scm_timed_wait_condition_variable (cv, mx, t)
8301 Wait until @var{cond-var} has been signalled. While waiting, @var{mutex} is atomically unlocked (as with @code{unlock-mutex}) and is locked again when this function returns. When @var{time} is given, it specifies a point in time where the waiting should be aborted. It can be either a integer as returned by @code{current-time} or a pair as returned by @code{gettimeofday}. When the waiting is aborted the mutex is locked and @code{#f} is returned. When the condition variable is in fact signalled, the mutex is also locked and @code{#t} is returned.
8302 @end deffn
8303
8304 \fsignal-condition-variable
8305 @c snarfed from threads.c:1157
8306 @deffn {Scheme Procedure} signal-condition-variable cv
8307 @deffnx {C Function} scm_signal_condition_variable (cv)
8308 Wake up one thread that is waiting for @var{cv}
8309 @end deffn
8310
8311 \fbroadcast-condition-variable
8312 @c snarfed from threads.c:1177
8313 @deffn {Scheme Procedure} broadcast-condition-variable cv
8314 @deffnx {C Function} scm_broadcast_condition_variable (cv)
8315 Wake up all threads that are waiting for @var{cv}.
8316 @end deffn
8317
8318 \fcurrent-thread
8319 @c snarfed from threads.c:1354
8320 @deffn {Scheme Procedure} current-thread
8321 @deffnx {C Function} scm_current_thread ()
8322 Return the thread that called this function.
8323 @end deffn
8324
8325 \fall-threads
8326 @c snarfed from threads.c:1372
8327 @deffn {Scheme Procedure} all-threads
8328 @deffnx {C Function} scm_all_threads ()
8329 Return a list of all threads.
8330 @end deffn
8331
8332 \fthread-exited?
8333 @c snarfed from threads.c:1398
8334 @deffn {Scheme Procedure} thread-exited? thread
8335 @deffnx {C Function} scm_thread_exited_p (thread)
8336 Return @code{#t} iff @var{thread} has exited.
8337
8338 @end deffn
8339
8340 \fcatch
8341 @c snarfed from throw.c:512
8342 @deffn {Scheme Procedure} catch key thunk handler
8343 @deffnx {C Function} scm_catch (key, thunk, handler)
8344 Invoke @var{thunk} in the dynamic context of @var{handler} for
8345 exceptions matching @var{key}. If thunk throws to the symbol
8346 @var{key}, then @var{handler} is invoked this way:
8347 @lisp
8348 (handler key args ...)
8349 @end lisp
8350
8351 @var{key} is a symbol or @code{#t}.
8352
8353 @var{thunk} takes no arguments. If @var{thunk} returns
8354 normally, that is the return value of @code{catch}.
8355
8356 Handler is invoked outside the scope of its own @code{catch}.
8357 If @var{handler} again throws to the same key, a new handler
8358 from further up the call chain is invoked.
8359
8360 If the key is @code{#t}, then a throw to @emph{any} symbol will
8361 match this call to @code{catch}.
8362 @end deffn
8363
8364 \flazy-catch
8365 @c snarfed from throw.c:540
8366 @deffn {Scheme Procedure} lazy-catch key thunk handler
8367 @deffnx {C Function} scm_lazy_catch (key, thunk, handler)
8368 This behaves exactly like @code{catch}, except that it does
8369 not unwind the stack before invoking @var{handler}.
8370 The @var{handler} procedure is not allowed to return:
8371 it must throw to another catch, or otherwise exit non-locally.
8372 @end deffn
8373
8374 \fthrow
8375 @c snarfed from throw.c:573
8376 @deffn {Scheme Procedure} throw key . args
8377 @deffnx {C Function} scm_throw (key, args)
8378 Invoke the catch form matching @var{key}, passing @var{args} to the
8379 @var{handler}.
8380
8381 @var{key} is a symbol. It will match catches of the same symbol or of
8382 @code{#t}.
8383
8384 If there is no handler at all, Guile prints an error and then exits.
8385 @end deffn
8386
8387 \fvalues
8388 @c snarfed from values.c:53
8389 @deffn {Scheme Procedure} values . args
8390 @deffnx {C Function} scm_values (args)
8391 Delivers all of its arguments to its continuation. Except for
8392 continuations created by the @code{call-with-values} procedure,
8393 all continuations take exactly one value. The effect of
8394 passing no value or more than one value to continuations that
8395 were not created by @code{call-with-values} is unspecified.
8396 @end deffn
8397
8398 \fmake-variable
8399 @c snarfed from variable.c:52
8400 @deffn {Scheme Procedure} make-variable init
8401 @deffnx {C Function} scm_make_variable (init)
8402 Return a variable initialized to value @var{init}.
8403 @end deffn
8404
8405 \fmake-undefined-variable
8406 @c snarfed from variable.c:62
8407 @deffn {Scheme Procedure} make-undefined-variable
8408 @deffnx {C Function} scm_make_undefined_variable ()
8409 Return a variable that is initially unbound.
8410 @end deffn
8411
8412 \fvariable?
8413 @c snarfed from variable.c:73
8414 @deffn {Scheme Procedure} variable? obj
8415 @deffnx {C Function} scm_variable_p (obj)
8416 Return @code{#t} iff @var{obj} is a variable object, else
8417 return @code{#f}.
8418 @end deffn
8419
8420 \fvariable-ref
8421 @c snarfed from variable.c:85
8422 @deffn {Scheme Procedure} variable-ref var
8423 @deffnx {C Function} scm_variable_ref (var)
8424 Dereference @var{var} and return its value.
8425 @var{var} must be a variable object; see @code{make-variable}
8426 and @code{make-undefined-variable}.
8427 @end deffn
8428
8429 \fvariable-set!
8430 @c snarfed from variable.c:101
8431 @deffn {Scheme Procedure} variable-set! var val
8432 @deffnx {C Function} scm_variable_set_x (var, val)
8433 Set the value of the variable @var{var} to @var{val}.
8434 @var{var} must be a variable object, @var{val} can be any
8435 value. Return an unspecified value.
8436 @end deffn
8437
8438 \fvariable-bound?
8439 @c snarfed from variable.c:113
8440 @deffn {Scheme Procedure} variable-bound? var
8441 @deffnx {C Function} scm_variable_bound_p (var)
8442 Return @code{#t} iff @var{var} is bound to a value.
8443 Throws an error if @var{var} is not a variable object.
8444 @end deffn
8445
8446 \fvector?
8447 @c snarfed from vectors.c:91
8448 @deffn {Scheme Procedure} vector? obj
8449 @deffnx {C Function} scm_vector_p (obj)
8450 Return @code{#t} if @var{obj} is a vector, otherwise return
8451 @code{#f}.
8452 @end deffn
8453
8454 \flist->vector
8455 @c snarfed from vectors.c:123
8456 @deffn {Scheme Procedure} list->vector
8457 implemented by the C function "scm_vector"
8458 @end deffn
8459
8460 \fvector
8461 @c snarfed from vectors.c:140
8462 @deffn {Scheme Procedure} vector . l
8463 @deffnx {Scheme Procedure} list->vector l
8464 @deffnx {C Function} scm_vector (l)
8465 Return a newly allocated vector composed of the
8466 given arguments. Analogous to @code{list}.
8467
8468 @lisp
8469 (vector 'a 'b 'c) @result{} #(a b c)
8470 @end lisp
8471 @end deffn
8472
8473 \fmake-vector
8474 @c snarfed from vectors.c:276
8475 @deffn {Scheme Procedure} make-vector k [fill]
8476 @deffnx {C Function} scm_make_vector (k, fill)
8477 Return a newly allocated vector of @var{k} elements. If a
8478 second argument is given, then each position is initialized to
8479 @var{fill}. Otherwise the initial contents of each position is
8480 unspecified.
8481 @end deffn
8482
8483 \fvector-copy
8484 @c snarfed from vectors.c:318
8485 @deffn {Scheme Procedure} vector-copy vec
8486 @deffnx {C Function} scm_vector_copy (vec)
8487 Return a copy of @var{vec}.
8488 @end deffn
8489
8490 \fvector->list
8491 @c snarfed from vectors.c:389
8492 @deffn {Scheme Procedure} vector->list v
8493 @deffnx {C Function} scm_vector_to_list (v)
8494 Return a newly allocated list composed of the elements of @var{v}.
8495
8496 @lisp
8497 (vector->list '#(dah dah didah)) @result{} (dah dah didah)
8498 (list->vector '(dididit dah)) @result{} #(dididit dah)
8499 @end lisp
8500 @end deffn
8501
8502 \fvector-fill!
8503 @c snarfed from vectors.c:413
8504 @deffn {Scheme Procedure} vector-fill! v fill
8505 @deffnx {C Function} scm_vector_fill_x (v, fill)
8506 Store @var{fill} in every position of @var{vector}. The value
8507 returned by @code{vector-fill!} is unspecified.
8508 @end deffn
8509
8510 \fvector-move-left!
8511 @c snarfed from vectors.c:450
8512 @deffn {Scheme Procedure} vector-move-left! vec1 start1 end1 vec2 start2
8513 @deffnx {C Function} scm_vector_move_left_x (vec1, start1, end1, vec2, start2)
8514 Copy elements from @var{vec1}, positions @var{start1} to @var{end1},
8515 to @var{vec2} starting at position @var{start2}. @var{start1} and
8516 @var{start2} are inclusive indices; @var{end1} is exclusive.
8517
8518 @code{vector-move-left!} copies elements in leftmost order.
8519 Therefore, in the case where @var{vec1} and @var{vec2} refer to the
8520 same vector, @code{vector-move-left!} is usually appropriate when
8521 @var{start1} is greater than @var{start2}.
8522 @end deffn
8523
8524 \fvector-move-right!
8525 @c snarfed from vectors.c:488
8526 @deffn {Scheme Procedure} vector-move-right! vec1 start1 end1 vec2 start2
8527 @deffnx {C Function} scm_vector_move_right_x (vec1, start1, end1, vec2, start2)
8528 Copy elements from @var{vec1}, positions @var{start1} to @var{end1},
8529 to @var{vec2} starting at position @var{start2}. @var{start1} and
8530 @var{start2} are inclusive indices; @var{end1} is exclusive.
8531
8532 @code{vector-move-right!} copies elements in rightmost order.
8533 Therefore, in the case where @var{vec1} and @var{vec2} refer to the
8534 same vector, @code{vector-move-right!} is usually appropriate when
8535 @var{start1} is less than @var{start2}.
8536 @end deffn
8537
8538 \fgeneralized-vector?
8539 @c snarfed from vectors.c:537
8540 @deffn {Scheme Procedure} generalized-vector? obj
8541 @deffnx {C Function} scm_generalized_vector_p (obj)
8542 Return @code{#t} if @var{obj} is a vector, string,
8543 bitvector, or uniform numeric vector.
8544 @end deffn
8545
8546 \fgeneralized-vector-length
8547 @c snarfed from vectors.c:569
8548 @deffn {Scheme Procedure} generalized-vector-length v
8549 @deffnx {C Function} scm_generalized_vector_length (v)
8550 Return the length of the generalized vector @var{v}.
8551 @end deffn
8552
8553 \fgeneralized-vector-ref
8554 @c snarfed from vectors.c:594
8555 @deffn {Scheme Procedure} generalized-vector-ref v idx
8556 @deffnx {C Function} scm_generalized_vector_ref (v, idx)
8557 Return the element at index @var{idx} of the
8558 generalized vector @var{v}.
8559 @end deffn
8560
8561 \fgeneralized-vector-set!
8562 @c snarfed from vectors.c:619
8563 @deffn {Scheme Procedure} generalized-vector-set! v idx val
8564 @deffnx {C Function} scm_generalized_vector_set_x (v, idx, val)
8565 Set the element at index @var{idx} of the
8566 generalized vector @var{v} to @var{val}.
8567 @end deffn
8568
8569 \fgeneralized-vector->list
8570 @c snarfed from vectors.c:630
8571 @deffn {Scheme Procedure} generalized-vector->list v
8572 @deffnx {C Function} scm_generalized_vector_to_list (v)
8573 Return a new list whose elements are the elements of the
8574 generalized vector @var{v}.
8575 @end deffn
8576
8577 \fmajor-version
8578 @c snarfed from version.c:35
8579 @deffn {Scheme Procedure} major-version
8580 @deffnx {C Function} scm_major_version ()
8581 Return a string containing Guile's major version number.
8582 E.g., the 1 in "1.6.5".
8583 @end deffn
8584
8585 \fminor-version
8586 @c snarfed from version.c:48
8587 @deffn {Scheme Procedure} minor-version
8588 @deffnx {C Function} scm_minor_version ()
8589 Return a string containing Guile's minor version number.
8590 E.g., the 6 in "1.6.5".
8591 @end deffn
8592
8593 \fmicro-version
8594 @c snarfed from version.c:61
8595 @deffn {Scheme Procedure} micro-version
8596 @deffnx {C Function} scm_micro_version ()
8597 Return a string containing Guile's micro version number.
8598 E.g., the 5 in "1.6.5".
8599 @end deffn
8600
8601 \fversion
8602 @c snarfed from version.c:83
8603 @deffn {Scheme Procedure} version
8604 @deffnx {Scheme Procedure} major-version
8605 @deffnx {Scheme Procedure} minor-version
8606 @deffnx {Scheme Procedure} micro-version
8607 @deffnx {C Function} scm_version ()
8608 Return a string describing Guile's version number, or its major, minor
8609 or micro version number, respectively.
8610
8611 @lisp
8612 (version) @result{} "1.6.0"
8613 (major-version) @result{} "1"
8614 (minor-version) @result{} "6"
8615 (micro-version) @result{} "0"
8616 @end lisp
8617 @end deffn
8618
8619 \feffective-version
8620 @c snarfed from version.c:113
8621 @deffn {Scheme Procedure} effective-version
8622 @deffnx {C Function} scm_effective_version ()
8623 Return a string describing Guile's effective version number.
8624 @lisp
8625 (version) @result{} "1.6.0"
8626 (effective-version) @result{} "1.6"
8627 (major-version) @result{} "1"
8628 (minor-version) @result{} "6"
8629 (micro-version) @result{} "0"
8630 @end lisp
8631 @end deffn
8632
8633 \fmake-soft-port
8634 @c snarfed from vports.c:185
8635 @deffn {Scheme Procedure} make-soft-port pv modes
8636 @deffnx {C Function} scm_make_soft_port (pv, modes)
8637 Return a port capable of receiving or delivering characters as
8638 specified by the @var{modes} string (@pxref{File Ports,
8639 open-file}). @var{pv} must be a vector of length 5 or 6. Its
8640 components are as follows:
8641
8642 @enumerate 0
8643 @item
8644 procedure accepting one character for output
8645 @item
8646 procedure accepting a string for output
8647 @item
8648 thunk for flushing output
8649 @item
8650 thunk for getting one character
8651 @item
8652 thunk for closing port (not by garbage collection)
8653 @item
8654 (if present and not @code{#f}) thunk for computing the number of
8655 characters that can be read from the port without blocking.
8656 @end enumerate
8657
8658 For an output-only port only elements 0, 1, 2, and 4 need be
8659 procedures. For an input-only port only elements 3 and 4 need
8660 be procedures. Thunks 2 and 4 can instead be @code{#f} if
8661 there is no useful operation for them to perform.
8662
8663 If thunk 3 returns @code{#f} or an @code{eof-object}
8664 (@pxref{Input, eof-object?, ,r5rs, The Revised^5 Report on
8665 Scheme}) it indicates that the port has reached end-of-file.
8666 For example:
8667
8668 @lisp
8669 (define stdout (current-output-port))
8670 (define p (make-soft-port
8671 (vector
8672 (lambda (c) (write c stdout))
8673 (lambda (s) (display s stdout))
8674 (lambda () (display "." stdout))
8675 (lambda () (char-upcase (read-char)))
8676 (lambda () (display "@@" stdout)))
8677 "rw"))
8678
8679 (write p p) @result{} #<input-output: soft 8081e20>
8680 @end lisp
8681 @end deffn
8682
8683 \fmake-weak-vector
8684 @c snarfed from weaks.c:74
8685 @deffn {Scheme Procedure} make-weak-vector size [fill]
8686 @deffnx {C Function} scm_make_weak_vector (size, fill)
8687 Return a weak vector with @var{size} elements. If the optional
8688 argument @var{fill} is given, all entries in the vector will be
8689 set to @var{fill}. The default value for @var{fill} is the
8690 empty list.
8691 @end deffn
8692
8693 \flist->weak-vector
8694 @c snarfed from weaks.c:82
8695 @deffn {Scheme Procedure} list->weak-vector
8696 implemented by the C function "scm_weak_vector"
8697 @end deffn
8698
8699 \fweak-vector
8700 @c snarfed from weaks.c:90
8701 @deffn {Scheme Procedure} weak-vector . l
8702 @deffnx {Scheme Procedure} list->weak-vector l
8703 @deffnx {C Function} scm_weak_vector (l)
8704 Construct a weak vector from a list: @code{weak-vector} uses
8705 the list of its arguments while @code{list->weak-vector} uses
8706 its only argument @var{l} (a list) to construct a weak vector
8707 the same way @code{list->vector} would.
8708 @end deffn
8709
8710 \fweak-vector?
8711 @c snarfed from weaks.c:120
8712 @deffn {Scheme Procedure} weak-vector? obj
8713 @deffnx {C Function} scm_weak_vector_p (obj)
8714 Return @code{#t} if @var{obj} is a weak vector. Note that all
8715 weak hashes are also weak vectors.
8716 @end deffn
8717
8718 \fmake-weak-key-alist-vector
8719 @c snarfed from weaks.c:138
8720 @deffn {Scheme Procedure} make-weak-key-alist-vector [size]
8721 @deffnx {Scheme Procedure} make-weak-value-alist-vector size
8722 @deffnx {Scheme Procedure} make-doubly-weak-alist-vector size
8723 @deffnx {C Function} scm_make_weak_key_alist_vector (size)
8724 Return a weak hash table with @var{size} buckets. As with any
8725 hash table, choosing a good size for the table requires some
8726 caution.
8727
8728 You can modify weak hash tables in exactly the same way you
8729 would modify regular hash tables. (@pxref{Hash Tables})
8730 @end deffn
8731
8732 \fmake-weak-value-alist-vector
8733 @c snarfed from weaks.c:150
8734 @deffn {Scheme Procedure} make-weak-value-alist-vector [size]
8735 @deffnx {C Function} scm_make_weak_value_alist_vector (size)
8736 Return a hash table with weak values with @var{size} buckets.
8737 (@pxref{Hash Tables})
8738 @end deffn
8739
8740 \fmake-doubly-weak-alist-vector
8741 @c snarfed from weaks.c:162
8742 @deffn {Scheme Procedure} make-doubly-weak-alist-vector size
8743 @deffnx {C Function} scm_make_doubly_weak_alist_vector (size)
8744 Return a hash table with weak keys and values with @var{size}
8745 buckets. (@pxref{Hash Tables})
8746 @end deffn
8747
8748 \fweak-key-alist-vector?
8749 @c snarfed from weaks.c:177
8750 @deffn {Scheme Procedure} weak-key-alist-vector? obj
8751 @deffnx {Scheme Procedure} weak-value-alist-vector? obj
8752 @deffnx {Scheme Procedure} doubly-weak-alist-vector? obj
8753 @deffnx {C Function} scm_weak_key_alist_vector_p (obj)
8754 Return @code{#t} if @var{obj} is the specified weak hash
8755 table. Note that a doubly weak hash table is neither a weak key
8756 nor a weak value hash table.
8757 @end deffn
8758
8759 \fweak-value-alist-vector?
8760 @c snarfed from weaks.c:187
8761 @deffn {Scheme Procedure} weak-value-alist-vector? obj
8762 @deffnx {C Function} scm_weak_value_alist_vector_p (obj)
8763 Return @code{#t} if @var{obj} is a weak value hash table.
8764 @end deffn
8765
8766 \fdoubly-weak-alist-vector?
8767 @c snarfed from weaks.c:197
8768 @deffn {Scheme Procedure} doubly-weak-alist-vector? obj
8769 @deffnx {C Function} scm_doubly_weak_alist_vector_p (obj)
8770 Return @code{#t} if @var{obj} is a doubly weak hash table.
8771 @end deffn
8772
8773 \farray-fill!
8774 @c snarfed from ramap.c:352
8775 @deffn {Scheme Procedure} array-fill! ra fill
8776 @deffnx {C Function} scm_array_fill_x (ra, fill)
8777 Store @var{fill} in every element of @var{array}. The value returned
8778 is unspecified.
8779 @end deffn
8780
8781 \farray-copy-in-order!
8782 @c snarfed from ramap.c:399
8783 @deffn {Scheme Procedure} array-copy-in-order!
8784 implemented by the C function "scm_array_copy_x"
8785 @end deffn
8786
8787 \farray-copy!
8788 @c snarfed from ramap.c:408
8789 @deffn {Scheme Procedure} array-copy! src dst
8790 @deffnx {Scheme Procedure} array-copy-in-order! src dst
8791 @deffnx {C Function} scm_array_copy_x (src, dst)
8792 Copy every element from vector or array @var{source} to the
8793 corresponding element of @var{destination}. @var{destination} must have
8794 the same rank as @var{source}, and be at least as large in each
8795 dimension. The order is unspecified.
8796 @end deffn
8797
8798 \farray-map-in-order!
8799 @c snarfed from ramap.c:798
8800 @deffn {Scheme Procedure} array-map-in-order!
8801 implemented by the C function "scm_array_map_x"
8802 @end deffn
8803
8804 \farray-map!
8805 @c snarfed from ramap.c:809
8806 @deffn {Scheme Procedure} array-map! ra0 proc . lra
8807 @deffnx {Scheme Procedure} array-map-in-order! ra0 proc . lra
8808 @deffnx {C Function} scm_array_map_x (ra0, proc, lra)
8809 @var{array1}, @dots{} must have the same number of dimensions as
8810 @var{array0} and have a range for each index which includes the range
8811 for the corresponding index in @var{array0}. @var{proc} is applied to
8812 each tuple of elements of @var{array1} @dots{} and the result is stored
8813 as the corresponding element in @var{array0}. The value returned is
8814 unspecified. The order of application is unspecified.
8815 @end deffn
8816
8817 \farray-for-each
8818 @c snarfed from ramap.c:950
8819 @deffn {Scheme Procedure} array-for-each proc ra0 . lra
8820 @deffnx {C Function} scm_array_for_each (proc, ra0, lra)
8821 Apply @var{proc} to each tuple of elements of @var{array0} @dots{}
8822 in row-major order. The value returned is unspecified.
8823 @end deffn
8824
8825 \farray-index-map!
8826 @c snarfed from ramap.c:978
8827 @deffn {Scheme Procedure} array-index-map! ra proc
8828 @deffnx {C Function} scm_array_index_map_x (ra, proc)
8829 Apply @var{proc} to the indices of each element of @var{array} in
8830 turn, storing the result in the corresponding element. The value
8831 returned and the order of application are unspecified.
8832
8833 One can implement @var{array-indexes} as
8834 @lisp
8835 (define (array-indexes array)
8836 (let ((ra (apply make-array #f (array-shape array))))
8837 (array-index-map! ra (lambda x x))
8838 ra))
8839 @end lisp
8840 Another example:
8841 @lisp
8842 (define (apl:index-generator n)
8843 (let ((v (make-uniform-vector n 1)))
8844 (array-index-map! v (lambda (i) i))
8845 v))
8846 @end lisp
8847 @end deffn
8848
8849 \farray?
8850 @c snarfed from unif.c:501
8851 @deffn {Scheme Procedure} array? obj [prot]
8852 @deffnx {C Function} scm_array_p (obj, prot)
8853 Return @code{#t} if the @var{obj} is an array, and @code{#f} if
8854 not.
8855 @end deffn
8856
8857 \ftyped-array?
8858 @c snarfed from unif.c:548
8859 @deffn {Scheme Procedure} typed-array? obj type
8860 @deffnx {C Function} scm_typed_array_p (obj, type)
8861 Return @code{#t} if the @var{obj} is an array of type
8862 @var{type}, and @code{#f} if not.
8863 @end deffn
8864
8865 \farray-rank
8866 @c snarfed from unif.c:569
8867 @deffn {Scheme Procedure} array-rank array
8868 @deffnx {C Function} scm_array_rank (array)
8869 Return the number of dimensions of the array @var{array.}
8870
8871 @end deffn
8872
8873 \farray-dimensions
8874 @c snarfed from unif.c:583
8875 @deffn {Scheme Procedure} array-dimensions ra
8876 @deffnx {C Function} scm_array_dimensions (ra)
8877 @code{array-dimensions} is similar to @code{array-shape} but replaces
8878 elements with a @code{0} minimum with one greater than the maximum. So:
8879 @lisp
8880 (array-dimensions (make-array 'foo '(-1 3) 5)) @result{} ((-1 3) 5)
8881 @end lisp
8882 @end deffn
8883
8884 \fshared-array-root
8885 @c snarfed from unif.c:611
8886 @deffn {Scheme Procedure} shared-array-root ra
8887 @deffnx {C Function} scm_shared_array_root (ra)
8888 Return the root vector of a shared array.
8889 @end deffn
8890
8891 \fshared-array-offset
8892 @c snarfed from unif.c:625
8893 @deffn {Scheme Procedure} shared-array-offset ra
8894 @deffnx {C Function} scm_shared_array_offset (ra)
8895 Return the root vector index of the first element in the array.
8896 @end deffn
8897
8898 \fshared-array-increments
8899 @c snarfed from unif.c:641
8900 @deffn {Scheme Procedure} shared-array-increments ra
8901 @deffnx {C Function} scm_shared_array_increments (ra)
8902 For each dimension, return the distance between elements in the root vector.
8903 @end deffn
8904
8905 \fmake-typed-array
8906 @c snarfed from unif.c:740
8907 @deffn {Scheme Procedure} make-typed-array type fill . bounds
8908 @deffnx {C Function} scm_make_typed_array (type, fill, bounds)
8909 Create and return an array of type @var{type}.
8910 @end deffn
8911
8912 \fmake-array
8913 @c snarfed from unif.c:775
8914 @deffn {Scheme Procedure} make-array fill . bounds
8915 @deffnx {C Function} scm_make_array (fill, bounds)
8916 Create and return an array.
8917 @end deffn
8918
8919 \fdimensions->uniform-array
8920 @c snarfed from unif.c:790
8921 @deffn {Scheme Procedure} dimensions->uniform-array dims prot [fill]
8922 @deffnx {Scheme Procedure} make-uniform-vector length prototype [fill]
8923 @deffnx {C Function} scm_dimensions_to_uniform_array (dims, prot, fill)
8924 Create and return a uniform array or vector of type
8925 corresponding to @var{prototype} with dimensions @var{dims} or
8926 length @var{length}. If @var{fill} is supplied, it's used to
8927 fill the array, otherwise @var{prototype} is used.
8928 @end deffn
8929
8930 \fmake-shared-array
8931 @c snarfed from unif.c:843
8932 @deffn {Scheme Procedure} make-shared-array oldra mapfunc . dims
8933 @deffnx {C Function} scm_make_shared_array (oldra, mapfunc, dims)
8934 @code{make-shared-array} can be used to create shared subarrays of other
8935 arrays. The @var{mapper} is a function that translates coordinates in
8936 the new array into coordinates in the old array. A @var{mapper} must be
8937 linear, and its range must stay within the bounds of the old array, but
8938 it can be otherwise arbitrary. A simple example:
8939 @lisp
8940 (define fred (make-array #f 8 8))
8941 (define freds-diagonal
8942 (make-shared-array fred (lambda (i) (list i i)) 8))
8943 (array-set! freds-diagonal 'foo 3)
8944 (array-ref fred 3 3) @result{} foo
8945 (define freds-center
8946 (make-shared-array fred (lambda (i j) (list (+ 3 i) (+ 3 j))) 2 2))
8947 (array-ref freds-center 0 0) @result{} foo
8948 @end lisp
8949 @end deffn
8950
8951 \ftranspose-array
8952 @c snarfed from unif.c:961
8953 @deffn {Scheme Procedure} transpose-array ra . args
8954 @deffnx {C Function} scm_transpose_array (ra, args)
8955 Return an array sharing contents with @var{array}, but with
8956 dimensions arranged in a different order. There must be one
8957 @var{dim} argument for each dimension of @var{array}.
8958 @var{dim0}, @var{dim1}, @dots{} should be integers between 0
8959 and the rank of the array to be returned. Each integer in that
8960 range must appear at least once in the argument list.
8961
8962 The values of @var{dim0}, @var{dim1}, @dots{} correspond to
8963 dimensions in the array to be returned, their positions in the
8964 argument list to dimensions of @var{array}. Several @var{dim}s
8965 may have the same value, in which case the returned array will
8966 have smaller rank than @var{array}.
8967
8968 @lisp
8969 (transpose-array '#2((a b) (c d)) 1 0) @result{} #2((a c) (b d))
8970 (transpose-array '#2((a b) (c d)) 0 0) @result{} #1(a d)
8971 (transpose-array '#3(((a b c) (d e f)) ((1 2 3) (4 5 6))) 1 1 0) @result{}
8972 #2((a 4) (b 5) (c 6))
8973 @end lisp
8974 @end deffn
8975
8976 \fenclose-array
8977 @c snarfed from unif.c:1059
8978 @deffn {Scheme Procedure} enclose-array ra . axes
8979 @deffnx {C Function} scm_enclose_array (ra, axes)
8980 @var{dim0}, @var{dim1} @dots{} should be nonnegative integers less than
8981 the rank of @var{array}. @var{enclose-array} returns an array
8982 resembling an array of shared arrays. The dimensions of each shared
8983 array are the same as the @var{dim}th dimensions of the original array,
8984 the dimensions of the outer array are the same as those of the original
8985 array that did not match a @var{dim}.
8986
8987 An enclosed array is not a general Scheme array. Its elements may not
8988 be set using @code{array-set!}. Two references to the same element of
8989 an enclosed array will be @code{equal?} but will not in general be
8990 @code{eq?}. The value returned by @var{array-prototype} when given an
8991 enclosed array is unspecified.
8992
8993 examples:
8994 @lisp
8995 (enclose-array '#3(((a b c) (d e f)) ((1 2 3) (4 5 6))) 1) @result{}
8996 #<enclosed-array (#1(a d) #1(b e) #1(c f)) (#1(1 4) #1(2 5) #1(3 6))>
8997
8998 (enclose-array '#3(((a b c) (d e f)) ((1 2 3) (4 5 6))) 1 0) @result{}
8999 #<enclosed-array #2((a 1) (d 4)) #2((b 2) (e 5)) #2((c 3) (f 6))>
9000 @end lisp
9001 @end deffn
9002
9003 \farray-in-bounds?
9004 @c snarfed from unif.c:1132
9005 @deffn {Scheme Procedure} array-in-bounds? v . args
9006 @deffnx {C Function} scm_array_in_bounds_p (v, args)
9007 Return @code{#t} if its arguments would be acceptable to
9008 @code{array-ref}.
9009 @end deffn
9010
9011 \farray-ref
9012 @c snarfed from unif.c:1209
9013 @deffn {Scheme Procedure} array-ref v . args
9014 @deffnx {C Function} scm_array_ref (v, args)
9015 Return the element at the @code{(index1, index2)} element in
9016 @var{array}.
9017 @end deffn
9018
9019 \farray-set!
9020 @c snarfed from unif.c:1226
9021 @deffn {Scheme Procedure} array-set! v obj . args
9022 @deffnx {C Function} scm_array_set_x (v, obj, args)
9023 Set the element at the @code{(index1, index2)} element in @var{array} to
9024 @var{new-value}. The value returned by array-set! is unspecified.
9025 @end deffn
9026
9027 \farray-contents
9028 @c snarfed from unif.c:1252
9029 @deffn {Scheme Procedure} array-contents ra [strict]
9030 @deffnx {C Function} scm_array_contents (ra, strict)
9031 If @var{array} may be @dfn{unrolled} into a one dimensional shared array
9032 without changing their order (last subscript changing fastest), then
9033 @code{array-contents} returns that shared array, otherwise it returns
9034 @code{#f}. All arrays made by @var{make-array} and
9035 @var{make-uniform-array} may be unrolled, some arrays made by
9036 @var{make-shared-array} may not be.
9037
9038 If the optional argument @var{strict} is provided, a shared array will
9039 be returned only if its elements are stored internally contiguous in
9040 memory.
9041 @end deffn
9042
9043 \funiform-array-read!
9044 @c snarfed from unif.c:1352
9045 @deffn {Scheme Procedure} uniform-array-read! ura [port_or_fd [start [end]]]
9046 @deffnx {Scheme Procedure} uniform-vector-read! uve [port-or-fdes] [start] [end]
9047 @deffnx {C Function} scm_uniform_array_read_x (ura, port_or_fd, start, end)
9048 Attempt to read all elements of @var{ura}, in lexicographic order, as
9049 binary objects from @var{port-or-fdes}.
9050 If an end of file is encountered,
9051 the objects up to that point are put into @var{ura}
9052 (starting at the beginning) and the remainder of the array is
9053 unchanged.
9054
9055 The optional arguments @var{start} and @var{end} allow
9056 a specified region of a vector (or linearized array) to be read,
9057 leaving the remainder of the vector unchanged.
9058
9059 @code{uniform-array-read!} returns the number of objects read.
9060 @var{port-or-fdes} may be omitted, in which case it defaults to the value
9061 returned by @code{(current-input-port)}.
9062 @end deffn
9063
9064 \funiform-array-write
9065 @c snarfed from unif.c:1406
9066 @deffn {Scheme Procedure} uniform-array-write ura [port_or_fd [start [end]]]
9067 @deffnx {C Function} scm_uniform_array_write (ura, port_or_fd, start, end)
9068 Writes all elements of @var{ura} as binary objects to
9069 @var{port-or-fdes}.
9070
9071 The optional arguments @var{start}
9072 and @var{end} allow
9073 a specified region of a vector (or linearized array) to be written.
9074
9075 The number of objects actually written is returned.
9076 @var{port-or-fdes} may be
9077 omitted, in which case it defaults to the value returned by
9078 @code{(current-output-port)}.
9079 @end deffn
9080
9081 \fbitvector?
9082 @c snarfed from unif.c:1518
9083 @deffn {Scheme Procedure} bitvector? obj
9084 @deffnx {C Function} scm_bitvector_p (obj)
9085 Return @code{#t} when @var{obj} is a bitvector, else
9086 return @code{#f}.
9087 @end deffn
9088
9089 \fmake-bitvector
9090 @c snarfed from unif.c:1545
9091 @deffn {Scheme Procedure} make-bitvector len [fill]
9092 @deffnx {C Function} scm_make_bitvector (len, fill)
9093 Create a new bitvector of length @var{len} and
9094 optionally initialize all elements to @var{fill}.
9095 @end deffn
9096
9097 \fbitvector
9098 @c snarfed from unif.c:1554
9099 @deffn {Scheme Procedure} bitvector . bits
9100 @deffnx {C Function} scm_bitvector (bits)
9101 Create a new bitvector with the arguments as elements.
9102 @end deffn
9103
9104 \fbitvector-length
9105 @c snarfed from unif.c:1570
9106 @deffn {Scheme Procedure} bitvector-length vec
9107 @deffnx {C Function} scm_bitvector_length (vec)
9108 Return the length of the bitvector @var{vec}.
9109 @end deffn
9110
9111 \fbitvector-ref
9112 @c snarfed from unif.c:1661
9113 @deffn {Scheme Procedure} bitvector-ref vec idx
9114 @deffnx {C Function} scm_bitvector_ref (vec, idx)
9115 Return the element at index @var{idx} of the bitvector
9116 @var{vec}.
9117 @end deffn
9118
9119 \fbitvector-set!
9120 @c snarfed from unif.c:1704
9121 @deffn {Scheme Procedure} bitvector-set! vec idx val
9122 @deffnx {C Function} scm_bitvector_set_x (vec, idx, val)
9123 Set the element at index @var{idx} of the bitvector
9124 @var{vec} when @var{val} is true, else clear it.
9125 @end deffn
9126
9127 \fbitvector-fill!
9128 @c snarfed from unif.c:1715
9129 @deffn {Scheme Procedure} bitvector-fill! vec val
9130 @deffnx {C Function} scm_bitvector_fill_x (vec, val)
9131 Set all elements of the bitvector
9132 @var{vec} when @var{val} is true, else clear them.
9133 @end deffn
9134
9135 \flist->bitvector
9136 @c snarfed from unif.c:1760
9137 @deffn {Scheme Procedure} list->bitvector list
9138 @deffnx {C Function} scm_list_to_bitvector (list)
9139 Return a new bitvector initialized with the elements
9140 of @var{list}.
9141 @end deffn
9142
9143 \fbitvector->list
9144 @c snarfed from unif.c:1790
9145 @deffn {Scheme Procedure} bitvector->list vec
9146 @deffnx {C Function} scm_bitvector_to_list (vec)
9147 Return a new list initialized with the elements
9148 of the bitvector @var{vec}.
9149 @end deffn
9150
9151 \fbit-count
9152 @c snarfed from unif.c:1854
9153 @deffn {Scheme Procedure} bit-count b bitvector
9154 @deffnx {C Function} scm_bit_count (b, bitvector)
9155 Return the number of occurrences of the boolean @var{b} in
9156 @var{bitvector}.
9157 @end deffn
9158
9159 \fbit-position
9160 @c snarfed from unif.c:1923
9161 @deffn {Scheme Procedure} bit-position item v k
9162 @deffnx {C Function} scm_bit_position (item, v, k)
9163 Return the index of the first occurrance of @var{item} in bit
9164 vector @var{v}, starting from @var{k}. If there is no
9165 @var{item} entry between @var{k} and the end of
9166 @var{bitvector}, then return @code{#f}. For example,
9167
9168 @example
9169 (bit-position #t #*000101 0) @result{} 3
9170 (bit-position #f #*0001111 3) @result{} #f
9171 @end example
9172 @end deffn
9173
9174 \fbit-set*!
9175 @c snarfed from unif.c:2006
9176 @deffn {Scheme Procedure} bit-set*! v kv obj
9177 @deffnx {C Function} scm_bit_set_star_x (v, kv, obj)
9178 Set entries of bit vector @var{v} to @var{obj}, with @var{kv}
9179 selecting the entries to change. The return value is
9180 unspecified.
9181
9182 If @var{kv} is a bit vector, then those entries where it has
9183 @code{#t} are the ones in @var{v} which are set to @var{obj}.
9184 @var{kv} and @var{v} must be the same length. When @var{obj}
9185 is @code{#t} it's like @var{kv} is OR'ed into @var{v}. Or when
9186 @var{obj} is @code{#f} it can be seen as an ANDNOT.
9187
9188 @example
9189 (define bv #*01000010)
9190 (bit-set*! bv #*10010001 #t)
9191 bv
9192 @result{} #*11010011
9193 @end example
9194
9195 If @var{kv} is a u32vector, then its elements are
9196 indices into @var{v} which are set to @var{obj}.
9197
9198 @example
9199 (define bv #*01000010)
9200 (bit-set*! bv #u32(5 2 7) #t)
9201 bv
9202 @result{} #*01100111
9203 @end example
9204 @end deffn
9205
9206 \fbit-count*
9207 @c snarfed from unif.c:2109
9208 @deffn {Scheme Procedure} bit-count* v kv obj
9209 @deffnx {C Function} scm_bit_count_star (v, kv, obj)
9210 Return a count of how many entries in bit vector @var{v} are
9211 equal to @var{obj}, with @var{kv} selecting the entries to
9212 consider.
9213
9214 If @var{kv} is a bit vector, then those entries where it has
9215 @code{#t} are the ones in @var{v} which are considered.
9216 @var{kv} and @var{v} must be the same length.
9217
9218 If @var{kv} is a u32vector, then it contains
9219 the indexes in @var{v} to consider.
9220
9221 For example,
9222
9223 @example
9224 (bit-count* #*01110111 #*11001101 #t) @result{} 3
9225 (bit-count* #*01110111 #u32(7 0 4) #f) @result{} 2
9226 @end example
9227 @end deffn
9228
9229 \fbit-invert!
9230 @c snarfed from unif.c:2196
9231 @deffn {Scheme Procedure} bit-invert! v
9232 @deffnx {C Function} scm_bit_invert_x (v)
9233 Modify the bit vector @var{v} by replacing each element with
9234 its negation.
9235 @end deffn
9236
9237 \farray->list
9238 @c snarfed from unif.c:2303
9239 @deffn {Scheme Procedure} array->list v
9240 @deffnx {C Function} scm_array_to_list (v)
9241 Return a list consisting of all the elements, in order, of
9242 @var{array}.
9243 @end deffn
9244
9245 \flist->typed-array
9246 @c snarfed from unif.c:2332
9247 @deffn {Scheme Procedure} list->typed-array type shape lst
9248 @deffnx {C Function} scm_list_to_typed_array (type, shape, lst)
9249 Return an array of the type @var{type}
9250 with elements the same as those of @var{lst}.
9251
9252 The argument @var{shape} determines the number of dimensions
9253 of the array and their shape. It is either an exact integer,
9254 giving the
9255 number of dimensions directly, or a list whose length
9256 specifies the number of dimensions and each element specified
9257 the lower and optionally the upper bound of the corresponding
9258 dimension.
9259 When the element is list of two elements, these elements
9260 give the lower and upper bounds. When it is an exact
9261 integer, it gives only the lower bound.
9262 @end deffn
9263
9264 \flist->array
9265 @c snarfed from unif.c:2390
9266 @deffn {Scheme Procedure} list->array ndim lst
9267 @deffnx {C Function} scm_list_to_array (ndim, lst)
9268 Return an array with elements the same as those of @var{lst}.
9269 @end deffn
9270
9271 \flist->uniform-array
9272 @c snarfed from unif.c:2440
9273 @deffn {Scheme Procedure} list->uniform-array ndim prot lst
9274 @deffnx {C Function} scm_list_to_uniform_array (ndim, prot, lst)
9275 Return a uniform array of the type indicated by prototype
9276 @var{prot} with elements the same as those of @var{lst}.
9277 Elements must be of the appropriate type, no coercions are
9278 done.
9279
9280 The argument @var{ndim} determines the number of dimensions
9281 of the array. It is either an exact integer, giving the
9282 number directly, or a list of exact integers, whose length
9283 specifies the number of dimensions and each element is the
9284 lower index bound of its dimension.
9285 @end deffn
9286
9287 \farray-type
9288 @c snarfed from unif.c:2789
9289 @deffn {Scheme Procedure} array-type ra
9290 @deffnx {C Function} scm_array_type (ra)
9291
9292 @end deffn
9293
9294 \farray-prototype
9295 @c snarfed from unif.c:2809
9296 @deffn {Scheme Procedure} array-prototype ra
9297 @deffnx {C Function} scm_array_prototype (ra)
9298 Return an object that would produce an array of the same type
9299 as @var{array}, if used as the @var{prototype} for
9300 @code{make-uniform-array}.
9301 @end deffn
9302
9303 \fdynamic-link
9304 @c snarfed from dynl.c:149
9305 @deffn {Scheme Procedure} dynamic-link filename
9306 @deffnx {C Function} scm_dynamic_link (filename)
9307 Find the shared object (shared library) denoted by
9308 @var{filename} and link it into the running Guile
9309 application. The returned
9310 scheme object is a ``handle'' for the library which can
9311 be passed to @code{dynamic-func}, @code{dynamic-call} etc.
9312
9313 Searching for object files is system dependent. Normally,
9314 if @var{filename} does have an explicit directory it will
9315 be searched for in locations
9316 such as @file{/usr/lib} and @file{/usr/local/lib}.
9317 @end deffn
9318
9319 \fdynamic-object?
9320 @c snarfed from dynl.c:168
9321 @deffn {Scheme Procedure} dynamic-object? obj
9322 @deffnx {C Function} scm_dynamic_object_p (obj)
9323 Return @code{#t} if @var{obj} is a dynamic object handle,
9324 or @code{#f} otherwise.
9325 @end deffn
9326
9327 \fdynamic-unlink
9328 @c snarfed from dynl.c:182
9329 @deffn {Scheme Procedure} dynamic-unlink dobj
9330 @deffnx {C Function} scm_dynamic_unlink (dobj)
9331 Unlink a dynamic object from the application, if possible. The
9332 object must have been linked by @code{dynamic-link}, with
9333 @var{dobj} the corresponding handle. After this procedure
9334 is called, the handle can no longer be used to access the
9335 object.
9336 @end deffn
9337
9338 \fdynamic-func
9339 @c snarfed from dynl.c:207
9340 @deffn {Scheme Procedure} dynamic-func name dobj
9341 @deffnx {C Function} scm_dynamic_func (name, dobj)
9342 Return a ``handle'' for the function @var{name} in the
9343 shared object referred to by @var{dobj}. The handle
9344 can be passed to @code{dynamic-call} to actually
9345 call the function.
9346
9347 Regardless whether your C compiler prepends an underscore
9348 @samp{_} to the global names in a program, you should
9349 @strong{not} include this underscore in @var{name}
9350 since it will be added automatically when necessary.
9351 @end deffn
9352
9353 \fdynamic-call
9354 @c snarfed from dynl.c:253
9355 @deffn {Scheme Procedure} dynamic-call func dobj
9356 @deffnx {C Function} scm_dynamic_call (func, dobj)
9357 Call a C function in a dynamic object. Two styles of
9358 invocation are supported:
9359
9360 @itemize @bullet
9361 @item @var{func} can be a function handle returned by
9362 @code{dynamic-func}. In this case @var{dobj} is
9363 ignored
9364 @item @var{func} can be a string with the name of the
9365 function to call, with @var{dobj} the handle of the
9366 dynamic object in which to find the function.
9367 This is equivalent to
9368 @smallexample
9369
9370 (dynamic-call (dynamic-func @var{func} @var{dobj}) #f)
9371 @end smallexample
9372 @end itemize
9373
9374 In either case, the function is passed no arguments
9375 and its return value is ignored.
9376 @end deffn
9377
9378 \fdynamic-args-call
9379 @c snarfed from dynl.c:285
9380 @deffn {Scheme Procedure} dynamic-args-call func dobj args
9381 @deffnx {C Function} scm_dynamic_args_call (func, dobj, args)
9382 Call the C function indicated by @var{func} and @var{dobj},
9383 just like @code{dynamic-call}, but pass it some arguments and
9384 return its return value. The C function is expected to take
9385 two arguments and return an @code{int}, just like @code{main}:
9386 @smallexample
9387 int c_func (int argc, char **argv);
9388 @end smallexample
9389
9390 The parameter @var{args} must be a list of strings and is
9391 converted into an array of @code{char *}. The array is passed
9392 in @var{argv} and its size in @var{argc}. The return value is
9393 converted to a Scheme number and returned from the call to
9394 @code{dynamic-args-call}.
9395 @end deffn
9396
9397 \fchown
9398 @c snarfed from filesys.c:224
9399 @deffn {Scheme Procedure} chown object owner group
9400 @deffnx {C Function} scm_chown (object, owner, group)
9401 Change the ownership and group of the file referred to by @var{object} to
9402 the integer values @var{owner} and @var{group}. @var{object} can be
9403 a string containing a file name or, if the platform
9404 supports fchown, a port or integer file descriptor
9405 which is open on the file. The return value
9406 is unspecified.
9407
9408 If @var{object} is a symbolic link, either the
9409 ownership of the link or the ownership of the referenced file will be
9410 changed depending on the operating system (lchown is
9411 unsupported at present). If @var{owner} or @var{group} is specified
9412 as @code{-1}, then that ID is not changed.
9413 @end deffn
9414
9415 \fchmod
9416 @c snarfed from filesys.c:262
9417 @deffn {Scheme Procedure} chmod object mode
9418 @deffnx {C Function} scm_chmod (object, mode)
9419 Changes the permissions of the file referred to by @var{obj}.
9420 @var{obj} can be a string containing a file name or a port or integer file
9421 descriptor which is open on a file (in which case @code{fchmod} is used
9422 as the underlying system call).
9423 @var{mode} specifies
9424 the new permissions as a decimal number, e.g., @code{(chmod "foo" #o755)}.
9425 The return value is unspecified.
9426 @end deffn
9427
9428 \fumask
9429 @c snarfed from filesys.c:294
9430 @deffn {Scheme Procedure} umask [mode]
9431 @deffnx {C Function} scm_umask (mode)
9432 If @var{mode} is omitted, returns a decimal number representing the current
9433 file creation mask. Otherwise the file creation mask is set to
9434 @var{mode} and the previous value is returned.
9435
9436 E.g., @code{(umask #o022)} sets the mask to octal 22, decimal 18.
9437 @end deffn
9438
9439 \fopen-fdes
9440 @c snarfed from filesys.c:316
9441 @deffn {Scheme Procedure} open-fdes path flags [mode]
9442 @deffnx {C Function} scm_open_fdes (path, flags, mode)
9443 Similar to @code{open} but return a file descriptor instead of
9444 a port.
9445 @end deffn
9446
9447 \fopen
9448 @c snarfed from filesys.c:357
9449 @deffn {Scheme Procedure} open path flags [mode]
9450 @deffnx {C Function} scm_open (path, flags, mode)
9451 Open the file named by @var{path} for reading and/or writing.
9452 @var{flags} is an integer specifying how the file should be opened.
9453 @var{mode} is an integer specifying the permission bits of the file, if
9454 it needs to be created, before the umask is applied. The default is 666
9455 (Unix itself has no default).
9456
9457 @var{flags} can be constructed by combining variables using @code{logior}.
9458 Basic flags are:
9459
9460 @defvar O_RDONLY
9461 Open the file read-only.
9462 @end defvar
9463 @defvar O_WRONLY
9464 Open the file write-only.
9465 @end defvar
9466 @defvar O_RDWR
9467 Open the file read/write.
9468 @end defvar
9469 @defvar O_APPEND
9470 Append to the file instead of truncating.
9471 @end defvar
9472 @defvar O_CREAT
9473 Create the file if it does not already exist.
9474 @end defvar
9475
9476 See the Unix documentation of the @code{open} system call
9477 for additional flags.
9478 @end deffn
9479
9480 \fclose
9481 @c snarfed from filesys.c:395
9482 @deffn {Scheme Procedure} close fd_or_port
9483 @deffnx {C Function} scm_close (fd_or_port)
9484 Similar to close-port (@pxref{Closing, close-port}),
9485 but also works on file descriptors. A side
9486 effect of closing a file descriptor is that any ports using that file
9487 descriptor are moved to a different file descriptor and have
9488 their revealed counts set to zero.
9489 @end deffn
9490
9491 \fclose-fdes
9492 @c snarfed from filesys.c:422
9493 @deffn {Scheme Procedure} close-fdes fd
9494 @deffnx {C Function} scm_close_fdes (fd)
9495 A simple wrapper for the @code{close} system call.
9496 Close file descriptor @var{fd}, which must be an integer.
9497 Unlike close (@pxref{Ports and File Descriptors, close}),
9498 the file descriptor will be closed even if a port is using it.
9499 The return value is unspecified.
9500 @end deffn
9501
9502 \fstat
9503 @c snarfed from filesys.c:624
9504 @deffn {Scheme Procedure} stat object
9505 @deffnx {C Function} scm_stat (object)
9506 Return an object containing various information about the file
9507 determined by @var{obj}. @var{obj} can be a string containing
9508 a file name or a port or integer file descriptor which is open
9509 on a file (in which case @code{fstat} is used as the underlying
9510 system call).
9511
9512 The object returned by @code{stat} can be passed as a single
9513 parameter to the following procedures, all of which return
9514 integers:
9515
9516 @table @code
9517 @item stat:dev
9518 The device containing the file.
9519 @item stat:ino
9520 The file serial number, which distinguishes this file from all
9521 other files on the same device.
9522 @item stat:mode
9523 The mode of the file. This includes file type information and
9524 the file permission bits. See @code{stat:type} and
9525 @code{stat:perms} below.
9526 @item stat:nlink
9527 The number of hard links to the file.
9528 @item stat:uid
9529 The user ID of the file's owner.
9530 @item stat:gid
9531 The group ID of the file.
9532 @item stat:rdev
9533 Device ID; this entry is defined only for character or block
9534 special files.
9535 @item stat:size
9536 The size of a regular file in bytes.
9537 @item stat:atime
9538 The last access time for the file.
9539 @item stat:mtime
9540 The last modification time for the file.
9541 @item stat:ctime
9542 The last modification time for the attributes of the file.
9543 @item stat:blksize
9544 The optimal block size for reading or writing the file, in
9545 bytes.
9546 @item stat:blocks
9547 The amount of disk space that the file occupies measured in
9548 units of 512 byte blocks.
9549 @end table
9550
9551 In addition, the following procedures return the information
9552 from stat:mode in a more convenient form:
9553
9554 @table @code
9555 @item stat:type
9556 A symbol representing the type of file. Possible values are
9557 regular, directory, symlink, block-special, char-special, fifo,
9558 socket and unknown
9559 @item stat:perms
9560 An integer representing the access permission bits.
9561 @end table
9562 @end deffn
9563
9564 \flink
9565 @c snarfed from filesys.c:686
9566 @deffn {Scheme Procedure} link oldpath newpath
9567 @deffnx {C Function} scm_link (oldpath, newpath)
9568 Creates a new name @var{newpath} in the file system for the
9569 file named by @var{oldpath}. If @var{oldpath} is a symbolic
9570 link, the link may or may not be followed depending on the
9571 system.
9572 @end deffn
9573
9574 \frename-file
9575 @c snarfed from filesys.c:724
9576 @deffn {Scheme Procedure} rename-file oldname newname
9577 @deffnx {C Function} scm_rename (oldname, newname)
9578 Renames the file specified by @var{oldname} to @var{newname}.
9579 The return value is unspecified.
9580 @end deffn
9581
9582 \fdelete-file
9583 @c snarfed from filesys.c:741
9584 @deffn {Scheme Procedure} delete-file str
9585 @deffnx {C Function} scm_delete_file (str)
9586 Deletes (or "unlinks") the file specified by @var{path}.
9587 @end deffn
9588
9589 \fmkdir
9590 @c snarfed from filesys.c:758
9591 @deffn {Scheme Procedure} mkdir path [mode]
9592 @deffnx {C Function} scm_mkdir (path, mode)
9593 Create a new directory named by @var{path}. If @var{mode} is omitted
9594 then the permissions of the directory file are set using the current
9595 umask. Otherwise they are set to the decimal value specified with
9596 @var{mode}. The return value is unspecified.
9597 @end deffn
9598
9599 \frmdir
9600 @c snarfed from filesys.c:785
9601 @deffn {Scheme Procedure} rmdir path
9602 @deffnx {C Function} scm_rmdir (path)
9603 Remove the existing directory named by @var{path}. The directory must
9604 be empty for this to succeed. The return value is unspecified.
9605 @end deffn
9606
9607 \fdirectory-stream?
9608 @c snarfed from filesys.c:809
9609 @deffn {Scheme Procedure} directory-stream? obj
9610 @deffnx {C Function} scm_directory_stream_p (obj)
9611 Return a boolean indicating whether @var{object} is a directory
9612 stream as returned by @code{opendir}.
9613 @end deffn
9614
9615 \fopendir
9616 @c snarfed from filesys.c:820
9617 @deffn {Scheme Procedure} opendir dirname
9618 @deffnx {C Function} scm_opendir (dirname)
9619 Open the directory specified by @var{path} and return a directory
9620 stream.
9621 @end deffn
9622
9623 \freaddir
9624 @c snarfed from filesys.c:841
9625 @deffn {Scheme Procedure} readdir port
9626 @deffnx {C Function} scm_readdir (port)
9627 Return (as a string) the next directory entry from the directory stream
9628 @var{stream}. If there is no remaining entry to be read then the
9629 end of file object is returned.
9630 @end deffn
9631
9632 \frewinddir
9633 @c snarfed from filesys.c:880
9634 @deffn {Scheme Procedure} rewinddir port
9635 @deffnx {C Function} scm_rewinddir (port)
9636 Reset the directory port @var{stream} so that the next call to
9637 @code{readdir} will return the first directory entry.
9638 @end deffn
9639
9640 \fclosedir
9641 @c snarfed from filesys.c:897
9642 @deffn {Scheme Procedure} closedir port
9643 @deffnx {C Function} scm_closedir (port)
9644 Close the directory stream @var{stream}.
9645 The return value is unspecified.
9646 @end deffn
9647
9648 \fchdir
9649 @c snarfed from filesys.c:947
9650 @deffn {Scheme Procedure} chdir str
9651 @deffnx {C Function} scm_chdir (str)
9652 Change the current working directory to @var{path}.
9653 The return value is unspecified.
9654 @end deffn
9655
9656 \fgetcwd
9657 @c snarfed from filesys.c:962
9658 @deffn {Scheme Procedure} getcwd
9659 @deffnx {C Function} scm_getcwd ()
9660 Return the name of the current working directory.
9661 @end deffn
9662
9663 \fselect
9664 @c snarfed from filesys.c:1164
9665 @deffn {Scheme Procedure} select reads writes excepts [secs [usecs]]
9666 @deffnx {C Function} scm_select (reads, writes, excepts, secs, usecs)
9667 This procedure has a variety of uses: waiting for the ability
9668 to provide input, accept output, or the existence of
9669 exceptional conditions on a collection of ports or file
9670 descriptors, or waiting for a timeout to occur.
9671 It also returns if interrupted by a signal.
9672
9673 @var{reads}, @var{writes} and @var{excepts} can be lists or
9674 vectors, with each member a port or a file descriptor.
9675 The value returned is a list of three corresponding
9676 lists or vectors containing only the members which meet the
9677 specified requirement. The ability of port buffers to
9678 provide input or accept output is taken into account.
9679 Ordering of the input lists or vectors is not preserved.
9680
9681 The optional arguments @var{secs} and @var{usecs} specify the
9682 timeout. Either @var{secs} can be specified alone, as
9683 either an integer or a real number, or both @var{secs} and
9684 @var{usecs} can be specified as integers, in which case
9685 @var{usecs} is an additional timeout expressed in
9686 microseconds. If @var{secs} is omitted or is @code{#f} then
9687 select will wait for as long as it takes for one of the other
9688 conditions to be satisfied.
9689
9690 The scsh version of @code{select} differs as follows:
9691 Only vectors are accepted for the first three arguments.
9692 The @var{usecs} argument is not supported.
9693 Multiple values are returned instead of a list.
9694 Duplicates in the input vectors appear only once in output.
9695 An additional @code{select!} interface is provided.
9696 @end deffn
9697
9698 \ffcntl
9699 @c snarfed from filesys.c:1302
9700 @deffn {Scheme Procedure} fcntl object cmd [value]
9701 @deffnx {C Function} scm_fcntl (object, cmd, value)
9702 Apply @var{command} to the specified file descriptor or the underlying
9703 file descriptor of the specified port. @var{value} is an optional
9704 integer argument.
9705
9706 Values for @var{command} are:
9707
9708 @table @code
9709 @item F_DUPFD
9710 Duplicate a file descriptor
9711 @item F_GETFD
9712 Get flags associated with the file descriptor.
9713 @item F_SETFD
9714 Set flags associated with the file descriptor to @var{value}.
9715 @item F_GETFL
9716 Get flags associated with the open file.
9717 @item F_SETFL
9718 Set flags associated with the open file to @var{value}
9719 @item F_GETOWN
9720 Get the process ID of a socket's owner, for @code{SIGIO} signals.
9721 @item F_SETOWN
9722 Set the process that owns a socket to @var{value}, for @code{SIGIO} signals.
9723 @item FD_CLOEXEC
9724 The value used to indicate the "close on exec" flag with @code{F_GETFL} or
9725 @code{F_SETFL}.
9726 @end table
9727 @end deffn
9728
9729 \ffsync
9730 @c snarfed from filesys.c:1334
9731 @deffn {Scheme Procedure} fsync object
9732 @deffnx {C Function} scm_fsync (object)
9733 Copies any unwritten data for the specified output file descriptor to disk.
9734 If @var{port/fd} is a port, its buffer is flushed before the underlying
9735 file descriptor is fsync'd.
9736 The return value is unspecified.
9737 @end deffn
9738
9739 \fsymlink
9740 @c snarfed from filesys.c:1359
9741 @deffn {Scheme Procedure} symlink oldpath newpath
9742 @deffnx {C Function} scm_symlink (oldpath, newpath)
9743 Create a symbolic link named @var{path-to} with the value (i.e., pointing to)
9744 @var{path-from}. The return value is unspecified.
9745 @end deffn
9746
9747 \freadlink
9748 @c snarfed from filesys.c:1378
9749 @deffn {Scheme Procedure} readlink path
9750 @deffnx {C Function} scm_readlink (path)
9751 Return the value of the symbolic link named by @var{path} (a
9752 string), i.e., the file that the link points to.
9753 @end deffn
9754
9755 \flstat
9756 @c snarfed from filesys.c:1420
9757 @deffn {Scheme Procedure} lstat str
9758 @deffnx {C Function} scm_lstat (str)
9759 Similar to @code{stat}, but does not follow symbolic links, i.e.,
9760 it will return information about a symbolic link itself, not the
9761 file it points to. @var{path} must be a string.
9762 @end deffn
9763
9764 \fcopy-file
9765 @c snarfed from filesys.c:1443
9766 @deffn {Scheme Procedure} copy-file oldfile newfile
9767 @deffnx {C Function} scm_copy_file (oldfile, newfile)
9768 Copy the file specified by @var{path-from} to @var{path-to}.
9769 The return value is unspecified.
9770 @end deffn
9771
9772 \fdirname
9773 @c snarfed from filesys.c:1506
9774 @deffn {Scheme Procedure} dirname filename
9775 @deffnx {C Function} scm_dirname (filename)
9776 Return the directory name component of the file name
9777 @var{filename}. If @var{filename} does not contain a directory
9778 component, @code{.} is returned.
9779 @end deffn
9780
9781 \fbasename
9782 @c snarfed from filesys.c:1549
9783 @deffn {Scheme Procedure} basename filename [suffix]
9784 @deffnx {C Function} scm_basename (filename, suffix)
9785 Return the base name of the file name @var{filename}. The
9786 base name is the file name without any directory components.
9787 If @var{suffix} is provided, and is equal to the end of
9788 @var{basename}, it is removed also.
9789 @end deffn
9790
9791 \fpipe
9792 @c snarfed from posix.c:233
9793 @deffn {Scheme Procedure} pipe
9794 @deffnx {C Function} scm_pipe ()
9795 Return a newly created pipe: a pair of ports which are linked
9796 together on the local machine. The @emph{car} is the input
9797 port and the @emph{cdr} is the output port. Data written (and
9798 flushed) to the output port can be read from the input port.
9799 Pipes are commonly used for communication with a newly forked
9800 child process. The need to flush the output port can be
9801 avoided by making it unbuffered using @code{setvbuf}.
9802
9803 Writes occur atomically provided the size of the data in bytes
9804 is not greater than the value of @code{PIPE_BUF}. Note that
9805 the output port is likely to block if too much data (typically
9806 equal to @code{PIPE_BUF}) has been written but not yet read
9807 from the input port.
9808 @end deffn
9809
9810 \fgetgroups
9811 @c snarfed from posix.c:254
9812 @deffn {Scheme Procedure} getgroups
9813 @deffnx {C Function} scm_getgroups ()
9814 Return a vector of integers representing the current
9815 supplementary group IDs.
9816 @end deffn
9817
9818 \fsetgroups
9819 @c snarfed from posix.c:287
9820 @deffn {Scheme Procedure} setgroups group_vec
9821 @deffnx {C Function} scm_setgroups (group_vec)
9822 Set the current set of supplementary group IDs to the integers
9823 in the given vector @var{vec}. The return value is
9824 unspecified.
9825
9826 Generally only the superuser can set the process group IDs.
9827 @end deffn
9828
9829 \fgetpw
9830 @c snarfed from posix.c:336
9831 @deffn {Scheme Procedure} getpw [user]
9832 @deffnx {C Function} scm_getpwuid (user)
9833 Look up an entry in the user database. @var{obj} can be an integer,
9834 a string, or omitted, giving the behaviour of getpwuid, getpwnam
9835 or getpwent respectively.
9836 @end deffn
9837
9838 \fsetpw
9839 @c snarfed from posix.c:386
9840 @deffn {Scheme Procedure} setpw [arg]
9841 @deffnx {C Function} scm_setpwent (arg)
9842 If called with a true argument, initialize or reset the password data
9843 stream. Otherwise, close the stream. The @code{setpwent} and
9844 @code{endpwent} procedures are implemented on top of this.
9845 @end deffn
9846
9847 \fgetgr
9848 @c snarfed from posix.c:405
9849 @deffn {Scheme Procedure} getgr [name]
9850 @deffnx {C Function} scm_getgrgid (name)
9851 Look up an entry in the group database. @var{obj} can be an integer,
9852 a string, or omitted, giving the behaviour of getgrgid, getgrnam
9853 or getgrent respectively.
9854 @end deffn
9855
9856 \fsetgr
9857 @c snarfed from posix.c:441
9858 @deffn {Scheme Procedure} setgr [arg]
9859 @deffnx {C Function} scm_setgrent (arg)
9860 If called with a true argument, initialize or reset the group data
9861 stream. Otherwise, close the stream. The @code{setgrent} and
9862 @code{endgrent} procedures are implemented on top of this.
9863 @end deffn
9864
9865 \fkill
9866 @c snarfed from posix.c:477
9867 @deffn {Scheme Procedure} kill pid sig
9868 @deffnx {C Function} scm_kill (pid, sig)
9869 Sends a signal to the specified process or group of processes.
9870
9871 @var{pid} specifies the processes to which the signal is sent:
9872
9873 @table @r
9874 @item @var{pid} greater than 0
9875 The process whose identifier is @var{pid}.
9876 @item @var{pid} equal to 0
9877 All processes in the current process group.
9878 @item @var{pid} less than -1
9879 The process group whose identifier is -@var{pid}
9880 @item @var{pid} equal to -1
9881 If the process is privileged, all processes except for some special
9882 system processes. Otherwise, all processes with the current effective
9883 user ID.
9884 @end table
9885
9886 @var{sig} should be specified using a variable corresponding to
9887 the Unix symbolic name, e.g.,
9888
9889 @defvar SIGHUP
9890 Hang-up signal.
9891 @end defvar
9892
9893 @defvar SIGINT
9894 Interrupt signal.
9895 @end defvar
9896 @end deffn
9897
9898 \fwaitpid
9899 @c snarfed from posix.c:528
9900 @deffn {Scheme Procedure} waitpid pid [options]
9901 @deffnx {C Function} scm_waitpid (pid, options)
9902 This procedure collects status information from a child process which
9903 has terminated or (optionally) stopped. Normally it will
9904 suspend the calling process until this can be done. If more than one
9905 child process is eligible then one will be chosen by the operating system.
9906
9907 The value of @var{pid} determines the behaviour:
9908
9909 @table @r
9910 @item @var{pid} greater than 0
9911 Request status information from the specified child process.
9912 @item @var{pid} equal to -1 or WAIT_ANY
9913 Request status information for any child process.
9914 @item @var{pid} equal to 0 or WAIT_MYPGRP
9915 Request status information for any child process in the current process
9916 group.
9917 @item @var{pid} less than -1
9918 Request status information for any child process whose process group ID
9919 is -@var{PID}.
9920 @end table
9921
9922 The @var{options} argument, if supplied, should be the bitwise OR of the
9923 values of zero or more of the following variables:
9924
9925 @defvar WNOHANG
9926 Return immediately even if there are no child processes to be collected.
9927 @end defvar
9928
9929 @defvar WUNTRACED
9930 Report status information for stopped processes as well as terminated
9931 processes.
9932 @end defvar
9933
9934 The return value is a pair containing:
9935
9936 @enumerate
9937 @item
9938 The process ID of the child process, or 0 if @code{WNOHANG} was
9939 specified and no process was collected.
9940 @item
9941 The integer status value.
9942 @end enumerate
9943 @end deffn
9944
9945 \fstatus:exit-val
9946 @c snarfed from posix.c:554
9947 @deffn {Scheme Procedure} status:exit-val status
9948 @deffnx {C Function} scm_status_exit_val (status)
9949 Return the exit status value, as would be set if a process
9950 ended normally through a call to @code{exit} or @code{_exit},
9951 if any, otherwise @code{#f}.
9952 @end deffn
9953
9954 \fstatus:term-sig
9955 @c snarfed from posix.c:572
9956 @deffn {Scheme Procedure} status:term-sig status
9957 @deffnx {C Function} scm_status_term_sig (status)
9958 Return the signal number which terminated the process, if any,
9959 otherwise @code{#f}.
9960 @end deffn
9961
9962 \fstatus:stop-sig
9963 @c snarfed from posix.c:588
9964 @deffn {Scheme Procedure} status:stop-sig status
9965 @deffnx {C Function} scm_status_stop_sig (status)
9966 Return the signal number which stopped the process, if any,
9967 otherwise @code{#f}.
9968 @end deffn
9969
9970 \fgetppid
9971 @c snarfed from posix.c:606
9972 @deffn {Scheme Procedure} getppid
9973 @deffnx {C Function} scm_getppid ()
9974 Return an integer representing the process ID of the parent
9975 process.
9976 @end deffn
9977
9978 \fgetuid
9979 @c snarfed from posix.c:618
9980 @deffn {Scheme Procedure} getuid
9981 @deffnx {C Function} scm_getuid ()
9982 Return an integer representing the current real user ID.
9983 @end deffn
9984
9985 \fgetgid
9986 @c snarfed from posix.c:629
9987 @deffn {Scheme Procedure} getgid
9988 @deffnx {C Function} scm_getgid ()
9989 Return an integer representing the current real group ID.
9990 @end deffn
9991
9992 \fgeteuid
9993 @c snarfed from posix.c:643
9994 @deffn {Scheme Procedure} geteuid
9995 @deffnx {C Function} scm_geteuid ()
9996 Return an integer representing the current effective user ID.
9997 If the system does not support effective IDs, then the real ID
9998 is returned. @code{(provided? 'EIDs)} reports whether the
9999 system supports effective IDs.
10000 @end deffn
10001
10002 \fgetegid
10003 @c snarfed from posix.c:660
10004 @deffn {Scheme Procedure} getegid
10005 @deffnx {C Function} scm_getegid ()
10006 Return an integer representing the current effective group ID.
10007 If the system does not support effective IDs, then the real ID
10008 is returned. @code{(provided? 'EIDs)} reports whether the
10009 system supports effective IDs.
10010 @end deffn
10011
10012 \fsetuid
10013 @c snarfed from posix.c:676
10014 @deffn {Scheme Procedure} setuid id
10015 @deffnx {C Function} scm_setuid (id)
10016 Sets both the real and effective user IDs to the integer @var{id}, provided
10017 the process has appropriate privileges.
10018 The return value is unspecified.
10019 @end deffn
10020
10021 \fsetgid
10022 @c snarfed from posix.c:689
10023 @deffn {Scheme Procedure} setgid id
10024 @deffnx {C Function} scm_setgid (id)
10025 Sets both the real and effective group IDs to the integer @var{id}, provided
10026 the process has appropriate privileges.
10027 The return value is unspecified.
10028 @end deffn
10029
10030 \fseteuid
10031 @c snarfed from posix.c:704
10032 @deffn {Scheme Procedure} seteuid id
10033 @deffnx {C Function} scm_seteuid (id)
10034 Sets the effective user ID to the integer @var{id}, provided the process
10035 has appropriate privileges. If effective IDs are not supported, the
10036 real ID is set instead -- @code{(provided? 'EIDs)} reports whether the
10037 system supports effective IDs.
10038 The return value is unspecified.
10039 @end deffn
10040
10041 \fsetegid
10042 @c snarfed from posix.c:729
10043 @deffn {Scheme Procedure} setegid id
10044 @deffnx {C Function} scm_setegid (id)
10045 Sets the effective group ID to the integer @var{id}, provided the process
10046 has appropriate privileges. If effective IDs are not supported, the
10047 real ID is set instead -- @code{(provided? 'EIDs)} reports whether the
10048 system supports effective IDs.
10049 The return value is unspecified.
10050 @end deffn
10051
10052 \fgetpgrp
10053 @c snarfed from posix.c:752
10054 @deffn {Scheme Procedure} getpgrp
10055 @deffnx {C Function} scm_getpgrp ()
10056 Return an integer representing the current process group ID.
10057 This is the POSIX definition, not BSD.
10058 @end deffn
10059
10060 \fsetpgid
10061 @c snarfed from posix.c:770
10062 @deffn {Scheme Procedure} setpgid pid pgid
10063 @deffnx {C Function} scm_setpgid (pid, pgid)
10064 Move the process @var{pid} into the process group @var{pgid}. @var{pid} or
10065 @var{pgid} must be integers: they can be zero to indicate the ID of the
10066 current process.
10067 Fails on systems that do not support job control.
10068 The return value is unspecified.
10069 @end deffn
10070
10071 \fsetsid
10072 @c snarfed from posix.c:787
10073 @deffn {Scheme Procedure} setsid
10074 @deffnx {C Function} scm_setsid ()
10075 Creates a new session. The current process becomes the session leader
10076 and is put in a new process group. The process will be detached
10077 from its controlling terminal if it has one.
10078 The return value is an integer representing the new process group ID.
10079 @end deffn
10080
10081 \fttyname
10082 @c snarfed from posix.c:811
10083 @deffn {Scheme Procedure} ttyname port
10084 @deffnx {C Function} scm_ttyname (port)
10085 Return a string with the name of the serial terminal device
10086 underlying @var{port}.
10087 @end deffn
10088
10089 \fctermid
10090 @c snarfed from posix.c:850
10091 @deffn {Scheme Procedure} ctermid
10092 @deffnx {C Function} scm_ctermid ()
10093 Return a string containing the file name of the controlling
10094 terminal for the current process.
10095 @end deffn
10096
10097 \ftcgetpgrp
10098 @c snarfed from posix.c:874
10099 @deffn {Scheme Procedure} tcgetpgrp port
10100 @deffnx {C Function} scm_tcgetpgrp (port)
10101 Return the process group ID of the foreground process group
10102 associated with the terminal open on the file descriptor
10103 underlying @var{port}.
10104
10105 If there is no foreground process group, the return value is a
10106 number greater than 1 that does not match the process group ID
10107 of any existing process group. This can happen if all of the
10108 processes in the job that was formerly the foreground job have
10109 terminated, and no other job has yet been moved into the
10110 foreground.
10111 @end deffn
10112
10113 \ftcsetpgrp
10114 @c snarfed from posix.c:898
10115 @deffn {Scheme Procedure} tcsetpgrp port pgid
10116 @deffnx {C Function} scm_tcsetpgrp (port, pgid)
10117 Set the foreground process group ID for the terminal used by the file
10118 descriptor underlying @var{port} to the integer @var{pgid}.
10119 The calling process
10120 must be a member of the same session as @var{pgid} and must have the same
10121 controlling terminal. The return value is unspecified.
10122 @end deffn
10123
10124 \fexecl
10125 @c snarfed from posix.c:930
10126 @deffn {Scheme Procedure} execl filename . args
10127 @deffnx {C Function} scm_execl (filename, args)
10128 Executes the file named by @var{path} as a new process image.
10129 The remaining arguments are supplied to the process; from a C program
10130 they are accessible as the @code{argv} argument to @code{main}.
10131 Conventionally the first @var{arg} is the same as @var{path}.
10132 All arguments must be strings.
10133
10134 If @var{arg} is missing, @var{path} is executed with a null
10135 argument list, which may have system-dependent side-effects.
10136
10137 This procedure is currently implemented using the @code{execv} system
10138 call, but we call it @code{execl} because of its Scheme calling interface.
10139 @end deffn
10140
10141 \fexeclp
10142 @c snarfed from posix.c:961
10143 @deffn {Scheme Procedure} execlp filename . args
10144 @deffnx {C Function} scm_execlp (filename, args)
10145 Similar to @code{execl}, however if
10146 @var{filename} does not contain a slash
10147 then the file to execute will be located by searching the
10148 directories listed in the @code{PATH} environment variable.
10149
10150 This procedure is currently implemented using the @code{execvp} system
10151 call, but we call it @code{execlp} because of its Scheme calling interface.
10152 @end deffn
10153
10154 \fexecle
10155 @c snarfed from posix.c:995
10156 @deffn {Scheme Procedure} execle filename env . args
10157 @deffnx {C Function} scm_execle (filename, env, args)
10158 Similar to @code{execl}, but the environment of the new process is
10159 specified by @var{env}, which must be a list of strings as returned by the
10160 @code{environ} procedure.
10161
10162 This procedure is currently implemented using the @code{execve} system
10163 call, but we call it @code{execle} because of its Scheme calling interface.
10164 @end deffn
10165
10166 \fprimitive-fork
10167 @c snarfed from posix.c:1031
10168 @deffn {Scheme Procedure} primitive-fork
10169 @deffnx {C Function} scm_fork ()
10170 Creates a new "child" process by duplicating the current "parent" process.
10171 In the child the return value is 0. In the parent the return value is
10172 the integer process ID of the child.
10173
10174 This procedure has been renamed from @code{fork} to avoid a naming conflict
10175 with the scsh fork.
10176 @end deffn
10177
10178 \funame
10179 @c snarfed from posix.c:1051
10180 @deffn {Scheme Procedure} uname
10181 @deffnx {C Function} scm_uname ()
10182 Return an object with some information about the computer
10183 system the program is running on.
10184 @end deffn
10185
10186 \fenviron
10187 @c snarfed from posix.c:1080
10188 @deffn {Scheme Procedure} environ [env]
10189 @deffnx {C Function} scm_environ (env)
10190 If @var{env} is omitted, return the current environment (in the
10191 Unix sense) as a list of strings. Otherwise set the current
10192 environment, which is also the default environment for child
10193 processes, to the supplied list of strings. Each member of
10194 @var{env} should be of the form @code{NAME=VALUE} and values of
10195 @code{NAME} should not be duplicated. If @var{env} is supplied
10196 then the return value is unspecified.
10197 @end deffn
10198
10199 \ftmpnam
10200 @c snarfed from posix.c:1113
10201 @deffn {Scheme Procedure} tmpnam
10202 @deffnx {C Function} scm_tmpnam ()
10203 Return a name in the file system that does not match any
10204 existing file. However there is no guarantee that another
10205 process will not create the file after @code{tmpnam} is called.
10206 Care should be taken if opening the file, e.g., use the
10207 @code{O_EXCL} open flag or use @code{mkstemp!} instead.
10208 @end deffn
10209
10210 \fmkstemp!
10211 @c snarfed from posix.c:1144
10212 @deffn {Scheme Procedure} mkstemp! tmpl
10213 @deffnx {C Function} scm_mkstemp (tmpl)
10214 Create a new unique file in the file system and returns a new
10215 buffered port open for reading and writing to the file.
10216
10217 @var{tmpl} is a string specifying where the file should be
10218 created: it must end with @samp{XXXXXX} and will be changed in
10219 place to return the name of the temporary file.
10220
10221 The file is created with mode @code{0600}, which means read and
10222 write for the owner only. @code{chmod} can be used to change
10223 this.
10224 @end deffn
10225
10226 \futime
10227 @c snarfed from posix.c:1179
10228 @deffn {Scheme Procedure} utime pathname [actime [modtime]]
10229 @deffnx {C Function} scm_utime (pathname, actime, modtime)
10230 @code{utime} sets the access and modification times for the
10231 file named by @var{path}. If @var{actime} or @var{modtime} is
10232 not supplied, then the current time is used. @var{actime} and
10233 @var{modtime} must be integer time values as returned by the
10234 @code{current-time} procedure.
10235 @lisp
10236 (utime "foo" (- (current-time) 3600))
10237 @end lisp
10238 will set the access time to one hour in the past and the
10239 modification time to the current time.
10240 @end deffn
10241
10242 \faccess?
10243 @c snarfed from posix.c:1244
10244 @deffn {Scheme Procedure} access? path how
10245 @deffnx {C Function} scm_access (path, how)
10246 Test accessibility of a file under the real UID and GID of the
10247 calling process. The return is @code{#t} if @var{path} exists
10248 and the permissions requested by @var{how} are all allowed, or
10249 @code{#f} if not.
10250
10251 @var{how} is an integer which is one of the following values,
10252 or a bitwise-OR (@code{logior}) of multiple values.
10253
10254 @defvar R_OK
10255 Test for read permission.
10256 @end defvar
10257 @defvar W_OK
10258 Test for write permission.
10259 @end defvar
10260 @defvar X_OK
10261 Test for execute permission.
10262 @end defvar
10263 @defvar F_OK
10264 Test for existence of the file. This is implied by each of the
10265 other tests, so there's no need to combine it with them.
10266 @end defvar
10267
10268 It's important to note that @code{access?} does not simply
10269 indicate what will happen on attempting to read or write a
10270 file. In normal circumstances it does, but in a set-UID or
10271 set-GID program it doesn't because @code{access?} tests the
10272 real ID, whereas an open or execute attempt uses the effective
10273 ID.
10274
10275 A program which will never run set-UID/GID can ignore the
10276 difference between real and effective IDs, but for maximum
10277 generality, especially in library functions, it's best not to
10278 use @code{access?} to predict the result of an open or execute,
10279 instead simply attempt that and catch any exception.
10280
10281 The main use for @code{access?} is to let a set-UID/GID program
10282 determine what the invoking user would have been allowed to do,
10283 without the greater (or perhaps lesser) privileges afforded by
10284 the effective ID. For more on this, see ``Testing File
10285 Access'' in The GNU C Library Reference Manual.
10286 @end deffn
10287
10288 \fgetpid
10289 @c snarfed from posix.c:1257
10290 @deffn {Scheme Procedure} getpid
10291 @deffnx {C Function} scm_getpid ()
10292 Return an integer representing the current process ID.
10293 @end deffn
10294
10295 \fputenv
10296 @c snarfed from posix.c:1274
10297 @deffn {Scheme Procedure} putenv str
10298 @deffnx {C Function} scm_putenv (str)
10299 Modifies the environment of the current process, which is
10300 also the default environment inherited by child processes.
10301
10302 If @var{string} is of the form @code{NAME=VALUE} then it will be written
10303 directly into the environment, replacing any existing environment string
10304 with
10305 name matching @code{NAME}. If @var{string} does not contain an equal
10306 sign, then any existing string with name matching @var{string} will
10307 be removed.
10308
10309 The return value is unspecified.
10310 @end deffn
10311
10312 \fsetlocale
10313 @c snarfed from posix.c:1358
10314 @deffn {Scheme Procedure} setlocale category [locale]
10315 @deffnx {C Function} scm_setlocale (category, locale)
10316 If @var{locale} is omitted, return the current value of the
10317 specified locale category as a system-dependent string.
10318 @var{category} should be specified using the values
10319 @code{LC_COLLATE}, @code{LC_ALL} etc.
10320
10321 Otherwise the specified locale category is set to the string
10322 @var{locale} and the new value is returned as a
10323 system-dependent string. If @var{locale} is an empty string,
10324 the locale will be set using environment variables.
10325 @end deffn
10326
10327 \fmknod
10328 @c snarfed from posix.c:1407
10329 @deffn {Scheme Procedure} mknod path type perms dev
10330 @deffnx {C Function} scm_mknod (path, type, perms, dev)
10331 Creates a new special file, such as a file corresponding to a device.
10332 @var{path} specifies the name of the file. @var{type} should
10333 be one of the following symbols:
10334 regular, directory, symlink, block-special, char-special,
10335 fifo, or socket. @var{perms} (an integer) specifies the file permissions.
10336 @var{dev} (an integer) specifies which device the special file refers
10337 to. Its exact interpretation depends on the kind of special file
10338 being created.
10339
10340 E.g.,
10341 @lisp
10342 (mknod "/dev/fd0" 'block-special #o660 (+ (* 2 256) 2))
10343 @end lisp
10344
10345 The return value is unspecified.
10346 @end deffn
10347
10348 \fnice
10349 @c snarfed from posix.c:1453
10350 @deffn {Scheme Procedure} nice incr
10351 @deffnx {C Function} scm_nice (incr)
10352 Increment the priority of the current process by @var{incr}. A higher
10353 priority value means that the process runs less often.
10354 The return value is unspecified.
10355 @end deffn
10356
10357 \fsync
10358 @c snarfed from posix.c:1471
10359 @deffn {Scheme Procedure} sync
10360 @deffnx {C Function} scm_sync ()
10361 Flush the operating system disk buffers.
10362 The return value is unspecified.
10363 @end deffn
10364
10365 \fcrypt
10366 @c snarfed from posix.c:1502
10367 @deffn {Scheme Procedure} crypt key salt
10368 @deffnx {C Function} scm_crypt (key, salt)
10369 Encrypt @var{key} using @var{salt} as the salt value to the
10370 crypt(3) library call.
10371 @end deffn
10372
10373 \fchroot
10374 @c snarfed from posix.c:1531
10375 @deffn {Scheme Procedure} chroot path
10376 @deffnx {C Function} scm_chroot (path)
10377 Change the root directory to that specified in @var{path}.
10378 This directory will be used for path names beginning with
10379 @file{/}. The root directory is inherited by all children
10380 of the current process. Only the superuser may change the
10381 root directory.
10382 @end deffn
10383
10384 \fgetlogin
10385 @c snarfed from posix.c:1565
10386 @deffn {Scheme Procedure} getlogin
10387 @deffnx {C Function} scm_getlogin ()
10388 Return a string containing the name of the user logged in on
10389 the controlling terminal of the process, or @code{#f} if this
10390 information cannot be obtained.
10391 @end deffn
10392
10393 \fcuserid
10394 @c snarfed from posix.c:1583
10395 @deffn {Scheme Procedure} cuserid
10396 @deffnx {C Function} scm_cuserid ()
10397 Return a string containing a user name associated with the
10398 effective user id of the process. Return @code{#f} if this
10399 information cannot be obtained.
10400 @end deffn
10401
10402 \fgetpriority
10403 @c snarfed from posix.c:1609
10404 @deffn {Scheme Procedure} getpriority which who
10405 @deffnx {C Function} scm_getpriority (which, who)
10406 Return the scheduling priority of the process, process group
10407 or user, as indicated by @var{which} and @var{who}. @var{which}
10408 is one of the variables @code{PRIO_PROCESS}, @code{PRIO_PGRP}
10409 or @code{PRIO_USER}, and @var{who} is interpreted relative to
10410 @var{which} (a process identifier for @code{PRIO_PROCESS},
10411 process group identifier for @code{PRIO_PGRP}, and a user
10412 identifier for @code{PRIO_USER}. A zero value of @var{who}
10413 denotes the current process, process group, or user. Return
10414 the highest priority (lowest numerical value) of any of the
10415 specified processes.
10416 @end deffn
10417
10418 \fsetpriority
10419 @c snarfed from posix.c:1643
10420 @deffn {Scheme Procedure} setpriority which who prio
10421 @deffnx {C Function} scm_setpriority (which, who, prio)
10422 Set the scheduling priority of the process, process group
10423 or user, as indicated by @var{which} and @var{who}. @var{which}
10424 is one of the variables @code{PRIO_PROCESS}, @code{PRIO_PGRP}
10425 or @code{PRIO_USER}, and @var{who} is interpreted relative to
10426 @var{which} (a process identifier for @code{PRIO_PROCESS},
10427 process group identifier for @code{PRIO_PGRP}, and a user
10428 identifier for @code{PRIO_USER}. A zero value of @var{who}
10429 denotes the current process, process group, or user.
10430 @var{prio} is a value in the range -20 and 20, the default
10431 priority is 0; lower priorities cause more favorable
10432 scheduling. Sets the priority of all of the specified
10433 processes. Only the super-user may lower priorities.
10434 The return value is not specified.
10435 @end deffn
10436
10437 \fgetpass
10438 @c snarfed from posix.c:1668
10439 @deffn {Scheme Procedure} getpass prompt
10440 @deffnx {C Function} scm_getpass (prompt)
10441 Display @var{prompt} to the standard error output and read
10442 a password from @file{/dev/tty}. If this file is not
10443 accessible, it reads from standard input. The password may be
10444 up to 127 characters in length. Additional characters and the
10445 terminating newline character are discarded. While reading
10446 the password, echoing and the generation of signals by special
10447 characters is disabled.
10448 @end deffn
10449
10450 \fflock
10451 @c snarfed from posix.c:1780
10452 @deffn {Scheme Procedure} flock file operation
10453 @deffnx {C Function} scm_flock (file, operation)
10454 Apply or remove an advisory lock on an open file.
10455 @var{operation} specifies the action to be done:
10456
10457 @defvar LOCK_SH
10458 Shared lock. More than one process may hold a shared lock
10459 for a given file at a given time.
10460 @end defvar
10461 @defvar LOCK_EX
10462 Exclusive lock. Only one process may hold an exclusive lock
10463 for a given file at a given time.
10464 @end defvar
10465 @defvar LOCK_UN
10466 Unlock the file.
10467 @end defvar
10468 @defvar LOCK_NB
10469 Don't block when locking. This is combined with one of the
10470 other operations using @code{logior}. If @code{flock} would
10471 block an @code{EWOULDBLOCK} error is thrown.
10472 @end defvar
10473
10474 The return value is not specified. @var{file} may be an open
10475 file descriptor or an open file descriptor port.
10476
10477 Note that @code{flock} does not lock files across NFS.
10478 @end deffn
10479
10480 \fsethostname
10481 @c snarfed from posix.c:1805
10482 @deffn {Scheme Procedure} sethostname name
10483 @deffnx {C Function} scm_sethostname (name)
10484 Set the host name of the current processor to @var{name}. May
10485 only be used by the superuser. The return value is not
10486 specified.
10487 @end deffn
10488
10489 \fgethostname
10490 @c snarfed from posix.c:1823
10491 @deffn {Scheme Procedure} gethostname
10492 @deffnx {C Function} scm_gethostname ()
10493 Return the host name of the current processor.
10494 @end deffn
10495
10496 \fgethost
10497 @c snarfed from net_db.c:134
10498 @deffn {Scheme Procedure} gethost [host]
10499 @deffnx {Scheme Procedure} gethostbyname hostname
10500 @deffnx {Scheme Procedure} gethostbyaddr address
10501 @deffnx {C Function} scm_gethost (host)
10502 Look up a host by name or address, returning a host object. The
10503 @code{gethost} procedure will accept either a string name or an integer
10504 address; if given no arguments, it behaves like @code{gethostent} (see
10505 below). If a name or address is supplied but the address can not be
10506 found, an error will be thrown to one of the keys:
10507 @code{host-not-found}, @code{try-again}, @code{no-recovery} or
10508 @code{no-data}, corresponding to the equivalent @code{h_error} values.
10509 Unusual conditions may result in errors thrown to the
10510 @code{system-error} or @code{misc_error} keys.
10511 @end deffn
10512
10513 \fgetnet
10514 @c snarfed from net_db.c:216
10515 @deffn {Scheme Procedure} getnet [net]
10516 @deffnx {Scheme Procedure} getnetbyname net-name
10517 @deffnx {Scheme Procedure} getnetbyaddr net-number
10518 @deffnx {C Function} scm_getnet (net)
10519 Look up a network by name or net number in the network database. The
10520 @var{net-name} argument must be a string, and the @var{net-number}
10521 argument must be an integer. @code{getnet} will accept either type of
10522 argument, behaving like @code{getnetent} (see below) if no arguments are
10523 given.
10524 @end deffn
10525
10526 \fgetproto
10527 @c snarfed from net_db.c:268
10528 @deffn {Scheme Procedure} getproto [protocol]
10529 @deffnx {Scheme Procedure} getprotobyname name
10530 @deffnx {Scheme Procedure} getprotobynumber number
10531 @deffnx {C Function} scm_getproto (protocol)
10532 Look up a network protocol by name or by number. @code{getprotobyname}
10533 takes a string argument, and @code{getprotobynumber} takes an integer
10534 argument. @code{getproto} will accept either type, behaving like
10535 @code{getprotoent} (see below) if no arguments are supplied.
10536 @end deffn
10537
10538 \fgetserv
10539 @c snarfed from net_db.c:334
10540 @deffn {Scheme Procedure} getserv [name [protocol]]
10541 @deffnx {Scheme Procedure} getservbyname name protocol
10542 @deffnx {Scheme Procedure} getservbyport port protocol
10543 @deffnx {C Function} scm_getserv (name, protocol)
10544 Look up a network service by name or by service number, and return a
10545 network service object. The @var{protocol} argument specifies the name
10546 of the desired protocol; if the protocol found in the network service
10547 database does not match this name, a system error is signalled.
10548
10549 The @code{getserv} procedure will take either a service name or number
10550 as its first argument; if given no arguments, it behaves like
10551 @code{getservent} (see below).
10552 @end deffn
10553
10554 \fsethost
10555 @c snarfed from net_db.c:385
10556 @deffn {Scheme Procedure} sethost [stayopen]
10557 @deffnx {C Function} scm_sethost (stayopen)
10558 If @var{stayopen} is omitted, this is equivalent to @code{endhostent}.
10559 Otherwise it is equivalent to @code{sethostent stayopen}.
10560 @end deffn
10561
10562 \fsetnet
10563 @c snarfed from net_db.c:401
10564 @deffn {Scheme Procedure} setnet [stayopen]
10565 @deffnx {C Function} scm_setnet (stayopen)
10566 If @var{stayopen} is omitted, this is equivalent to @code{endnetent}.
10567 Otherwise it is equivalent to @code{setnetent stayopen}.
10568 @end deffn
10569
10570 \fsetproto
10571 @c snarfed from net_db.c:417
10572 @deffn {Scheme Procedure} setproto [stayopen]
10573 @deffnx {C Function} scm_setproto (stayopen)
10574 If @var{stayopen} is omitted, this is equivalent to @code{endprotoent}.
10575 Otherwise it is equivalent to @code{setprotoent stayopen}.
10576 @end deffn
10577
10578 \fsetserv
10579 @c snarfed from net_db.c:433
10580 @deffn {Scheme Procedure} setserv [stayopen]
10581 @deffnx {C Function} scm_setserv (stayopen)
10582 If @var{stayopen} is omitted, this is equivalent to @code{endservent}.
10583 Otherwise it is equivalent to @code{setservent stayopen}.
10584 @end deffn
10585
10586 \fhtons
10587 @c snarfed from socket.c:80
10588 @deffn {Scheme Procedure} htons value
10589 @deffnx {C Function} scm_htons (value)
10590 Convert a 16 bit quantity from host to network byte ordering.
10591 @var{value} is packed into 2 bytes, which are then converted
10592 and returned as a new integer.
10593 @end deffn
10594
10595 \fntohs
10596 @c snarfed from socket.c:91
10597 @deffn {Scheme Procedure} ntohs value
10598 @deffnx {C Function} scm_ntohs (value)
10599 Convert a 16 bit quantity from network to host byte ordering.
10600 @var{value} is packed into 2 bytes, which are then converted
10601 and returned as a new integer.
10602 @end deffn
10603
10604 \fhtonl
10605 @c snarfed from socket.c:102
10606 @deffn {Scheme Procedure} htonl value
10607 @deffnx {C Function} scm_htonl (value)
10608 Convert a 32 bit quantity from host to network byte ordering.
10609 @var{value} is packed into 4 bytes, which are then converted
10610 and returned as a new integer.
10611 @end deffn
10612
10613 \fntohl
10614 @c snarfed from socket.c:115
10615 @deffn {Scheme Procedure} ntohl value
10616 @deffnx {C Function} scm_ntohl (value)
10617 Convert a 32 bit quantity from network to host byte ordering.
10618 @var{value} is packed into 4 bytes, which are then converted
10619 and returned as a new integer.
10620 @end deffn
10621
10622 \finet-aton
10623 @c snarfed from socket.c:135
10624 @deffn {Scheme Procedure} inet-aton address
10625 @deffnx {C Function} scm_inet_aton (address)
10626 Convert an IPv4 Internet address from printable string
10627 (dotted decimal notation) to an integer. E.g.,
10628
10629 @lisp
10630 (inet-aton "127.0.0.1") @result{} 2130706433
10631 @end lisp
10632 @end deffn
10633
10634 \finet-ntoa
10635 @c snarfed from socket.c:158
10636 @deffn {Scheme Procedure} inet-ntoa inetid
10637 @deffnx {C Function} scm_inet_ntoa (inetid)
10638 Convert an IPv4 Internet address to a printable
10639 (dotted decimal notation) string. E.g.,
10640
10641 @lisp
10642 (inet-ntoa 2130706433) @result{} "127.0.0.1"
10643 @end lisp
10644 @end deffn
10645
10646 \finet-netof
10647 @c snarfed from socket.c:178
10648 @deffn {Scheme Procedure} inet-netof address
10649 @deffnx {C Function} scm_inet_netof (address)
10650 Return the network number part of the given IPv4
10651 Internet address. E.g.,
10652
10653 @lisp
10654 (inet-netof 2130706433) @result{} 127
10655 @end lisp
10656 @end deffn
10657
10658 \finet-lnaof
10659 @c snarfed from socket.c:196
10660 @deffn {Scheme Procedure} inet-lnaof address
10661 @deffnx {C Function} scm_lnaof (address)
10662 Return the local-address-with-network part of the given
10663 IPv4 Internet address, using the obsolete class A/B/C system.
10664 E.g.,
10665
10666 @lisp
10667 (inet-lnaof 2130706433) @result{} 1
10668 @end lisp
10669 @end deffn
10670
10671 \finet-makeaddr
10672 @c snarfed from socket.c:214
10673 @deffn {Scheme Procedure} inet-makeaddr net lna
10674 @deffnx {C Function} scm_inet_makeaddr (net, lna)
10675 Make an IPv4 Internet address by combining the network number
10676 @var{net} with the local-address-within-network number
10677 @var{lna}. E.g.,
10678
10679 @lisp
10680 (inet-makeaddr 127 1) @result{} 2130706433
10681 @end lisp
10682 @end deffn
10683
10684 \finet-pton
10685 @c snarfed from socket.c:350
10686 @deffn {Scheme Procedure} inet-pton family address
10687 @deffnx {C Function} scm_inet_pton (family, address)
10688 Convert a string containing a printable network address to
10689 an integer address. Note that unlike the C version of this
10690 function,
10691 the result is an integer with normal host byte ordering.
10692 @var{family} can be @code{AF_INET} or @code{AF_INET6}. E.g.,
10693
10694 @lisp
10695 (inet-pton AF_INET "127.0.0.1") @result{} 2130706433
10696 (inet-pton AF_INET6 "::1") @result{} 1
10697 @end lisp
10698 @end deffn
10699
10700 \finet-ntop
10701 @c snarfed from socket.c:388
10702 @deffn {Scheme Procedure} inet-ntop family address
10703 @deffnx {C Function} scm_inet_ntop (family, address)
10704 Convert a network address into a printable string.
10705 Note that unlike the C version of this function,
10706 the input is an integer with normal host byte ordering.
10707 @var{family} can be @code{AF_INET} or @code{AF_INET6}. E.g.,
10708
10709 @lisp
10710 (inet-ntop AF_INET 2130706433) @result{} "127.0.0.1"
10711 (inet-ntop AF_INET6 (- (expt 2 128) 1)) @result{}
10712 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
10713 @end lisp
10714 @end deffn
10715
10716 \fsocket
10717 @c snarfed from socket.c:430
10718 @deffn {Scheme Procedure} socket family style proto
10719 @deffnx {C Function} scm_socket (family, style, proto)
10720 Return a new socket port of the type specified by @var{family},
10721 @var{style} and @var{proto}. All three parameters are
10722 integers. Supported values for @var{family} are
10723 @code{AF_UNIX}, @code{AF_INET} and @code{AF_INET6}.
10724 Typical values for @var{style} are @code{SOCK_STREAM},
10725 @code{SOCK_DGRAM} and @code{SOCK_RAW}.
10726
10727 @var{proto} can be obtained from a protocol name using
10728 @code{getprotobyname}. A value of zero specifies the default
10729 protocol, which is usually right.
10730
10731 A single socket port cannot by used for communication until it
10732 has been connected to another socket.
10733 @end deffn
10734
10735 \fsocketpair
10736 @c snarfed from socket.c:451
10737 @deffn {Scheme Procedure} socketpair family style proto
10738 @deffnx {C Function} scm_socketpair (family, style, proto)
10739 Return a pair of connected (but unnamed) socket ports of the
10740 type specified by @var{family}, @var{style} and @var{proto}.
10741 Many systems support only socket pairs of the @code{AF_UNIX}
10742 family. Zero is likely to be the only meaningful value for
10743 @var{proto}.
10744 @end deffn
10745
10746 \fgetsockopt
10747 @c snarfed from socket.c:476
10748 @deffn {Scheme Procedure} getsockopt sock level optname
10749 @deffnx {C Function} scm_getsockopt (sock, level, optname)
10750 Return the value of a particular socket option for the socket
10751 port @var{sock}. @var{level} is an integer code for type of
10752 option being requested, e.g., @code{SOL_SOCKET} for
10753 socket-level options. @var{optname} is an integer code for the
10754 option required and should be specified using one of the
10755 symbols @code{SO_DEBUG}, @code{SO_REUSEADDR} etc.
10756
10757 The returned value is typically an integer but @code{SO_LINGER}
10758 returns a pair of integers.
10759 @end deffn
10760
10761 \fsetsockopt
10762 @c snarfed from socket.c:544
10763 @deffn {Scheme Procedure} setsockopt sock level optname value
10764 @deffnx {C Function} scm_setsockopt (sock, level, optname, value)
10765 Set the value of a particular socket option for the socket
10766 port @var{sock}. @var{level} is an integer code for type of option
10767 being set, e.g., @code{SOL_SOCKET} for socket-level options.
10768 @var{optname} is an
10769 integer code for the option to set and should be specified using one of
10770 the symbols @code{SO_DEBUG}, @code{SO_REUSEADDR} etc.
10771 @var{value} is the value to which the option should be set. For
10772 most options this must be an integer, but for @code{SO_LINGER} it must
10773 be a pair.
10774
10775 The return value is unspecified.
10776 @end deffn
10777
10778 \fshutdown
10779 @c snarfed from socket.c:646
10780 @deffn {Scheme Procedure} shutdown sock how
10781 @deffnx {C Function} scm_shutdown (sock, how)
10782 Sockets can be closed simply by using @code{close-port}. The
10783 @code{shutdown} procedure allows reception or transmission on a
10784 connection to be shut down individually, according to the parameter
10785 @var{how}:
10786
10787 @table @asis
10788 @item 0
10789 Stop receiving data for this socket. If further data arrives, reject it.
10790 @item 1
10791 Stop trying to transmit data from this socket. Discard any
10792 data waiting to be sent. Stop looking for acknowledgement of
10793 data already sent; don't retransmit it if it is lost.
10794 @item 2
10795 Stop both reception and transmission.
10796 @end table
10797
10798 The return value is unspecified.
10799 @end deffn
10800
10801 \fconnect
10802 @c snarfed from socket.c:789
10803 @deffn {Scheme Procedure} connect sock fam address . args
10804 @deffnx {C Function} scm_connect (sock, fam, address, args)
10805 Initiate a connection from a socket using a specified address
10806 family to the address
10807 specified by @var{address} and possibly @var{args}.
10808 The format required for @var{address}
10809 and @var{args} depends on the family of the socket.
10810
10811 For a socket of family @code{AF_UNIX},
10812 only @var{address} is specified and must be a string with the
10813 filename where the socket is to be created.
10814
10815 For a socket of family @code{AF_INET},
10816 @var{address} must be an integer IPv4 host address and
10817 @var{args} must be a single integer port number.
10818
10819 For a socket of family @code{AF_INET6},
10820 @var{address} must be an integer IPv6 host address and
10821 @var{args} may be up to three integers:
10822 port [flowinfo] [scope_id],
10823 where flowinfo and scope_id default to zero.
10824
10825 The return value is unspecified.
10826 @end deffn
10827
10828 \fbind
10829 @c snarfed from socket.c:848
10830 @deffn {Scheme Procedure} bind sock fam address . args
10831 @deffnx {C Function} scm_bind (sock, fam, address, args)
10832 Assign an address to the socket port @var{sock}.
10833 Generally this only needs to be done for server sockets,
10834 so they know where to look for incoming connections. A socket
10835 without an address will be assigned one automatically when it
10836 starts communicating.
10837
10838 The format of @var{address} and @var{args} depends
10839 on the family of the socket.
10840
10841 For a socket of family @code{AF_UNIX}, only @var{address}
10842 is specified and must be a string with the filename where
10843 the socket is to be created.
10844
10845 For a socket of family @code{AF_INET}, @var{address}
10846 must be an integer IPv4 address and @var{args}
10847 must be a single integer port number.
10848
10849 The values of the following variables can also be used for
10850 @var{address}:
10851
10852 @defvar INADDR_ANY
10853 Allow connections from any address.
10854 @end defvar
10855
10856 @defvar INADDR_LOOPBACK
10857 The address of the local host using the loopback device.
10858 @end defvar
10859
10860 @defvar INADDR_BROADCAST
10861 The broadcast address on the local network.
10862 @end defvar
10863
10864 @defvar INADDR_NONE
10865 No address.
10866 @end defvar
10867
10868 For a socket of family @code{AF_INET6}, @var{address}
10869 must be an integer IPv6 address and @var{args}
10870 may be up to three integers:
10871 port [flowinfo] [scope_id],
10872 where flowinfo and scope_id default to zero.
10873
10874 The return value is unspecified.
10875 @end deffn
10876
10877 \flisten
10878 @c snarfed from socket.c:881
10879 @deffn {Scheme Procedure} listen sock backlog
10880 @deffnx {C Function} scm_listen (sock, backlog)
10881 Enable @var{sock} to accept connection
10882 requests. @var{backlog} is an integer specifying
10883 the maximum length of the queue for pending connections.
10884 If the queue fills, new clients will fail to connect until
10885 the server calls @code{accept} to accept a connection from
10886 the queue.
10887
10888 The return value is unspecified.
10889 @end deffn
10890
10891 \faccept
10892 @c snarfed from socket.c:993
10893 @deffn {Scheme Procedure} accept sock
10894 @deffnx {C Function} scm_accept (sock)
10895 Accept a connection on a bound, listening socket.
10896 If there
10897 are no pending connections in the queue, wait until
10898 one is available unless the non-blocking option has been
10899 set on the socket.
10900
10901 The return value is a
10902 pair in which the @emph{car} is a new socket port for the
10903 connection and
10904 the @emph{cdr} is an object with address information about the
10905 client which initiated the connection.
10906
10907 @var{sock} does not become part of the
10908 connection and will continue to accept new requests.
10909 @end deffn
10910
10911 \fgetsockname
10912 @c snarfed from socket.c:1020
10913 @deffn {Scheme Procedure} getsockname sock
10914 @deffnx {C Function} scm_getsockname (sock)
10915 Return the address of @var{sock}, in the same form as the
10916 object returned by @code{accept}. On many systems the address
10917 of a socket in the @code{AF_FILE} namespace cannot be read.
10918 @end deffn
10919
10920 \fgetpeername
10921 @c snarfed from socket.c:1042
10922 @deffn {Scheme Procedure} getpeername sock
10923 @deffnx {C Function} scm_getpeername (sock)
10924 Return the address that @var{sock}
10925 is connected to, in the same form as the object returned by
10926 @code{accept}. On many systems the address of a socket in the
10927 @code{AF_FILE} namespace cannot be read.
10928 @end deffn
10929
10930 \frecv!
10931 @c snarfed from socket.c:1077
10932 @deffn {Scheme Procedure} recv! sock buf [flags]
10933 @deffnx {C Function} scm_recv (sock, buf, flags)
10934 Receive data from a socket port.
10935 @var{sock} must already
10936 be bound to the address from which data is to be received.
10937 @var{buf} is a string into which
10938 the data will be written. The size of @var{buf} limits
10939 the amount of
10940 data which can be received: in the case of packet
10941 protocols, if a packet larger than this limit is encountered
10942 then some data
10943 will be irrevocably lost.
10944
10945 The optional @var{flags} argument is a value or
10946 bitwise OR of MSG_OOB, MSG_PEEK, MSG_DONTROUTE etc.
10947
10948 The value returned is the number of bytes read from the
10949 socket.
10950
10951 Note that the data is read directly from the socket file
10952 descriptor:
10953 any unread buffered port data is ignored.
10954 @end deffn
10955
10956 \fsend
10957 @c snarfed from socket.c:1120
10958 @deffn {Scheme Procedure} send sock message [flags]
10959 @deffnx {C Function} scm_send (sock, message, flags)
10960 Transmit the string @var{message} on a socket port @var{sock}.
10961 @var{sock} must already be bound to a destination address. The
10962 value returned is the number of bytes transmitted --
10963 it's possible for
10964 this to be less than the length of @var{message}
10965 if the socket is
10966 set to be non-blocking. The optional @var{flags} argument
10967 is a value or
10968 bitwise OR of MSG_OOB, MSG_PEEK, MSG_DONTROUTE etc.
10969
10970 Note that the data is written directly to the socket
10971 file descriptor:
10972 any unflushed buffered port data is ignored.
10973 @end deffn
10974
10975 \frecvfrom!
10976 @c snarfed from socket.c:1171
10977 @deffn {Scheme Procedure} recvfrom! sock str [flags [start [end]]]
10978 @deffnx {C Function} scm_recvfrom (sock, str, flags, start, end)
10979 Return data from the socket port @var{sock} and also
10980 information about where the data was received from.
10981 @var{sock} must already be bound to the address from which
10982 data is to be received. @code{str}, is a string into which the
10983 data will be written. The size of @var{str} limits the amount
10984 of data which can be received: in the case of packet protocols,
10985 if a packet larger than this limit is encountered then some
10986 data will be irrevocably lost.
10987
10988 The optional @var{flags} argument is a value or bitwise OR of
10989 @code{MSG_OOB}, @code{MSG_PEEK}, @code{MSG_DONTROUTE} etc.
10990
10991 The value returned is a pair: the @emph{car} is the number of
10992 bytes read from the socket and the @emph{cdr} an address object
10993 in the same form as returned by @code{accept}. The address
10994 will given as @code{#f} if not available, as is usually the
10995 case for stream sockets.
10996
10997 The @var{start} and @var{end} arguments specify a substring of
10998 @var{str} to which the data should be written.
10999
11000 Note that the data is read directly from the socket file
11001 descriptor: any unread buffered port data is ignored.
11002 @end deffn
11003
11004 \fsendto
11005 @c snarfed from socket.c:1236
11006 @deffn {Scheme Procedure} sendto sock message fam address . args_and_flags
11007 @deffnx {C Function} scm_sendto (sock, message, fam, address, args_and_flags)
11008 Transmit the string @var{message} on the socket port
11009 @var{sock}. The
11010 destination address is specified using the @var{fam},
11011 @var{address} and
11012 @var{args_and_flags} arguments, in a similar way to the
11013 @code{connect} procedure. @var{args_and_flags} contains
11014 the usual connection arguments optionally followed by
11015 a flags argument, which is a value or
11016 bitwise OR of MSG_OOB, MSG_PEEK, MSG_DONTROUTE etc.
11017
11018 The value returned is the number of bytes transmitted --
11019 it's possible for
11020 this to be less than the length of @var{message} if the
11021 socket is
11022 set to be non-blocking.
11023 Note that the data is written directly to the socket
11024 file descriptor:
11025 any unflushed buffered port data is ignored.
11026 @end deffn
11027
11028 \fregexp?
11029 @c snarfed from regex-posix.c:106
11030 @deffn {Scheme Procedure} regexp? obj
11031 @deffnx {C Function} scm_regexp_p (obj)
11032 Return @code{#t} if @var{obj} is a compiled regular expression,
11033 or @code{#f} otherwise.
11034 @end deffn
11035
11036 \fmake-regexp
11037 @c snarfed from regex-posix.c:151
11038 @deffn {Scheme Procedure} make-regexp pat . flags
11039 @deffnx {C Function} scm_make_regexp (pat, flags)
11040 Compile the regular expression described by @var{pat}, and
11041 return the compiled regexp structure. If @var{pat} does not
11042 describe a legal regular expression, @code{make-regexp} throws
11043 a @code{regular-expression-syntax} error.
11044
11045 The @var{flags} arguments change the behavior of the compiled
11046 regular expression. The following flags may be supplied:
11047
11048 @table @code
11049 @item regexp/icase
11050 Consider uppercase and lowercase letters to be the same when
11051 matching.
11052 @item regexp/newline
11053 If a newline appears in the target string, then permit the
11054 @samp{^} and @samp{$} operators to match immediately after or
11055 immediately before the newline, respectively. Also, the
11056 @samp{.} and @samp{[^...]} operators will never match a newline
11057 character. The intent of this flag is to treat the target
11058 string as a buffer containing many lines of text, and the
11059 regular expression as a pattern that may match a single one of
11060 those lines.
11061 @item regexp/basic
11062 Compile a basic (``obsolete'') regexp instead of the extended
11063 (``modern'') regexps that are the default. Basic regexps do
11064 not consider @samp{|}, @samp{+} or @samp{?} to be special
11065 characters, and require the @samp{@{...@}} and @samp{(...)}
11066 metacharacters to be backslash-escaped (@pxref{Backslash
11067 Escapes}). There are several other differences between basic
11068 and extended regular expressions, but these are the most
11069 significant.
11070 @item regexp/extended
11071 Compile an extended regular expression rather than a basic
11072 regexp. This is the default behavior; this flag will not
11073 usually be needed. If a call to @code{make-regexp} includes
11074 both @code{regexp/basic} and @code{regexp/extended} flags, the
11075 one which comes last will override the earlier one.
11076 @end table
11077 @end deffn
11078
11079 \fregexp-exec
11080 @c snarfed from regex-posix.c:217
11081 @deffn {Scheme Procedure} regexp-exec rx str [start [flags]]
11082 @deffnx {C Function} scm_regexp_exec (rx, str, start, flags)
11083 Match the compiled regular expression @var{rx} against
11084 @code{str}. If the optional integer @var{start} argument is
11085 provided, begin matching from that position in the string.
11086 Return a match structure describing the results of the match,
11087 or @code{#f} if no match could be found.
11088
11089 The @var{flags} arguments change the matching behavior.
11090 The following flags may be supplied:
11091
11092 @table @code
11093 @item regexp/notbol
11094 Operator @samp{^} always fails (unless @code{regexp/newline}
11095 is used). Use this when the beginning of the string should
11096 not be considered the beginning of a line.
11097 @item regexp/noteol
11098 Operator @samp{$} always fails (unless @code{regexp/newline}
11099 is used). Use this when the end of the string should not be
11100 considered the end of a line.
11101 @end table
11102 @end deffn