d521f980b55186919dd5a611ed16f78a58b0a7ea
[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 \fgc-live-object-stats
1754 @c snarfed from gc.c:276
1755 @deffn {Scheme Procedure} gc-live-object-stats
1756 @deffnx {C Function} scm_gc_live_object_stats ()
1757 Return an alist of statistics of the current live objects.
1758 @end deffn
1759
1760 \fgc-stats
1761 @c snarfed from gc.c:293
1762 @deffn {Scheme Procedure} gc-stats
1763 @deffnx {C Function} scm_gc_stats ()
1764 Return an association list of statistics about Guile's current
1765 use of storage.
1766
1767 @end deffn
1768
1769 \fobject-address
1770 @c snarfed from gc.c:429
1771 @deffn {Scheme Procedure} object-address obj
1772 @deffnx {C Function} scm_object_address (obj)
1773 Return an integer that for the lifetime of @var{obj} is uniquely
1774 returned by this function for @var{obj}
1775 @end deffn
1776
1777 \fgc
1778 @c snarfed from gc.c:440
1779 @deffn {Scheme Procedure} gc
1780 @deffnx {C Function} scm_gc ()
1781 Scans all of SCM objects and reclaims for further use those that are
1782 no longer accessible.
1783 @end deffn
1784
1785 \fclass-of
1786 @c snarfed from goops.c:166
1787 @deffn {Scheme Procedure} class-of x
1788 @deffnx {C Function} scm_class_of (x)
1789 Return the class of @var{x}.
1790 @end deffn
1791
1792 \f%compute-slots
1793 @c snarfed from goops.c:407
1794 @deffn {Scheme Procedure} %compute-slots class
1795 @deffnx {C Function} scm_sys_compute_slots (class)
1796 Return a list consisting of the names of all slots belonging to
1797 class @var{class}, i. e. the slots of @var{class} and of all of
1798 its superclasses.
1799 @end deffn
1800
1801 \fget-keyword
1802 @c snarfed from goops.c:498
1803 @deffn {Scheme Procedure} get-keyword key l default_value
1804 @deffnx {C Function} scm_get_keyword (key, l, default_value)
1805 Determine an associated value for the keyword @var{key} from
1806 the list @var{l}. The list @var{l} has to consist of an even
1807 number of elements, where, starting with the first, every
1808 second element is a keyword, followed by its associated value.
1809 If @var{l} does not hold a value for @var{key}, the value
1810 @var{default_value} is returned.
1811 @end deffn
1812
1813 \f%initialize-object
1814 @c snarfed from goops.c:521
1815 @deffn {Scheme Procedure} %initialize-object obj initargs
1816 @deffnx {C Function} scm_sys_initialize_object (obj, initargs)
1817 Initialize the object @var{obj} with the given arguments
1818 @var{initargs}.
1819 @end deffn
1820
1821 \f%prep-layout!
1822 @c snarfed from goops.c:619
1823 @deffn {Scheme Procedure} %prep-layout! class
1824 @deffnx {C Function} scm_sys_prep_layout_x (class)
1825
1826 @end deffn
1827
1828 \f%inherit-magic!
1829 @c snarfed from goops.c:718
1830 @deffn {Scheme Procedure} %inherit-magic! class dsupers
1831 @deffnx {C Function} scm_sys_inherit_magic_x (class, dsupers)
1832
1833 @end deffn
1834
1835 \finstance?
1836 @c snarfed from goops.c:958
1837 @deffn {Scheme Procedure} instance? obj
1838 @deffnx {C Function} scm_instance_p (obj)
1839 Return @code{#t} if @var{obj} is an instance.
1840 @end deffn
1841
1842 \fclass-name
1843 @c snarfed from goops.c:973
1844 @deffn {Scheme Procedure} class-name obj
1845 @deffnx {C Function} scm_class_name (obj)
1846 Return the class name of @var{obj}.
1847 @end deffn
1848
1849 \fclass-direct-supers
1850 @c snarfed from goops.c:983
1851 @deffn {Scheme Procedure} class-direct-supers obj
1852 @deffnx {C Function} scm_class_direct_supers (obj)
1853 Return the direct superclasses of the class @var{obj}.
1854 @end deffn
1855
1856 \fclass-direct-slots
1857 @c snarfed from goops.c:993
1858 @deffn {Scheme Procedure} class-direct-slots obj
1859 @deffnx {C Function} scm_class_direct_slots (obj)
1860 Return the direct slots of the class @var{obj}.
1861 @end deffn
1862
1863 \fclass-direct-subclasses
1864 @c snarfed from goops.c:1003
1865 @deffn {Scheme Procedure} class-direct-subclasses obj
1866 @deffnx {C Function} scm_class_direct_subclasses (obj)
1867 Return the direct subclasses of the class @var{obj}.
1868 @end deffn
1869
1870 \fclass-direct-methods
1871 @c snarfed from goops.c:1013
1872 @deffn {Scheme Procedure} class-direct-methods obj
1873 @deffnx {C Function} scm_class_direct_methods (obj)
1874 Return the direct methods of the class @var{obj}
1875 @end deffn
1876
1877 \fclass-precedence-list
1878 @c snarfed from goops.c:1023
1879 @deffn {Scheme Procedure} class-precedence-list obj
1880 @deffnx {C Function} scm_class_precedence_list (obj)
1881 Return the class precedence list of the class @var{obj}.
1882 @end deffn
1883
1884 \fclass-slots
1885 @c snarfed from goops.c:1033
1886 @deffn {Scheme Procedure} class-slots obj
1887 @deffnx {C Function} scm_class_slots (obj)
1888 Return the slot list of the class @var{obj}.
1889 @end deffn
1890
1891 \fclass-environment
1892 @c snarfed from goops.c:1043
1893 @deffn {Scheme Procedure} class-environment obj
1894 @deffnx {C Function} scm_class_environment (obj)
1895 Return the environment of the class @var{obj}.
1896 @end deffn
1897
1898 \fgeneric-function-name
1899 @c snarfed from goops.c:1054
1900 @deffn {Scheme Procedure} generic-function-name obj
1901 @deffnx {C Function} scm_generic_function_name (obj)
1902 Return the name of the generic function @var{obj}.
1903 @end deffn
1904
1905 \fgeneric-function-methods
1906 @c snarfed from goops.c:1099
1907 @deffn {Scheme Procedure} generic-function-methods obj
1908 @deffnx {C Function} scm_generic_function_methods (obj)
1909 Return the methods of the generic function @var{obj}.
1910 @end deffn
1911
1912 \fmethod-generic-function
1913 @c snarfed from goops.c:1112
1914 @deffn {Scheme Procedure} method-generic-function obj
1915 @deffnx {C Function} scm_method_generic_function (obj)
1916 Return the generic function for the method @var{obj}.
1917 @end deffn
1918
1919 \fmethod-specializers
1920 @c snarfed from goops.c:1122
1921 @deffn {Scheme Procedure} method-specializers obj
1922 @deffnx {C Function} scm_method_specializers (obj)
1923 Return specializers of the method @var{obj}.
1924 @end deffn
1925
1926 \fmethod-procedure
1927 @c snarfed from goops.c:1132
1928 @deffn {Scheme Procedure} method-procedure obj
1929 @deffnx {C Function} scm_method_procedure (obj)
1930 Return the procedure of the method @var{obj}.
1931 @end deffn
1932
1933 \faccessor-method-slot-definition
1934 @c snarfed from goops.c:1142
1935 @deffn {Scheme Procedure} accessor-method-slot-definition obj
1936 @deffnx {C Function} scm_accessor_method_slot_definition (obj)
1937 Return the slot definition of the accessor @var{obj}.
1938 @end deffn
1939
1940 \f%tag-body
1941 @c snarfed from goops.c:1152
1942 @deffn {Scheme Procedure} %tag-body body
1943 @deffnx {C Function} scm_sys_tag_body (body)
1944 Internal GOOPS magic---don't use this function!
1945 @end deffn
1946
1947 \fmake-unbound
1948 @c snarfed from goops.c:1167
1949 @deffn {Scheme Procedure} make-unbound
1950 @deffnx {C Function} scm_make_unbound ()
1951 Return the unbound value.
1952 @end deffn
1953
1954 \funbound?
1955 @c snarfed from goops.c:1176
1956 @deffn {Scheme Procedure} unbound? obj
1957 @deffnx {C Function} scm_unbound_p (obj)
1958 Return @code{#t} if @var{obj} is unbound.
1959 @end deffn
1960
1961 \fassert-bound
1962 @c snarfed from goops.c:1186
1963 @deffn {Scheme Procedure} assert-bound value obj
1964 @deffnx {C Function} scm_assert_bound (value, obj)
1965 Return @var{value} if it is bound, and invoke the
1966 @var{slot-unbound} method of @var{obj} if it is not.
1967 @end deffn
1968
1969 \f@@assert-bound-ref
1970 @c snarfed from goops.c:1198
1971 @deffn {Scheme Procedure} @@assert-bound-ref obj index
1972 @deffnx {C Function} scm_at_assert_bound_ref (obj, index)
1973 Like @code{assert-bound}, but use @var{index} for accessing
1974 the value from @var{obj}.
1975 @end deffn
1976
1977 \f%fast-slot-ref
1978 @c snarfed from goops.c:1210
1979 @deffn {Scheme Procedure} %fast-slot-ref obj index
1980 @deffnx {C Function} scm_sys_fast_slot_ref (obj, index)
1981 Return the slot value with index @var{index} from @var{obj}.
1982 @end deffn
1983
1984 \f%fast-slot-set!
1985 @c snarfed from goops.c:1224
1986 @deffn {Scheme Procedure} %fast-slot-set! obj index value
1987 @deffnx {C Function} scm_sys_fast_slot_set_x (obj, index, value)
1988 Set the slot with index @var{index} in @var{obj} to
1989 @var{value}.
1990 @end deffn
1991
1992 \fslot-ref-using-class
1993 @c snarfed from goops.c:1361
1994 @deffn {Scheme Procedure} slot-ref-using-class class obj slot_name
1995 @deffnx {C Function} scm_slot_ref_using_class (class, obj, slot_name)
1996
1997 @end deffn
1998
1999 \fslot-set-using-class!
2000 @c snarfed from goops.c:1380
2001 @deffn {Scheme Procedure} slot-set-using-class! class obj slot_name value
2002 @deffnx {C Function} scm_slot_set_using_class_x (class, obj, slot_name, value)
2003
2004 @end deffn
2005
2006 \fslot-bound-using-class?
2007 @c snarfed from goops.c:1394
2008 @deffn {Scheme Procedure} slot-bound-using-class? class obj slot_name
2009 @deffnx {C Function} scm_slot_bound_using_class_p (class, obj, slot_name)
2010
2011 @end deffn
2012
2013 \fslot-exists-using-class?
2014 @c snarfed from goops.c:1409
2015 @deffn {Scheme Procedure} slot-exists-using-class? class obj slot_name
2016 @deffnx {C Function} scm_slot_exists_using_class_p (class, obj, slot_name)
2017
2018 @end deffn
2019
2020 \fslot-ref
2021 @c snarfed from goops.c:1425
2022 @deffn {Scheme Procedure} slot-ref obj slot_name
2023 @deffnx {C Function} scm_slot_ref (obj, slot_name)
2024 Return the value from @var{obj}'s slot with the name
2025 @var{slot_name}.
2026 @end deffn
2027
2028 \fslot-set!
2029 @c snarfed from goops.c:1442
2030 @deffn {Scheme Procedure} slot-set! obj slot_name value
2031 @deffnx {C Function} scm_slot_set_x (obj, slot_name, value)
2032 Set the slot named @var{slot_name} of @var{obj} to @var{value}.
2033 @end deffn
2034
2035 \fslot-bound?
2036 @c snarfed from goops.c:1459
2037 @deffn {Scheme Procedure} slot-bound? obj slot_name
2038 @deffnx {C Function} scm_slot_bound_p (obj, slot_name)
2039 Return @code{#t} if the slot named @var{slot_name} of @var{obj}
2040 is bound.
2041 @end deffn
2042
2043 \fslot-exists?
2044 @c snarfed from goops.c:1477
2045 @deffn {Scheme Procedure} slot-exists? obj slot_name
2046 @deffnx {C Function} scm_slot_exists_p (obj, slot_name)
2047 Return @code{#t} if @var{obj} has a slot named @var{slot_name}.
2048 @end deffn
2049
2050 \f%allocate-instance
2051 @c snarfed from goops.c:1516
2052 @deffn {Scheme Procedure} %allocate-instance class initargs
2053 @deffnx {C Function} scm_sys_allocate_instance (class, initargs)
2054 Create a new instance of class @var{class} and initialize it
2055 from the arguments @var{initargs}.
2056 @end deffn
2057
2058 \f%set-object-setter!
2059 @c snarfed from goops.c:1586
2060 @deffn {Scheme Procedure} %set-object-setter! obj setter
2061 @deffnx {C Function} scm_sys_set_object_setter_x (obj, setter)
2062
2063 @end deffn
2064
2065 \f%modify-instance
2066 @c snarfed from goops.c:1611
2067 @deffn {Scheme Procedure} %modify-instance old new
2068 @deffnx {C Function} scm_sys_modify_instance (old, new)
2069
2070 @end deffn
2071
2072 \f%modify-class
2073 @c snarfed from goops.c:1637
2074 @deffn {Scheme Procedure} %modify-class old new
2075 @deffnx {C Function} scm_sys_modify_class (old, new)
2076
2077 @end deffn
2078
2079 \f%invalidate-class
2080 @c snarfed from goops.c:1661
2081 @deffn {Scheme Procedure} %invalidate-class class
2082 @deffnx {C Function} scm_sys_invalidate_class (class)
2083
2084 @end deffn
2085
2086 \f%invalidate-method-cache!
2087 @c snarfed from goops.c:1783
2088 @deffn {Scheme Procedure} %invalidate-method-cache! gf
2089 @deffnx {C Function} scm_sys_invalidate_method_cache_x (gf)
2090
2091 @end deffn
2092
2093 \fgeneric-capability?
2094 @c snarfed from goops.c:1809
2095 @deffn {Scheme Procedure} generic-capability? proc
2096 @deffnx {C Function} scm_generic_capability_p (proc)
2097
2098 @end deffn
2099
2100 \fenable-primitive-generic!
2101 @c snarfed from goops.c:1822
2102 @deffn {Scheme Procedure} enable-primitive-generic! . subrs
2103 @deffnx {C Function} scm_enable_primitive_generic_x (subrs)
2104
2105 @end deffn
2106
2107 \fprimitive-generic-generic
2108 @c snarfed from goops.c:1843
2109 @deffn {Scheme Procedure} primitive-generic-generic subr
2110 @deffnx {C Function} scm_primitive_generic_generic (subr)
2111
2112 @end deffn
2113
2114 \fmake
2115 @c snarfed from goops.c:2209
2116 @deffn {Scheme Procedure} make . args
2117 @deffnx {C Function} scm_make (args)
2118 Make a new object. @var{args} must contain the class and
2119 all necessary initialization information.
2120 @end deffn
2121
2122 \ffind-method
2123 @c snarfed from goops.c:2298
2124 @deffn {Scheme Procedure} find-method . l
2125 @deffnx {C Function} scm_find_method (l)
2126
2127 @end deffn
2128
2129 \f%method-more-specific?
2130 @c snarfed from goops.c:2318
2131 @deffn {Scheme Procedure} %method-more-specific? m1 m2 targs
2132 @deffnx {C Function} scm_sys_method_more_specific_p (m1, m2, targs)
2133 Return true if method @var{m1} is more specific than @var{m2} given the argument types (classes) listed in @var{targs}.
2134 @end deffn
2135
2136 \f%goops-loaded
2137 @c snarfed from goops.c:2944
2138 @deffn {Scheme Procedure} %goops-loaded
2139 @deffnx {C Function} scm_sys_goops_loaded ()
2140 Announce that GOOPS is loaded and perform initialization
2141 on the C level which depends on the loaded GOOPS modules.
2142 @end deffn
2143
2144 \fmake-guardian
2145 @c snarfed from guardians.c:307
2146 @deffn {Scheme Procedure} make-guardian [greedy_p]
2147 @deffnx {C Function} scm_make_guardian (greedy_p)
2148 Create a new guardian.
2149 A guardian protects a set of objects from garbage collection,
2150 allowing a program to apply cleanup or other actions.
2151
2152 @code{make-guardian} returns a procedure representing the guardian.
2153 Calling the guardian procedure with an argument adds the
2154 argument to the guardian's set of protected objects.
2155 Calling the guardian procedure without an argument returns
2156 one of the protected objects which are ready for garbage
2157 collection, or @code{#f} if no such object is available.
2158 Objects which are returned in this way are removed from
2159 the guardian.
2160
2161 @code{make-guardian} takes one optional argument that says whether the
2162 new guardian should be greedy or sharing. If there is any chance
2163 that any object protected by the guardian may be resurrected,
2164 then you should make the guardian greedy (this is the default).
2165
2166 See R. Kent Dybvig, Carl Bruggeman, and David Eby (1993)
2167 "Guardians in a Generation-Based Garbage Collector".
2168 ACM SIGPLAN Conference on Programming Language Design
2169 and Implementation, June 1993.
2170
2171 (the semantics are slightly different at this point, but the
2172 paper still (mostly) accurately describes the interface).
2173 @end deffn
2174
2175 \fguardian-destroyed?
2176 @c snarfed from guardians.c:335
2177 @deffn {Scheme Procedure} guardian-destroyed? guardian
2178 @deffnx {C Function} scm_guardian_destroyed_p (guardian)
2179 Return @code{#t} if @var{guardian} has been destroyed, otherwise @code{#f}.
2180 @end deffn
2181
2182 \fguardian-greedy?
2183 @c snarfed from guardians.c:353
2184 @deffn {Scheme Procedure} guardian-greedy? guardian
2185 @deffnx {C Function} scm_guardian_greedy_p (guardian)
2186 Return @code{#t} if @var{guardian} is a greedy guardian, otherwise @code{#f}.
2187 @end deffn
2188
2189 \fdestroy-guardian!
2190 @c snarfed from guardians.c:364
2191 @deffn {Scheme Procedure} destroy-guardian! guardian
2192 @deffnx {C Function} scm_destroy_guardian_x (guardian)
2193 Destroys @var{guardian}, by making it impossible to put any more
2194 objects in it or get any objects from it. It also unguards any
2195 objects guarded by @var{guardian}.
2196 @end deffn
2197
2198 \fhashq
2199 @c snarfed from hash.c:183
2200 @deffn {Scheme Procedure} hashq key size
2201 @deffnx {C Function} scm_hashq (key, size)
2202 Determine a hash value for @var{key} that is suitable for
2203 lookups in a hashtable of size @var{size}, where @code{eq?} is
2204 used as the equality predicate. The function returns an
2205 integer in the range 0 to @var{size} - 1. Note that
2206 @code{hashq} may use internal addresses. Thus two calls to
2207 hashq where the keys are @code{eq?} are not guaranteed to
2208 deliver the same value if the key object gets garbage collected
2209 in between. This can happen, for example with symbols:
2210 @code{(hashq 'foo n) (gc) (hashq 'foo n)} may produce two
2211 different values, since @code{foo} will be garbage collected.
2212 @end deffn
2213
2214 \fhashv
2215 @c snarfed from hash.c:219
2216 @deffn {Scheme Procedure} hashv key size
2217 @deffnx {C Function} scm_hashv (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{eqv?} 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{(hashv key)} may use internal addresses. Thus two calls
2223 to hashv where the keys are @code{eqv?} 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{(hashv 'foo n) (gc) (hashv 'foo n)} may produce two
2227 different values, since @code{foo} will be garbage collected.
2228 @end deffn
2229
2230 \fhash
2231 @c snarfed from hash.c:242
2232 @deffn {Scheme Procedure} hash key size
2233 @deffnx {C Function} scm_hash (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{equal?}
2236 is used as the equality predicate. The function returns an
2237 integer in the range 0 to @var{size} - 1.
2238 @end deffn
2239
2240 \fmake-hash-table
2241 @c snarfed from hashtab.c:332
2242 @deffn {Scheme Procedure} make-hash-table [n]
2243 @deffnx {C Function} scm_make_hash_table (n)
2244 Make a new abstract hash table object with minimum number of buckets @var{n}
2245
2246 @end deffn
2247
2248 \fmake-weak-key-hash-table
2249 @c snarfed from hashtab.c:349
2250 @deffn {Scheme Procedure} make-weak-key-hash-table [n]
2251 @deffnx {Scheme Procedure} make-weak-value-hash-table size
2252 @deffnx {Scheme Procedure} make-doubly-weak-hash-table size
2253 @deffnx {C Function} scm_make_weak_key_hash_table (n)
2254 Return a weak hash table with @var{size} buckets.
2255
2256 You can modify weak hash tables in exactly the same way you
2257 would modify regular hash tables. (@pxref{Hash Tables})
2258 @end deffn
2259
2260 \fmake-weak-value-hash-table
2261 @c snarfed from hashtab.c:364
2262 @deffn {Scheme Procedure} make-weak-value-hash-table [n]
2263 @deffnx {C Function} scm_make_weak_value_hash_table (n)
2264 Return a hash table with weak values with @var{size} buckets.
2265 (@pxref{Hash Tables})
2266 @end deffn
2267
2268 \fmake-doubly-weak-hash-table
2269 @c snarfed from hashtab.c:381
2270 @deffn {Scheme Procedure} make-doubly-weak-hash-table n
2271 @deffnx {C Function} scm_make_doubly_weak_hash_table (n)
2272 Return a hash table with weak keys and values with @var{size}
2273 buckets. (@pxref{Hash Tables})
2274 @end deffn
2275
2276 \fhash-table?
2277 @c snarfed from hashtab.c:400
2278 @deffn {Scheme Procedure} hash-table? obj
2279 @deffnx {C Function} scm_hash_table_p (obj)
2280 Return @code{#t} if @var{obj} is an abstract hash table object.
2281 @end deffn
2282
2283 \fweak-key-hash-table?
2284 @c snarfed from hashtab.c:414
2285 @deffn {Scheme Procedure} weak-key-hash-table? obj
2286 @deffnx {Scheme Procedure} weak-value-hash-table? obj
2287 @deffnx {Scheme Procedure} doubly-weak-hash-table? obj
2288 @deffnx {C Function} scm_weak_key_hash_table_p (obj)
2289 Return @code{#t} if @var{obj} is the specified weak hash
2290 table. Note that a doubly weak hash table is neither a weak key
2291 nor a weak value hash table.
2292 @end deffn
2293
2294 \fweak-value-hash-table?
2295 @c snarfed from hashtab.c:424
2296 @deffn {Scheme Procedure} weak-value-hash-table? obj
2297 @deffnx {C Function} scm_weak_value_hash_table_p (obj)
2298 Return @code{#t} if @var{obj} is a weak value hash table.
2299 @end deffn
2300
2301 \fdoubly-weak-hash-table?
2302 @c snarfed from hashtab.c:434
2303 @deffn {Scheme Procedure} doubly-weak-hash-table? obj
2304 @deffnx {C Function} scm_doubly_weak_hash_table_p (obj)
2305 Return @code{#t} if @var{obj} is a doubly weak hash table.
2306 @end deffn
2307
2308 \fhash-clear!
2309 @c snarfed from hashtab.c:586
2310 @deffn {Scheme Procedure} hash-clear! table
2311 @deffnx {C Function} scm_hash_clear_x (table)
2312 Remove all items from @var{table} (without triggering a resize).
2313 @end deffn
2314
2315 \fhashq-get-handle
2316 @c snarfed from hashtab.c:607
2317 @deffn {Scheme Procedure} hashq-get-handle table key
2318 @deffnx {C Function} scm_hashq_get_handle (table, key)
2319 This procedure returns the @code{(key . value)} pair from the
2320 hash table @var{table}. If @var{table} does not hold an
2321 associated value for @var{key}, @code{#f} is returned.
2322 Uses @code{eq?} for equality testing.
2323 @end deffn
2324
2325 \fhashq-create-handle!
2326 @c snarfed from hashtab.c:619
2327 @deffn {Scheme Procedure} hashq-create-handle! table key init
2328 @deffnx {C Function} scm_hashq_create_handle_x (table, key, init)
2329 This function looks up @var{key} in @var{table} and returns its handle.
2330 If @var{key} is not already present, a new handle is created which
2331 associates @var{key} with @var{init}.
2332 @end deffn
2333
2334 \fhashq-ref
2335 @c snarfed from hashtab.c:632
2336 @deffn {Scheme Procedure} hashq-ref table key [dflt]
2337 @deffnx {C Function} scm_hashq_ref (table, key, dflt)
2338 Look up @var{key} in the hash table @var{table}, and return the
2339 value (if any) associated with it. If @var{key} is not found,
2340 return @var{default} (or @code{#f} if no @var{default} argument
2341 is supplied). Uses @code{eq?} for equality testing.
2342 @end deffn
2343
2344 \fhashq-set!
2345 @c snarfed from hashtab.c:646
2346 @deffn {Scheme Procedure} hashq-set! table key val
2347 @deffnx {C Function} scm_hashq_set_x (table, key, val)
2348 Find the entry in @var{table} associated with @var{key}, and
2349 store @var{value} there. Uses @code{eq?} for equality testing.
2350 @end deffn
2351
2352 \fhashq-remove!
2353 @c snarfed from hashtab.c:658
2354 @deffn {Scheme Procedure} hashq-remove! table key
2355 @deffnx {C Function} scm_hashq_remove_x (table, key)
2356 Remove @var{key} (and any value associated with it) from
2357 @var{table}. Uses @code{eq?} for equality tests.
2358 @end deffn
2359
2360 \fhashv-get-handle
2361 @c snarfed from hashtab.c:673
2362 @deffn {Scheme Procedure} hashv-get-handle table key
2363 @deffnx {C Function} scm_hashv_get_handle (table, key)
2364 This procedure returns the @code{(key . value)} pair from the
2365 hash table @var{table}. If @var{table} does not hold an
2366 associated value for @var{key}, @code{#f} is returned.
2367 Uses @code{eqv?} for equality testing.
2368 @end deffn
2369
2370 \fhashv-create-handle!
2371 @c snarfed from hashtab.c:685
2372 @deffn {Scheme Procedure} hashv-create-handle! table key init
2373 @deffnx {C Function} scm_hashv_create_handle_x (table, key, init)
2374 This function looks up @var{key} in @var{table} and returns its handle.
2375 If @var{key} is not already present, a new handle is created which
2376 associates @var{key} with @var{init}.
2377 @end deffn
2378
2379 \fhashv-ref
2380 @c snarfed from hashtab.c:699
2381 @deffn {Scheme Procedure} hashv-ref table key [dflt]
2382 @deffnx {C Function} scm_hashv_ref (table, key, dflt)
2383 Look up @var{key} in the hash table @var{table}, and return the
2384 value (if any) associated with it. If @var{key} is not found,
2385 return @var{default} (or @code{#f} if no @var{default} argument
2386 is supplied). Uses @code{eqv?} for equality testing.
2387 @end deffn
2388
2389 \fhashv-set!
2390 @c snarfed from hashtab.c:713
2391 @deffn {Scheme Procedure} hashv-set! table key val
2392 @deffnx {C Function} scm_hashv_set_x (table, key, val)
2393 Find the entry in @var{table} associated with @var{key}, and
2394 store @var{value} there. Uses @code{eqv?} for equality testing.
2395 @end deffn
2396
2397 \fhashv-remove!
2398 @c snarfed from hashtab.c:724
2399 @deffn {Scheme Procedure} hashv-remove! table key
2400 @deffnx {C Function} scm_hashv_remove_x (table, key)
2401 Remove @var{key} (and any value associated with it) from
2402 @var{table}. Uses @code{eqv?} for equality tests.
2403 @end deffn
2404
2405 \fhash-get-handle
2406 @c snarfed from hashtab.c:738
2407 @deffn {Scheme Procedure} hash-get-handle table key
2408 @deffnx {C Function} scm_hash_get_handle (table, key)
2409 This procedure returns the @code{(key . value)} pair from the
2410 hash table @var{table}. If @var{table} does not hold an
2411 associated value for @var{key}, @code{#f} is returned.
2412 Uses @code{equal?} for equality testing.
2413 @end deffn
2414
2415 \fhash-create-handle!
2416 @c snarfed from hashtab.c:750
2417 @deffn {Scheme Procedure} hash-create-handle! table key init
2418 @deffnx {C Function} scm_hash_create_handle_x (table, key, init)
2419 This function looks up @var{key} in @var{table} and returns its handle.
2420 If @var{key} is not already present, a new handle is created which
2421 associates @var{key} with @var{init}.
2422 @end deffn
2423
2424 \fhash-ref
2425 @c snarfed from hashtab.c:763
2426 @deffn {Scheme Procedure} hash-ref table key [dflt]
2427 @deffnx {C Function} scm_hash_ref (table, key, dflt)
2428 Look up @var{key} in the hash table @var{table}, and return the
2429 value (if any) associated with it. If @var{key} is not found,
2430 return @var{default} (or @code{#f} if no @var{default} argument
2431 is supplied). Uses @code{equal?} for equality testing.
2432 @end deffn
2433
2434 \fhash-set!
2435 @c snarfed from hashtab.c:778
2436 @deffn {Scheme Procedure} hash-set! table key val
2437 @deffnx {C Function} scm_hash_set_x (table, key, val)
2438 Find the entry in @var{table} associated with @var{key}, and
2439 store @var{value} there. Uses @code{equal?} for equality
2440 testing.
2441 @end deffn
2442
2443 \fhash-remove!
2444 @c snarfed from hashtab.c:790
2445 @deffn {Scheme Procedure} hash-remove! table key
2446 @deffnx {C Function} scm_hash_remove_x (table, key)
2447 Remove @var{key} (and any value associated with it) from
2448 @var{table}. Uses @code{equal?} for equality tests.
2449 @end deffn
2450
2451 \fhashx-get-handle
2452 @c snarfed from hashtab.c:831
2453 @deffn {Scheme Procedure} hashx-get-handle hash assoc table key
2454 @deffnx {C Function} scm_hashx_get_handle (hash, assoc, table, key)
2455 This behaves the same way as the corresponding
2456 @code{-get-handle} function, but uses @var{hash} as a hash
2457 function and @var{assoc} to compare keys. @code{hash} must be
2458 a function that takes two arguments, a key to be hashed and a
2459 table size. @code{assoc} must be an associator function, like
2460 @code{assoc}, @code{assq} or @code{assv}.
2461 @end deffn
2462
2463 \fhashx-create-handle!
2464 @c snarfed from hashtab.c:850
2465 @deffn {Scheme Procedure} hashx-create-handle! hash assoc table key init
2466 @deffnx {C Function} scm_hashx_create_handle_x (hash, assoc, table, key, init)
2467 This behaves the same way as the corresponding
2468 @code{-create-handle} function, but uses @var{hash} as a hash
2469 function and @var{assoc} to compare keys. @code{hash} must be
2470 a function that takes two arguments, a key to be hashed and a
2471 table size. @code{assoc} must be an associator function, like
2472 @code{assoc}, @code{assq} or @code{assv}.
2473 @end deffn
2474
2475 \fhashx-ref
2476 @c snarfed from hashtab.c:873
2477 @deffn {Scheme Procedure} hashx-ref hash assoc table key [dflt]
2478 @deffnx {C Function} scm_hashx_ref (hash, assoc, table, key, dflt)
2479 This behaves the same way as the corresponding @code{ref}
2480 function, but uses @var{hash} as a hash function and
2481 @var{assoc} to compare keys. @code{hash} must be a function
2482 that takes two arguments, a key to be hashed and a table size.
2483 @code{assoc} must be an associator function, like @code{assoc},
2484 @code{assq} or @code{assv}.
2485
2486 By way of illustration, @code{hashq-ref table key} is
2487 equivalent to @code{hashx-ref hashq assq table key}.
2488 @end deffn
2489
2490 \fhashx-set!
2491 @c snarfed from hashtab.c:899
2492 @deffn {Scheme Procedure} hashx-set! hash assoc table key val
2493 @deffnx {C Function} scm_hashx_set_x (hash, assoc, table, key, val)
2494 This behaves the same way as the corresponding @code{set!}
2495 function, but uses @var{hash} as a hash function and
2496 @var{assoc} to compare keys. @code{hash} must be a function
2497 that takes two arguments, a key to be hashed and a table size.
2498 @code{assoc} must be an associator function, like @code{assoc},
2499 @code{assq} or @code{assv}.
2500
2501 By way of illustration, @code{hashq-set! table key} is
2502 equivalent to @code{hashx-set! hashq assq table key}.
2503 @end deffn
2504
2505 \fhashx-remove!
2506 @c snarfed from hashtab.c:920
2507 @deffn {Scheme Procedure} hashx-remove! hash assoc table obj
2508 @deffnx {C Function} scm_hashx_remove_x (hash, assoc, table, obj)
2509 This behaves the same way as the corresponding @code{remove!}
2510 function, but uses @var{hash} as a hash function and
2511 @var{assoc} to compare keys. @code{hash} must be a function
2512 that takes two arguments, a key to be hashed and a table size.
2513 @code{assoc} must be an associator function, like @code{assoc},
2514 @code{assq} or @code{assv}.
2515
2516 By way of illustration, @code{hashq-remove! table key} is
2517 equivalent to @code{hashx-remove! hashq assq #f table key}.
2518 @end deffn
2519
2520 \fhash-fold
2521 @c snarfed from hashtab.c:1009
2522 @deffn {Scheme Procedure} hash-fold proc init table
2523 @deffnx {C Function} scm_hash_fold (proc, init, table)
2524 An iterator over hash-table elements.
2525 Accumulates and returns a result by applying PROC successively.
2526 The arguments to PROC are "(key value prior-result)" where key
2527 and value are successive pairs from the hash table TABLE, and
2528 prior-result is either INIT (for the first application of PROC)
2529 or the return value of the previous application of PROC.
2530 For example, @code{(hash-fold acons '() tab)} will convert a hash
2531 table into an a-list of key-value pairs.
2532 @end deffn
2533
2534 \fhash-for-each
2535 @c snarfed from hashtab.c:1030
2536 @deffn {Scheme Procedure} hash-for-each proc table
2537 @deffnx {C Function} scm_hash_for_each (proc, table)
2538 An iterator over hash-table elements.
2539 Applies PROC successively on all hash table items.
2540 The arguments to PROC are "(key value)" where key
2541 and value are successive pairs from the hash table TABLE.
2542 @end deffn
2543
2544 \fhash-for-each-handle
2545 @c snarfed from hashtab.c:1047
2546 @deffn {Scheme Procedure} hash-for-each-handle proc table
2547 @deffnx {C Function} scm_hash_for_each_handle (proc, table)
2548 An iterator over hash-table elements.
2549 Applies PROC successively on all hash table handles.
2550 @end deffn
2551
2552 \fhash-map->list
2553 @c snarfed from hashtab.c:1073
2554 @deffn {Scheme Procedure} hash-map->list proc table
2555 @deffnx {C Function} scm_hash_map_to_list (proc, table)
2556 An iterator over hash-table elements.
2557 Accumulates and returns as a list the results of applying PROC successively.
2558 The arguments to PROC are "(key value)" where key
2559 and value are successive pairs from the hash table TABLE.
2560 @end deffn
2561
2562 \fmake-hook
2563 @c snarfed from hooks.c:154
2564 @deffn {Scheme Procedure} make-hook [n_args]
2565 @deffnx {C Function} scm_make_hook (n_args)
2566 Create a hook for storing procedure of arity @var{n_args}.
2567 @var{n_args} defaults to zero. The returned value is a hook
2568 object to be used with the other hook procedures.
2569 @end deffn
2570
2571 \fhook?
2572 @c snarfed from hooks.c:171
2573 @deffn {Scheme Procedure} hook? x
2574 @deffnx {C Function} scm_hook_p (x)
2575 Return @code{#t} if @var{x} is a hook, @code{#f} otherwise.
2576 @end deffn
2577
2578 \fhook-empty?
2579 @c snarfed from hooks.c:182
2580 @deffn {Scheme Procedure} hook-empty? hook
2581 @deffnx {C Function} scm_hook_empty_p (hook)
2582 Return @code{#t} if @var{hook} is an empty hook, @code{#f}
2583 otherwise.
2584 @end deffn
2585
2586 \fadd-hook!
2587 @c snarfed from hooks.c:196
2588 @deffn {Scheme Procedure} add-hook! hook proc [append_p]
2589 @deffnx {C Function} scm_add_hook_x (hook, proc, append_p)
2590 Add the procedure @var{proc} to the hook @var{hook}. The
2591 procedure is added to the end if @var{append_p} is true,
2592 otherwise it is added to the front. The return value of this
2593 procedure is not specified.
2594 @end deffn
2595
2596 \fremove-hook!
2597 @c snarfed from hooks.c:223
2598 @deffn {Scheme Procedure} remove-hook! hook proc
2599 @deffnx {C Function} scm_remove_hook_x (hook, proc)
2600 Remove the procedure @var{proc} from the hook @var{hook}. The
2601 return value of this procedure is not specified.
2602 @end deffn
2603
2604 \freset-hook!
2605 @c snarfed from hooks.c:237
2606 @deffn {Scheme Procedure} reset-hook! hook
2607 @deffnx {C Function} scm_reset_hook_x (hook)
2608 Remove all procedures from the hook @var{hook}. The return
2609 value of this procedure is not specified.
2610 @end deffn
2611
2612 \frun-hook
2613 @c snarfed from hooks.c:251
2614 @deffn {Scheme Procedure} run-hook hook . args
2615 @deffnx {C Function} scm_run_hook (hook, args)
2616 Apply all procedures from the hook @var{hook} to the arguments
2617 @var{args}. The order of the procedure application is first to
2618 last. The return value of this procedure is not specified.
2619 @end deffn
2620
2621 \fhook->list
2622 @c snarfed from hooks.c:278
2623 @deffn {Scheme Procedure} hook->list hook
2624 @deffnx {C Function} scm_hook_to_list (hook)
2625 Convert the procedure list of @var{hook} to a list.
2626 @end deffn
2627
2628 \fgettext
2629 @c snarfed from i18n.c:90
2630 @deffn {Scheme Procedure} gettext msgid [domain [category]]
2631 @deffnx {C Function} scm_gettext (msgid, domain, category)
2632 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.
2633 @end deffn
2634
2635 \fngettext
2636 @c snarfed from i18n.c:146
2637 @deffn {Scheme Procedure} ngettext msgid msgid_plural n [domain [category]]
2638 @deffnx {C Function} scm_ngettext (msgid, msgid_plural, n, domain, category)
2639 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.
2640 @end deffn
2641
2642 \ftextdomain
2643 @c snarfed from i18n.c:209
2644 @deffn {Scheme Procedure} textdomain [domainname]
2645 @deffnx {C Function} scm_textdomain (domainname)
2646 If optional parameter @var{domainname} is supplied, set the textdomain. Return the textdomain.
2647 @end deffn
2648
2649 \fbindtextdomain
2650 @c snarfed from i18n.c:241
2651 @deffn {Scheme Procedure} bindtextdomain domainname [directory]
2652 @deffnx {C Function} scm_bindtextdomain (domainname, directory)
2653 If optional parameter @var{directory} is supplied, set message catalogs to directory @var{directory}. Return the directory bound to @var{domainname}.
2654 @end deffn
2655
2656 \fbind-textdomain-codeset
2657 @c snarfed from i18n.c:280
2658 @deffn {Scheme Procedure} bind-textdomain-codeset domainname [encoding]
2659 @deffnx {C Function} scm_bind_textdomain_codeset (domainname, encoding)
2660 If optional parameter @var{encoding} is supplied, set encoding for message catalogs of @var{domainname}. Return the encoding of @var{domainname}.
2661 @end deffn
2662
2663 \fftell
2664 @c snarfed from ioext.c:54
2665 @deffn {Scheme Procedure} ftell fd_port
2666 @deffnx {C Function} scm_ftell (fd_port)
2667 Return an integer representing the current position of
2668 @var{fd/port}, measured from the beginning. Equivalent to:
2669
2670 @lisp
2671 (seek port 0 SEEK_CUR)
2672 @end lisp
2673 @end deffn
2674
2675 \fredirect-port
2676 @c snarfed from ioext.c:72
2677 @deffn {Scheme Procedure} redirect-port old new
2678 @deffnx {C Function} scm_redirect_port (old, new)
2679 This procedure takes two ports and duplicates the underlying file
2680 descriptor from @var{old-port} into @var{new-port}. The
2681 current file descriptor in @var{new-port} will be closed.
2682 After the redirection the two ports will share a file position
2683 and file status flags.
2684
2685 The return value is unspecified.
2686
2687 Unexpected behaviour can result if both ports are subsequently used
2688 and the original and/or duplicate ports are buffered.
2689
2690 This procedure does not have any side effects on other ports or
2691 revealed counts.
2692 @end deffn
2693
2694 \fdup->fdes
2695 @c snarfed from ioext.c:111
2696 @deffn {Scheme Procedure} dup->fdes fd_or_port [fd]
2697 @deffnx {C Function} scm_dup_to_fdes (fd_or_port, fd)
2698 Return a new integer file descriptor referring to the open file
2699 designated by @var{fd_or_port}, which must be either an open
2700 file port or a file descriptor.
2701 @end deffn
2702
2703 \fdup2
2704 @c snarfed from ioext.c:158
2705 @deffn {Scheme Procedure} dup2 oldfd newfd
2706 @deffnx {C Function} scm_dup2 (oldfd, newfd)
2707 A simple wrapper for the @code{dup2} system call.
2708 Copies the file descriptor @var{oldfd} to descriptor
2709 number @var{newfd}, replacing the previous meaning
2710 of @var{newfd}. Both @var{oldfd} and @var{newfd} must
2711 be integers.
2712 Unlike for dup->fdes or primitive-move->fdes, no attempt
2713 is made to move away ports which are using @var{newfd}.
2714 The return value is unspecified.
2715 @end deffn
2716
2717 \ffileno
2718 @c snarfed from ioext.c:177
2719 @deffn {Scheme Procedure} fileno port
2720 @deffnx {C Function} scm_fileno (port)
2721 Return the integer file descriptor underlying @var{port}. Does
2722 not change its revealed count.
2723 @end deffn
2724
2725 \fisatty?
2726 @c snarfed from ioext.c:197
2727 @deffn {Scheme Procedure} isatty? port
2728 @deffnx {C Function} scm_isatty_p (port)
2729 Return @code{#t} if @var{port} is using a serial non--file
2730 device, otherwise @code{#f}.
2731 @end deffn
2732
2733 \ffdopen
2734 @c snarfed from ioext.c:219
2735 @deffn {Scheme Procedure} fdopen fdes modes
2736 @deffnx {C Function} scm_fdopen (fdes, modes)
2737 Return a new port based on the file descriptor @var{fdes}.
2738 Modes are given by the string @var{modes}. The revealed count
2739 of the port is initialized to zero. The modes string is the
2740 same as that accepted by @ref{File Ports, open-file}.
2741 @end deffn
2742
2743 \fprimitive-move->fdes
2744 @c snarfed from ioext.c:241
2745 @deffn {Scheme Procedure} primitive-move->fdes port fd
2746 @deffnx {C Function} scm_primitive_move_to_fdes (port, fd)
2747 Moves the underlying file descriptor for @var{port} to the integer
2748 value @var{fdes} without changing the revealed count of @var{port}.
2749 Any other ports already using this descriptor will be automatically
2750 shifted to new descriptors and their revealed counts reset to zero.
2751 The return value is @code{#f} if the file descriptor already had the
2752 required value or @code{#t} if it was moved.
2753 @end deffn
2754
2755 \ffdes->ports
2756 @c snarfed from ioext.c:274
2757 @deffn {Scheme Procedure} fdes->ports fd
2758 @deffnx {C Function} scm_fdes_to_ports (fd)
2759 Return a list of existing ports which have @var{fdes} as an
2760 underlying file descriptor, without changing their revealed
2761 counts.
2762 @end deffn
2763
2764 \fkeyword?
2765 @c snarfed from keywords.c:52
2766 @deffn {Scheme Procedure} keyword? obj
2767 @deffnx {C Function} scm_keyword_p (obj)
2768 Return @code{#t} if the argument @var{obj} is a keyword, else
2769 @code{#f}.
2770 @end deffn
2771
2772 \fsymbol->keyword
2773 @c snarfed from keywords.c:61
2774 @deffn {Scheme Procedure} symbol->keyword symbol
2775 @deffnx {C Function} scm_symbol_to_keyword (symbol)
2776 Return the keyword with the same name as @var{symbol}.
2777 @end deffn
2778
2779 \fkeyword->symbol
2780 @c snarfed from keywords.c:82
2781 @deffn {Scheme Procedure} keyword->symbol keyword
2782 @deffnx {C Function} scm_keyword_to_symbol (keyword)
2783 Return the symbol with the same name as @var{keyword}.
2784 @end deffn
2785
2786 \flist
2787 @c snarfed from list.c:104
2788 @deffn {Scheme Procedure} list . objs
2789 @deffnx {C Function} scm_list (objs)
2790 Return a list containing @var{objs}, the arguments to
2791 @code{list}.
2792 @end deffn
2793
2794 \fcons*
2795 @c snarfed from list.c:119
2796 @deffn {Scheme Procedure} cons* arg . rest
2797 @deffnx {C Function} scm_cons_star (arg, rest)
2798 Like @code{list}, but the last arg provides the tail of the
2799 constructed list, returning @code{(cons @var{arg1} (cons
2800 @var{arg2} (cons @dots{} @var{argn})))}. Requires at least one
2801 argument. If given one argument, that argument is returned as
2802 result. This function is called @code{list*} in some other
2803 Schemes and in Common LISP.
2804 @end deffn
2805
2806 \fnull?
2807 @c snarfed from list.c:143
2808 @deffn {Scheme Procedure} null? x
2809 @deffnx {C Function} scm_null_p (x)
2810 Return @code{#t} iff @var{x} is the empty list, else @code{#f}.
2811 @end deffn
2812
2813 \flist?
2814 @c snarfed from list.c:153
2815 @deffn {Scheme Procedure} list? x
2816 @deffnx {C Function} scm_list_p (x)
2817 Return @code{#t} iff @var{x} is a proper list, else @code{#f}.
2818 @end deffn
2819
2820 \flength
2821 @c snarfed from list.c:194
2822 @deffn {Scheme Procedure} length lst
2823 @deffnx {C Function} scm_length (lst)
2824 Return the number of elements in list @var{lst}.
2825 @end deffn
2826
2827 \fappend
2828 @c snarfed from list.c:223
2829 @deffn {Scheme Procedure} append . args
2830 @deffnx {C Function} scm_append (args)
2831 Return a list consisting of the elements the lists passed as
2832 arguments.
2833 @lisp
2834 (append '(x) '(y)) @result{} (x y)
2835 (append '(a) '(b c d)) @result{} (a b c d)
2836 (append '(a (b)) '((c))) @result{} (a (b) (c))
2837 @end lisp
2838 The resulting list is always newly allocated, except that it
2839 shares structure with the last list argument. The last
2840 argument may actually be any object; an improper list results
2841 if the last argument is not a proper list.
2842 @lisp
2843 (append '(a b) '(c . d)) @result{} (a b c . d)
2844 (append '() 'a) @result{} a
2845 @end lisp
2846 @end deffn
2847
2848 \fappend!
2849 @c snarfed from list.c:259
2850 @deffn {Scheme Procedure} append! . lists
2851 @deffnx {C Function} scm_append_x (lists)
2852 A destructive version of @code{append} (@pxref{Pairs and
2853 Lists,,,r5rs, The Revised^5 Report on Scheme}). The cdr field
2854 of each list's final pair is changed to point to the head of
2855 the next list, so no consing is performed. Return
2856 the mutated list.
2857 @end deffn
2858
2859 \flast-pair
2860 @c snarfed from list.c:291
2861 @deffn {Scheme Procedure} last-pair lst
2862 @deffnx {C Function} scm_last_pair (lst)
2863 Return the last pair in @var{lst}, signalling an error if
2864 @var{lst} is circular.
2865 @end deffn
2866
2867 \freverse
2868 @c snarfed from list.c:321
2869 @deffn {Scheme Procedure} reverse lst
2870 @deffnx {C Function} scm_reverse (lst)
2871 Return a new list that contains the elements of @var{lst} but
2872 in reverse order.
2873 @end deffn
2874
2875 \freverse!
2876 @c snarfed from list.c:355
2877 @deffn {Scheme Procedure} reverse! lst [new_tail]
2878 @deffnx {C Function} scm_reverse_x (lst, new_tail)
2879 A destructive version of @code{reverse} (@pxref{Pairs and Lists,,,r5rs,
2880 The Revised^5 Report on Scheme}). The cdr of each cell in @var{lst} is
2881 modified to point to the previous list element. Return the
2882 reversed list.
2883
2884 Caveat: because the list is modified in place, the tail of the original
2885 list now becomes its head, and the head of the original list now becomes
2886 the tail. Therefore, the @var{lst} symbol to which the head of the
2887 original list was bound now points to the tail. To ensure that the head
2888 of the modified list is not lost, it is wise to save the return value of
2889 @code{reverse!}
2890 @end deffn
2891
2892 \flist-ref
2893 @c snarfed from list.c:381
2894 @deffn {Scheme Procedure} list-ref list k
2895 @deffnx {C Function} scm_list_ref (list, k)
2896 Return the @var{k}th element from @var{list}.
2897 @end deffn
2898
2899 \flist-set!
2900 @c snarfed from list.c:405
2901 @deffn {Scheme Procedure} list-set! list k val
2902 @deffnx {C Function} scm_list_set_x (list, k, val)
2903 Set the @var{k}th element of @var{list} to @var{val}.
2904 @end deffn
2905
2906 \flist-cdr-ref
2907 @c snarfed from list.c:427
2908 @deffn {Scheme Procedure} list-cdr-ref
2909 implemented by the C function "scm_list_tail"
2910 @end deffn
2911
2912 \flist-tail
2913 @c snarfed from list.c:436
2914 @deffn {Scheme Procedure} list-tail lst k
2915 @deffnx {Scheme Procedure} list-cdr-ref lst k
2916 @deffnx {C Function} scm_list_tail (lst, k)
2917 Return the "tail" of @var{lst} beginning with its @var{k}th element.
2918 The first element of the list is considered to be element 0.
2919
2920 @code{list-tail} and @code{list-cdr-ref} are identical. It may help to
2921 think of @code{list-cdr-ref} as accessing the @var{k}th cdr of the list,
2922 or returning the results of cdring @var{k} times down @var{lst}.
2923 @end deffn
2924
2925 \flist-cdr-set!
2926 @c snarfed from list.c:451
2927 @deffn {Scheme Procedure} list-cdr-set! list k val
2928 @deffnx {C Function} scm_list_cdr_set_x (list, k, val)
2929 Set the @var{k}th cdr of @var{list} to @var{val}.
2930 @end deffn
2931
2932 \flist-head
2933 @c snarfed from list.c:479
2934 @deffn {Scheme Procedure} list-head lst k
2935 @deffnx {C Function} scm_list_head (lst, k)
2936 Copy the first @var{k} elements from @var{lst} into a new list, and
2937 return it.
2938 @end deffn
2939
2940 \flist-copy
2941 @c snarfed from list.c:530
2942 @deffn {Scheme Procedure} list-copy lst
2943 @deffnx {C Function} scm_list_copy (lst)
2944 Return a (newly-created) copy of @var{lst}.
2945 @end deffn
2946
2947 \fmemq
2948 @c snarfed from list.c:584
2949 @deffn {Scheme Procedure} memq x lst
2950 @deffnx {C Function} scm_memq (x, lst)
2951 Return the first sublist of @var{lst} whose car is @code{eq?}
2952 to @var{x} where the sublists of @var{lst} are the non-empty
2953 lists returned by @code{(list-tail @var{lst} @var{k})} for
2954 @var{k} less than the length of @var{lst}. If @var{x} does not
2955 occur in @var{lst}, then @code{#f} (not the empty list) is
2956 returned.
2957 @end deffn
2958
2959 \fmemv
2960 @c snarfed from list.c:600
2961 @deffn {Scheme Procedure} memv x lst
2962 @deffnx {C Function} scm_memv (x, lst)
2963 Return the first sublist of @var{lst} whose car is @code{eqv?}
2964 to @var{x} where the sublists of @var{lst} are the non-empty
2965 lists returned by @code{(list-tail @var{lst} @var{k})} for
2966 @var{k} less than the length of @var{lst}. If @var{x} does not
2967 occur in @var{lst}, then @code{#f} (not the empty list) is
2968 returned.
2969 @end deffn
2970
2971 \fmember
2972 @c snarfed from list.c:621
2973 @deffn {Scheme Procedure} member x lst
2974 @deffnx {C Function} scm_member (x, lst)
2975 Return the first sublist of @var{lst} whose car is
2976 @code{equal?} to @var{x} where the sublists of @var{lst} are
2977 the non-empty lists returned by @code{(list-tail @var{lst}
2978 @var{k})} for @var{k} less than the length of @var{lst}. If
2979 @var{x} does not occur in @var{lst}, then @code{#f} (not the
2980 empty list) is returned.
2981 @end deffn
2982
2983 \fdelq!
2984 @c snarfed from list.c:646
2985 @deffn {Scheme Procedure} delq! item lst
2986 @deffnx {Scheme Procedure} delv! item lst
2987 @deffnx {Scheme Procedure} delete! item lst
2988 @deffnx {C Function} scm_delq_x (item, lst)
2989 These procedures are destructive versions of @code{delq}, @code{delv}
2990 and @code{delete}: they modify the existing @var{lst}
2991 rather than creating a new list. Caveat evaluator: Like other
2992 destructive list functions, these functions cannot modify the binding of
2993 @var{lst}, and so cannot be used to delete the first element of
2994 @var{lst} destructively.
2995 @end deffn
2996
2997 \fdelv!
2998 @c snarfed from list.c:670
2999 @deffn {Scheme Procedure} delv! item lst
3000 @deffnx {C Function} scm_delv_x (item, lst)
3001 Destructively remove all elements from @var{lst} that are
3002 @code{eqv?} to @var{item}.
3003 @end deffn
3004
3005 \fdelete!
3006 @c snarfed from list.c:695
3007 @deffn {Scheme Procedure} delete! item lst
3008 @deffnx {C Function} scm_delete_x (item, lst)
3009 Destructively remove all elements from @var{lst} that are
3010 @code{equal?} to @var{item}.
3011 @end deffn
3012
3013 \fdelq
3014 @c snarfed from list.c:724
3015 @deffn {Scheme Procedure} delq item lst
3016 @deffnx {C Function} scm_delq (item, lst)
3017 Return a newly-created copy of @var{lst} with elements
3018 @code{eq?} to @var{item} removed. This procedure mirrors
3019 @code{memq}: @code{delq} compares elements of @var{lst} against
3020 @var{item} with @code{eq?}.
3021 @end deffn
3022
3023 \fdelv
3024 @c snarfed from list.c:737
3025 @deffn {Scheme Procedure} delv item lst
3026 @deffnx {C Function} scm_delv (item, lst)
3027 Return a newly-created copy of @var{lst} with elements
3028 @code{eqv?} to @var{item} removed. This procedure mirrors
3029 @code{memv}: @code{delv} compares elements of @var{lst} against
3030 @var{item} with @code{eqv?}.
3031 @end deffn
3032
3033 \fdelete
3034 @c snarfed from list.c:750
3035 @deffn {Scheme Procedure} delete item lst
3036 @deffnx {C Function} scm_delete (item, lst)
3037 Return a newly-created copy of @var{lst} with elements
3038 @code{equal?} to @var{item} removed. This procedure mirrors
3039 @code{member}: @code{delete} compares elements of @var{lst}
3040 against @var{item} with @code{equal?}.
3041 @end deffn
3042
3043 \fdelq1!
3044 @c snarfed from list.c:763
3045 @deffn {Scheme Procedure} delq1! item lst
3046 @deffnx {C Function} scm_delq1_x (item, lst)
3047 Like @code{delq!}, but only deletes the first occurrence of
3048 @var{item} from @var{lst}. Tests for equality using
3049 @code{eq?}. See also @code{delv1!} and @code{delete1!}.
3050 @end deffn
3051
3052 \fdelv1!
3053 @c snarfed from list.c:791
3054 @deffn {Scheme Procedure} delv1! item lst
3055 @deffnx {C Function} scm_delv1_x (item, lst)
3056 Like @code{delv!}, but only deletes the first occurrence of
3057 @var{item} from @var{lst}. Tests for equality using
3058 @code{eqv?}. See also @code{delq1!} and @code{delete1!}.
3059 @end deffn
3060
3061 \fdelete1!
3062 @c snarfed from list.c:819
3063 @deffn {Scheme Procedure} delete1! item lst
3064 @deffnx {C Function} scm_delete1_x (item, lst)
3065 Like @code{delete!}, but only deletes the first occurrence of
3066 @var{item} from @var{lst}. Tests for equality using
3067 @code{equal?}. See also @code{delq1!} and @code{delv1!}.
3068 @end deffn
3069
3070 \ffilter
3071 @c snarfed from list.c:851
3072 @deffn {Scheme Procedure} filter pred list
3073 @deffnx {C Function} scm_filter (pred, list)
3074 Return all the elements of 2nd arg @var{list} that satisfy predicate @var{pred}.
3075 The list is not disordered -- elements that appear in the result list occur
3076 in the same order as they occur in the argument list. The returned list may
3077 share a common tail with the argument list. The dynamic order in which the
3078 various applications of pred are made is not specified.
3079
3080 @lisp
3081 (filter even? '(0 7 8 8 43 -4)) => (0 8 8 -4)
3082 @end lisp
3083 @end deffn
3084
3085 \ffilter!
3086 @c snarfed from list.c:878
3087 @deffn {Scheme Procedure} filter! pred list
3088 @deffnx {C Function} scm_filter_x (pred, list)
3089 Linear-update variant of @code{filter}.
3090 @end deffn
3091
3092 \fprimitive-load
3093 @c snarfed from load.c:72
3094 @deffn {Scheme Procedure} primitive-load filename
3095 @deffnx {C Function} scm_primitive_load (filename)
3096 Load the file named @var{filename} and evaluate its contents in
3097 the top-level environment. The load paths are not searched;
3098 @var{filename} must either be a full pathname or be a pathname
3099 relative to the current directory. If the variable
3100 @code{%load-hook} is defined, it should be bound to a procedure
3101 that will be called before any code is loaded. See the
3102 documentation for @code{%load-hook} later in this section.
3103 @end deffn
3104
3105 \f%package-data-dir
3106 @c snarfed from load.c:117
3107 @deffn {Scheme Procedure} %package-data-dir
3108 @deffnx {C Function} scm_sys_package_data_dir ()
3109 Return the name of the directory where Scheme packages, modules and
3110 libraries are kept. On most Unix systems, this will be
3111 @samp{/usr/local/share/guile}.
3112 @end deffn
3113
3114 \f%library-dir
3115 @c snarfed from load.c:129
3116 @deffn {Scheme Procedure} %library-dir
3117 @deffnx {C Function} scm_sys_library_dir ()
3118 Return the directory where the Guile Scheme library files are installed.
3119 E.g., may return "/usr/share/guile/1.3.5".
3120 @end deffn
3121
3122 \f%site-dir
3123 @c snarfed from load.c:141
3124 @deffn {Scheme Procedure} %site-dir
3125 @deffnx {C Function} scm_sys_site_dir ()
3126 Return the directory where the Guile site files are installed.
3127 E.g., may return "/usr/share/guile/site".
3128 @end deffn
3129
3130 \fparse-path
3131 @c snarfed from load.c:166
3132 @deffn {Scheme Procedure} parse-path path [tail]
3133 @deffnx {C Function} scm_parse_path (path, tail)
3134 Parse @var{path}, which is expected to be a colon-separated
3135 string, into a list and return the resulting list with
3136 @var{tail} appended. If @var{path} is @code{#f}, @var{tail}
3137 is returned.
3138 @end deffn
3139
3140 \fsearch-path
3141 @c snarfed from load.c:293
3142 @deffn {Scheme Procedure} search-path path filename [extensions]
3143 @deffnx {C Function} scm_search_path (path, filename, extensions)
3144 Search @var{path} for a directory containing a file named
3145 @var{filename}. The file must be readable, and not a directory.
3146 If we find one, return its full filename; otherwise, return
3147 @code{#f}. If @var{filename} is absolute, return it unchanged.
3148 If given, @var{extensions} is a list of strings; for each
3149 directory in @var{path}, we search for @var{filename}
3150 concatenated with each @var{extension}.
3151 @end deffn
3152
3153 \f%search-load-path
3154 @c snarfed from load.c:430
3155 @deffn {Scheme Procedure} %search-load-path filename
3156 @deffnx {C Function} scm_sys_search_load_path (filename)
3157 Search @var{%load-path} for the file named @var{filename},
3158 which must be readable by the current user. If @var{filename}
3159 is found in the list of paths to search or is an absolute
3160 pathname, return its full pathname. Otherwise, return
3161 @code{#f}. Filenames may have any of the optional extensions
3162 in the @code{%load-extensions} list; @code{%search-load-path}
3163 will try each extension automatically.
3164 @end deffn
3165
3166 \fprimitive-load-path
3167 @c snarfed from load.c:451
3168 @deffn {Scheme Procedure} primitive-load-path filename
3169 @deffnx {C Function} scm_primitive_load_path (filename)
3170 Search @var{%load-path} for the file named @var{filename} and
3171 load it into the top-level environment. If @var{filename} is a
3172 relative pathname and is not found in the list of search paths,
3173 an error is signalled.
3174 @end deffn
3175
3176 \fprocedure->memoizing-macro
3177 @c snarfed from macros.c:109
3178 @deffn {Scheme Procedure} procedure->memoizing-macro code
3179 @deffnx {C Function} scm_makmmacro (code)
3180 Return a @dfn{macro} which, when a symbol defined to this value
3181 appears as the first symbol in an expression, evaluates the
3182 result of applying @var{code} to the expression and the
3183 environment.
3184
3185 @code{procedure->memoizing-macro} is the same as
3186 @code{procedure->macro}, except that the expression returned by
3187 @var{code} replaces the original macro expression in the memoized
3188 form of the containing code.
3189 @end deffn
3190
3191 \fprocedure->syntax
3192 @c snarfed from macros.c:123
3193 @deffn {Scheme Procedure} procedure->syntax code
3194 @deffnx {C Function} scm_makacro (code)
3195 Return a @dfn{macro} which, when a symbol defined to this value
3196 appears as the first symbol in an expression, returns the
3197 result of applying @var{code} to the expression and the
3198 environment.
3199 @end deffn
3200
3201 \fprocedure->macro
3202 @c snarfed from macros.c:146
3203 @deffn {Scheme Procedure} procedure->macro code
3204 @deffnx {C Function} scm_makmacro (code)
3205 Return a @dfn{macro} which, when a symbol defined to this value
3206 appears as the first symbol in an expression, evaluates the
3207 result of applying @var{code} to the expression and the
3208 environment. For example:
3209
3210 @lisp
3211 (define trace
3212 (procedure->macro
3213 (lambda (x env) `(set! ,(cadr x) (tracef ,(cadr x) ',(cadr x))))))
3214
3215 (trace @i{foo}) @equiv{} (set! @i{foo} (tracef @i{foo} '@i{foo})).
3216 @end lisp
3217 @end deffn
3218
3219 \fmacro?
3220 @c snarfed from macros.c:165
3221 @deffn {Scheme Procedure} macro? obj
3222 @deffnx {C Function} scm_macro_p (obj)
3223 Return @code{#t} if @var{obj} is a regular macro, a memoizing macro, a
3224 syntax transformer, or a syntax-case macro.
3225 @end deffn
3226
3227 \fmacro-type
3228 @c snarfed from macros.c:186
3229 @deffn {Scheme Procedure} macro-type m
3230 @deffnx {C Function} scm_macro_type (m)
3231 Return one of the symbols @code{syntax}, @code{macro},
3232 @code{macro!}, or @code{syntax-case}, depending on whether
3233 @var{m} is a syntax transformer, a regular macro, a memoizing
3234 macro, or a syntax-case macro, respectively. If @var{m} is
3235 not a macro, @code{#f} is returned.
3236 @end deffn
3237
3238 \fmacro-name
3239 @c snarfed from macros.c:207
3240 @deffn {Scheme Procedure} macro-name m
3241 @deffnx {C Function} scm_macro_name (m)
3242 Return the name of the macro @var{m}.
3243 @end deffn
3244
3245 \fmacro-transformer
3246 @c snarfed from macros.c:218
3247 @deffn {Scheme Procedure} macro-transformer m
3248 @deffnx {C Function} scm_macro_transformer (m)
3249 Return the transformer of the macro @var{m}.
3250 @end deffn
3251
3252 \fcurrent-module
3253 @c snarfed from modules.c:45
3254 @deffn {Scheme Procedure} current-module
3255 @deffnx {C Function} scm_current_module ()
3256 Return the current module.
3257 @end deffn
3258
3259 \fset-current-module
3260 @c snarfed from modules.c:57
3261 @deffn {Scheme Procedure} set-current-module module
3262 @deffnx {C Function} scm_set_current_module (module)
3263 Set the current module to @var{module} and return
3264 the previous current module.
3265 @end deffn
3266
3267 \finteraction-environment
3268 @c snarfed from modules.c:80
3269 @deffn {Scheme Procedure} interaction-environment
3270 @deffnx {C Function} scm_interaction_environment ()
3271 Return a specifier for the environment that contains
3272 implementation--defined bindings, typically a superset of those
3273 listed in the report. The intent is that this procedure will
3274 return the environment in which the implementation would
3275 evaluate expressions dynamically typed by the user.
3276 @end deffn
3277
3278 \fenv-module
3279 @c snarfed from modules.c:266
3280 @deffn {Scheme Procedure} env-module env
3281 @deffnx {C Function} scm_env_module (env)
3282 Return the module of @var{ENV}, a lexical environment.
3283 @end deffn
3284
3285 \fstandard-eval-closure
3286 @c snarfed from modules.c:342
3287 @deffn {Scheme Procedure} standard-eval-closure module
3288 @deffnx {C Function} scm_standard_eval_closure (module)
3289 Return an eval closure for the module @var{module}.
3290 @end deffn
3291
3292 \fstandard-interface-eval-closure
3293 @c snarfed from modules.c:353
3294 @deffn {Scheme Procedure} standard-interface-eval-closure module
3295 @deffnx {C Function} scm_standard_interface_eval_closure (module)
3296 Return a interface eval closure for the module @var{module}. Such a closure does not allow new bindings to be added.
3297 @end deffn
3298
3299 \fmodule-import-interface
3300 @c snarfed from modules.c:399
3301 @deffn {Scheme Procedure} module-import-interface module sym
3302 @deffnx {C Function} scm_module_import_interface (module, sym)
3303 Return the module or interface from which @var{sym} is imported in @var{module}. If @var{sym} is not imported (i.e., it is not defined in @var{module} or it is a module-local binding instead of an imported one), then @code{#f} is returned.
3304 @end deffn
3305
3306 \f%get-pre-modules-obarray
3307 @c snarfed from modules.c:616
3308 @deffn {Scheme Procedure} %get-pre-modules-obarray
3309 @deffnx {C Function} scm_get_pre_modules_obarray ()
3310 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.
3311 @end deffn
3312
3313 \fexact?
3314 @c snarfed from numbers.c:460
3315 @deffn {Scheme Procedure} exact? x
3316 @deffnx {C Function} scm_exact_p (x)
3317 Return @code{#t} if @var{x} is an exact number, @code{#f}
3318 otherwise.
3319 @end deffn
3320
3321 \fodd?
3322 @c snarfed from numbers.c:479
3323 @deffn {Scheme Procedure} odd? n
3324 @deffnx {C Function} scm_odd_p (n)
3325 Return @code{#t} if @var{n} is an odd number, @code{#f}
3326 otherwise.
3327 @end deffn
3328
3329 \feven?
3330 @c snarfed from numbers.c:514
3331 @deffn {Scheme Procedure} even? n
3332 @deffnx {C Function} scm_even_p (n)
3333 Return @code{#t} if @var{n} is an even number, @code{#f}
3334 otherwise.
3335 @end deffn
3336
3337 \finf?
3338 @c snarfed from numbers.c:548
3339 @deffn {Scheme Procedure} inf? x
3340 @deffnx {C Function} scm_inf_p (x)
3341 Return @code{#t} if @var{x} is either @samp{+inf.0}
3342 or @samp{-inf.0}, @code{#f} otherwise.
3343 @end deffn
3344
3345 \fnan?
3346 @c snarfed from numbers.c:564
3347 @deffn {Scheme Procedure} nan? n
3348 @deffnx {C Function} scm_nan_p (n)
3349 Return @code{#t} if @var{n} is a NaN, @code{#f}
3350 otherwise.
3351 @end deffn
3352
3353 \finf
3354 @c snarfed from numbers.c:634
3355 @deffn {Scheme Procedure} inf
3356 @deffnx {C Function} scm_inf ()
3357 Return Inf.
3358 @end deffn
3359
3360 \fnan
3361 @c snarfed from numbers.c:649
3362 @deffn {Scheme Procedure} nan
3363 @deffnx {C Function} scm_nan ()
3364 Return NaN.
3365 @end deffn
3366
3367 \fabs
3368 @c snarfed from numbers.c:665
3369 @deffn {Scheme Procedure} abs x
3370 @deffnx {C Function} scm_abs (x)
3371 Return the absolute value of @var{x}.
3372 @end deffn
3373
3374 \flogand
3375 @c snarfed from numbers.c:1201
3376 @deffn {Scheme Procedure} logand n1 n2
3377 Return the bitwise AND of the integer arguments.
3378
3379 @lisp
3380 (logand) @result{} -1
3381 (logand 7) @result{} 7
3382 (logand #b111 #b011 #b001) @result{} 1
3383 @end lisp
3384 @end deffn
3385
3386 \flogior
3387 @c snarfed from numbers.c:1277
3388 @deffn {Scheme Procedure} logior n1 n2
3389 Return the bitwise OR of the integer arguments.
3390
3391 @lisp
3392 (logior) @result{} 0
3393 (logior 7) @result{} 7
3394 (logior #b000 #b001 #b011) @result{} 3
3395 @end lisp
3396 @end deffn
3397
3398 \flogxor
3399 @c snarfed from numbers.c:1353
3400 @deffn {Scheme Procedure} logxor n1 n2
3401 Return the bitwise XOR of the integer arguments. A bit is
3402 set in the result if it is set in an odd number of arguments.
3403 @lisp
3404 (logxor) @result{} 0
3405 (logxor 7) @result{} 7
3406 (logxor #b000 #b001 #b011) @result{} 2
3407 (logxor #b000 #b001 #b011 #b011) @result{} 1
3408 @end lisp
3409 @end deffn
3410
3411 \flogtest
3412 @c snarfed from numbers.c:1428
3413 @deffn {Scheme Procedure} logtest j k
3414 @deffnx {C Function} scm_logtest (j, k)
3415 Test whether @var{j} and @var{k} have any 1 bits in common.
3416 This is equivalent to @code{(not (zero? (logand j k)))}, but
3417 without actually calculating the @code{logand}, just testing
3418 for non-zero.
3419
3420 @lisp
3421 (logtest #b0100 #b1011) @result{} #f
3422 (logtest #b0100 #b0111) @result{} #t
3423 @end lisp
3424 @end deffn
3425
3426 \flogbit?
3427 @c snarfed from numbers.c:1501
3428 @deffn {Scheme Procedure} logbit? index j
3429 @deffnx {C Function} scm_logbit_p (index, j)
3430 Test whether bit number @var{index} in @var{j} is set.
3431 @var{index} starts from 0 for the least significant bit.
3432
3433 @lisp
3434 (logbit? 0 #b1101) @result{} #t
3435 (logbit? 1 #b1101) @result{} #f
3436 (logbit? 2 #b1101) @result{} #t
3437 (logbit? 3 #b1101) @result{} #t
3438 (logbit? 4 #b1101) @result{} #f
3439 @end lisp
3440 @end deffn
3441
3442 \flognot
3443 @c snarfed from numbers.c:1535
3444 @deffn {Scheme Procedure} lognot n
3445 @deffnx {C Function} scm_lognot (n)
3446 Return the integer which is the ones-complement of the integer
3447 argument.
3448
3449 @lisp
3450 (number->string (lognot #b10000000) 2)
3451 @result{} "-10000001"
3452 (number->string (lognot #b0) 2)
3453 @result{} "-1"
3454 @end lisp
3455 @end deffn
3456
3457 \fmodulo-expt
3458 @c snarfed from numbers.c:1580
3459 @deffn {Scheme Procedure} modulo-expt n k m
3460 @deffnx {C Function} scm_modulo_expt (n, k, m)
3461 Return @var{n} raised to the integer exponent
3462 @var{k}, modulo @var{m}.
3463
3464 @lisp
3465 (modulo-expt 2 3 5)
3466 @result{} 3
3467 @end lisp
3468 @end deffn
3469
3470 \finteger-expt
3471 @c snarfed from numbers.c:1689
3472 @deffn {Scheme Procedure} integer-expt n k
3473 @deffnx {C Function} scm_integer_expt (n, k)
3474 Return @var{n} raised to the power @var{k}. @var{k} must be an
3475 exact integer, @var{n} can be any number.
3476
3477 Negative @var{k} is supported, and results in @math{1/n^abs(k)}
3478 in the usual way. @math{@var{n}^0} is 1, as usual, and that
3479 includes @math{0^0} is 1.
3480
3481 @lisp
3482 (integer-expt 2 5) @result{} 32
3483 (integer-expt -3 3) @result{} -27
3484 (integer-expt 5 -3) @result{} 1/125
3485 (integer-expt 0 0) @result{} 1
3486 @end lisp
3487 @end deffn
3488
3489 \fash
3490 @c snarfed from numbers.c:1779
3491 @deffn {Scheme Procedure} ash n cnt
3492 @deffnx {C Function} scm_ash (n, cnt)
3493 Return @var{n} shifted left by @var{cnt} bits, or shifted right
3494 if @var{cnt} is negative. This is an ``arithmetic'' shift.
3495
3496 This is effectively a multiplication by 2^@var{cnt}, and when
3497 @var{cnt} is negative it's a division, rounded towards negative
3498 infinity. (Note that this is not the same rounding as
3499 @code{quotient} does.)
3500
3501 With @var{n} viewed as an infinite precision twos complement,
3502 @code{ash} means a left shift introducing zero bits, or a right
3503 shift dropping bits.
3504
3505 @lisp
3506 (number->string (ash #b1 3) 2) @result{} "1000"
3507 (number->string (ash #b1010 -1) 2) @result{} "101"
3508
3509 ;; -23 is bits ...11101001, -6 is bits ...111010
3510 (ash -23 -2) @result{} -6
3511 @end lisp
3512 @end deffn
3513
3514 \fbit-extract
3515 @c snarfed from numbers.c:1870
3516 @deffn {Scheme Procedure} bit-extract n start end
3517 @deffnx {C Function} scm_bit_extract (n, start, end)
3518 Return the integer composed of the @var{start} (inclusive)
3519 through @var{end} (exclusive) bits of @var{n}. The
3520 @var{start}th bit becomes the 0-th bit in the result.
3521
3522 @lisp
3523 (number->string (bit-extract #b1101101010 0 4) 2)
3524 @result{} "1010"
3525 (number->string (bit-extract #b1101101010 4 9) 2)
3526 @result{} "10110"
3527 @end lisp
3528 @end deffn
3529
3530 \flogcount
3531 @c snarfed from numbers.c:1949
3532 @deffn {Scheme Procedure} logcount n
3533 @deffnx {C Function} scm_logcount (n)
3534 Return the number of bits in integer @var{n}. If integer is
3535 positive, the 1-bits in its binary representation are counted.
3536 If negative, the 0-bits in its two's-complement binary
3537 representation are counted. If 0, 0 is returned.
3538
3539 @lisp
3540 (logcount #b10101010)
3541 @result{} 4
3542 (logcount 0)
3543 @result{} 0
3544 (logcount -2)
3545 @result{} 1
3546 @end lisp
3547 @end deffn
3548
3549 \finteger-length
3550 @c snarfed from numbers.c:1997
3551 @deffn {Scheme Procedure} integer-length n
3552 @deffnx {C Function} scm_integer_length (n)
3553 Return the number of bits necessary to represent @var{n}.
3554
3555 @lisp
3556 (integer-length #b10101010)
3557 @result{} 8
3558 (integer-length 0)
3559 @result{} 0
3560 (integer-length #b1111)
3561 @result{} 4
3562 @end lisp
3563 @end deffn
3564
3565 \fnumber->string
3566 @c snarfed from numbers.c:2337
3567 @deffn {Scheme Procedure} number->string n [radix]
3568 @deffnx {C Function} scm_number_to_string (n, radix)
3569 Return a string holding the external representation of the
3570 number @var{n} in the given @var{radix}. If @var{n} is
3571 inexact, a radix of 10 will be used.
3572 @end deffn
3573
3574 \fstring->number
3575 @c snarfed from numbers.c:3034
3576 @deffn {Scheme Procedure} string->number string [radix]
3577 @deffnx {C Function} scm_string_to_number (string, radix)
3578 Return a number of the maximally precise representation
3579 expressed by the given @var{string}. @var{radix} must be an
3580 exact integer, either 2, 8, 10, or 16. If supplied, @var{radix}
3581 is a default radix that may be overridden by an explicit radix
3582 prefix in @var{string} (e.g. "#o177"). If @var{radix} is not
3583 supplied, then the default radix is 10. If string is not a
3584 syntactically valid notation for a number, then
3585 @code{string->number} returns @code{#f}.
3586 @end deffn
3587
3588 \fnumber?
3589 @c snarfed from numbers.c:3097
3590 @deffn {Scheme Procedure} number? x
3591 @deffnx {C Function} scm_number_p (x)
3592 Return @code{#t} if @var{x} is a number, @code{#f}
3593 otherwise.
3594 @end deffn
3595
3596 \fcomplex?
3597 @c snarfed from numbers.c:3110
3598 @deffn {Scheme Procedure} complex? x
3599 @deffnx {C Function} scm_complex_p (x)
3600 Return @code{#t} if @var{x} is a complex number, @code{#f}
3601 otherwise. Note that the sets of real, rational and integer
3602 values form subsets of the set of complex numbers, i. e. the
3603 predicate will also be fulfilled if @var{x} is a real,
3604 rational or integer number.
3605 @end deffn
3606
3607 \freal?
3608 @c snarfed from numbers.c:3123
3609 @deffn {Scheme Procedure} real? x
3610 @deffnx {C Function} scm_real_p (x)
3611 Return @code{#t} if @var{x} is a real number, @code{#f}
3612 otherwise. Note that the set of integer values forms a subset of
3613 the set of real numbers, i. e. the predicate will also be
3614 fulfilled if @var{x} is an integer number.
3615 @end deffn
3616
3617 \frational?
3618 @c snarfed from numbers.c:3136
3619 @deffn {Scheme Procedure} rational? x
3620 @deffnx {C Function} scm_rational_p (x)
3621 Return @code{#t} if @var{x} is a rational number, @code{#f}
3622 otherwise. Note that the set of integer values forms a subset of
3623 the set of rational numbers, i. e. the predicate will also be
3624 fulfilled if @var{x} is an integer number.
3625 @end deffn
3626
3627 \finteger?
3628 @c snarfed from numbers.c:3159
3629 @deffn {Scheme Procedure} integer? x
3630 @deffnx {C Function} scm_integer_p (x)
3631 Return @code{#t} if @var{x} is an integer number, @code{#f}
3632 else.
3633 @end deffn
3634
3635 \finexact?
3636 @c snarfed from numbers.c:3185
3637 @deffn {Scheme Procedure} inexact? x
3638 @deffnx {C Function} scm_inexact_p (x)
3639 Return @code{#t} if @var{x} is an inexact number, @code{#f}
3640 else.
3641 @end deffn
3642
3643 \ftruncate
3644 @c snarfed from numbers.c:5060
3645 @deffn {Scheme Procedure} truncate x
3646 @deffnx {C Function} scm_truncate_number (x)
3647 Round the number @var{x} towards zero.
3648 @end deffn
3649
3650 \fround
3651 @c snarfed from numbers.c:5076
3652 @deffn {Scheme Procedure} round x
3653 @deffnx {C Function} scm_round_number (x)
3654 Round the number @var{x} towards the nearest integer. When it is exactly halfway between two integers, round towards the even one.
3655 @end deffn
3656
3657 \ffloor
3658 @c snarfed from numbers.c:5102
3659 @deffn {Scheme Procedure} floor x
3660 @deffnx {C Function} scm_floor (x)
3661 Round the number @var{x} towards minus infinity.
3662 @end deffn
3663
3664 \fceiling
3665 @c snarfed from numbers.c:5133
3666 @deffn {Scheme Procedure} ceiling x
3667 @deffnx {C Function} scm_ceiling (x)
3668 Round the number @var{x} towards infinity.
3669 @end deffn
3670
3671 \f$expt
3672 @c snarfed from numbers.c:5242
3673 @deffn {Scheme Procedure} $expt x y
3674 @deffnx {C Function} scm_sys_expt (x, y)
3675 Return @var{x} raised to the power of @var{y}. This
3676 procedure does not accept complex arguments.
3677 @end deffn
3678
3679 \f$atan2
3680 @c snarfed from numbers.c:5258
3681 @deffn {Scheme Procedure} $atan2 x y
3682 @deffnx {C Function} scm_sys_atan2 (x, y)
3683 Return the arc tangent of the two arguments @var{x} and
3684 @var{y}. This is similar to calculating the arc tangent of
3685 @var{x} / @var{y}, except that the signs of both arguments
3686 are used to determine the quadrant of the result. This
3687 procedure does not accept complex arguments.
3688 @end deffn
3689
3690 \fmake-rectangular
3691 @c snarfed from numbers.c:5286
3692 @deffn {Scheme Procedure} make-rectangular real_part imaginary_part
3693 @deffnx {C Function} scm_make_rectangular (real_part, imaginary_part)
3694 Return a complex number constructed of the given @var{real-part} and @var{imaginary-part} parts.
3695 @end deffn
3696
3697 \fmake-polar
3698 @c snarfed from numbers.c:5310
3699 @deffn {Scheme Procedure} make-polar x y
3700 @deffnx {C Function} scm_make_polar (x, y)
3701 Return the complex number @var{x} * e^(i * @var{y}).
3702 @end deffn
3703
3704 \finexact->exact
3705 @c snarfed from numbers.c:5513
3706 @deffn {Scheme Procedure} inexact->exact z
3707 @deffnx {C Function} scm_inexact_to_exact (z)
3708 Return an exact number that is numerically closest to @var{z}.
3709 @end deffn
3710
3711 \frationalize
3712 @c snarfed from numbers.c:5550
3713 @deffn {Scheme Procedure} rationalize x err
3714 @deffnx {C Function} scm_rationalize (x, err)
3715 Return an exact number that is within @var{err} of @var{x}.
3716 @end deffn
3717
3718 \fentity?
3719 @c snarfed from objects.c:192
3720 @deffn {Scheme Procedure} entity? obj
3721 @deffnx {C Function} scm_entity_p (obj)
3722 Return @code{#t} if @var{obj} is an entity.
3723 @end deffn
3724
3725 \foperator?
3726 @c snarfed from objects.c:201
3727 @deffn {Scheme Procedure} operator? obj
3728 @deffnx {C Function} scm_operator_p (obj)
3729 Return @code{#t} if @var{obj} is an operator.
3730 @end deffn
3731
3732 \fvalid-object-procedure?
3733 @c snarfed from objects.c:217
3734 @deffn {Scheme Procedure} valid-object-procedure? proc
3735 @deffnx {C Function} scm_valid_object_procedure_p (proc)
3736 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}.
3737 @end deffn
3738
3739 \fset-object-procedure!
3740 @c snarfed from objects.c:239
3741 @deffn {Scheme Procedure} set-object-procedure! obj proc
3742 @deffnx {C Function} scm_set_object_procedure_x (obj, proc)
3743 Set the object procedure of @var{obj} to @var{proc}.
3744 @var{obj} must be either an entity or an operator.
3745 @end deffn
3746
3747 \fmake-class-object
3748 @c snarfed from objects.c:299
3749 @deffn {Scheme Procedure} make-class-object metaclass layout
3750 @deffnx {C Function} scm_make_class_object (metaclass, layout)
3751 Create a new class object of class @var{metaclass}, with the
3752 slot layout specified by @var{layout}.
3753 @end deffn
3754
3755 \fmake-subclass-object
3756 @c snarfed from objects.c:314
3757 @deffn {Scheme Procedure} make-subclass-object class layout
3758 @deffnx {C Function} scm_make_subclass_object (class, layout)
3759 Create a subclass object of @var{class}, with the slot layout
3760 specified by @var{layout}.
3761 @end deffn
3762
3763 \fobject-properties
3764 @c snarfed from objprop.c:36
3765 @deffn {Scheme Procedure} object-properties obj
3766 @deffnx {C Function} scm_object_properties (obj)
3767 Return @var{obj}'s property list.
3768 @end deffn
3769
3770 \fset-object-properties!
3771 @c snarfed from objprop.c:46
3772 @deffn {Scheme Procedure} set-object-properties! obj alist
3773 @deffnx {C Function} scm_set_object_properties_x (obj, alist)
3774 Set @var{obj}'s property list to @var{alist}.
3775 @end deffn
3776
3777 \fobject-property
3778 @c snarfed from objprop.c:57
3779 @deffn {Scheme Procedure} object-property obj key
3780 @deffnx {C Function} scm_object_property (obj, key)
3781 Return the property of @var{obj} with name @var{key}.
3782 @end deffn
3783
3784 \fset-object-property!
3785 @c snarfed from objprop.c:69
3786 @deffn {Scheme Procedure} set-object-property! obj key value
3787 @deffnx {C Function} scm_set_object_property_x (obj, key, value)
3788 In @var{obj}'s property list, set the property named @var{key}
3789 to @var{value}.
3790 @end deffn
3791
3792 \fcons
3793 @c snarfed from pairs.c:56
3794 @deffn {Scheme Procedure} cons x y
3795 @deffnx {C Function} scm_cons (x, y)
3796 Return a newly allocated pair whose car is @var{x} and whose
3797 cdr is @var{y}. The pair is guaranteed to be different (in the
3798 sense of @code{eq?}) from every previously existing object.
3799 @end deffn
3800
3801 \fpair?
3802 @c snarfed from pairs.c:74
3803 @deffn {Scheme Procedure} pair? x
3804 @deffnx {C Function} scm_pair_p (x)
3805 Return @code{#t} if @var{x} is a pair; otherwise return
3806 @code{#f}.
3807 @end deffn
3808
3809 \fset-car!
3810 @c snarfed from pairs.c:120
3811 @deffn {Scheme Procedure} set-car! pair value
3812 @deffnx {C Function} scm_set_car_x (pair, value)
3813 Stores @var{value} in the car field of @var{pair}. The value returned
3814 by @code{set-car!} is unspecified.
3815 @end deffn
3816
3817 \fset-cdr!
3818 @c snarfed from pairs.c:133
3819 @deffn {Scheme Procedure} set-cdr! pair value
3820 @deffnx {C Function} scm_set_cdr_x (pair, value)
3821 Stores @var{value} in the cdr field of @var{pair}. The value returned
3822 by @code{set-cdr!} is unspecified.
3823 @end deffn
3824
3825 \fchar-ready?
3826 @c snarfed from ports.c:245
3827 @deffn {Scheme Procedure} char-ready? [port]
3828 @deffnx {C Function} scm_char_ready_p (port)
3829 Return @code{#t} if a character is ready on input @var{port}
3830 and return @code{#f} otherwise. If @code{char-ready?} returns
3831 @code{#t} then the next @code{read-char} operation on
3832 @var{port} is guaranteed not to hang. If @var{port} is a file
3833 port at end of file then @code{char-ready?} returns @code{#t}.
3834
3835 @code{char-ready?} exists to make it possible for a
3836 program to accept characters from interactive ports without
3837 getting stuck waiting for input. Any input editors associated
3838 with such ports must make sure that characters whose existence
3839 has been asserted by @code{char-ready?} cannot be rubbed out.
3840 If @code{char-ready?} were to return @code{#f} at end of file,
3841 a port at end of file would be indistinguishable from an
3842 interactive port that has no ready characters.
3843 @end deffn
3844
3845 \fdrain-input
3846 @c snarfed from ports.c:322
3847 @deffn {Scheme Procedure} drain-input port
3848 @deffnx {C Function} scm_drain_input (port)
3849 This procedure clears a port's input buffers, similar
3850 to the way that force-output clears the output buffer. The
3851 contents of the buffers are returned as a single string, e.g.,
3852
3853 @lisp
3854 (define p (open-input-file ...))
3855 (drain-input p) => empty string, nothing buffered yet.
3856 (unread-char (read-char p) p)
3857 (drain-input p) => initial chars from p, up to the buffer size.
3858 @end lisp
3859
3860 Draining the buffers may be useful for cleanly finishing
3861 buffered I/O so that the file descriptor can be used directly
3862 for further input.
3863 @end deffn
3864
3865 \fcurrent-input-port
3866 @c snarfed from ports.c:355
3867 @deffn {Scheme Procedure} current-input-port
3868 @deffnx {C Function} scm_current_input_port ()
3869 Return the current input port. This is the default port used
3870 by many input procedures. Initially, @code{current-input-port}
3871 returns the @dfn{standard input} in Unix and C terminology.
3872 @end deffn
3873
3874 \fcurrent-output-port
3875 @c snarfed from ports.c:367
3876 @deffn {Scheme Procedure} current-output-port
3877 @deffnx {C Function} scm_current_output_port ()
3878 Return the current output port. This is the default port used
3879 by many output procedures. Initially,
3880 @code{current-output-port} returns the @dfn{standard output} in
3881 Unix and C terminology.
3882 @end deffn
3883
3884 \fcurrent-error-port
3885 @c snarfed from ports.c:377
3886 @deffn {Scheme Procedure} current-error-port
3887 @deffnx {C Function} scm_current_error_port ()
3888 Return the port to which errors and warnings should be sent (the
3889 @dfn{standard error} in Unix and C terminology).
3890 @end deffn
3891
3892 \fcurrent-load-port
3893 @c snarfed from ports.c:387
3894 @deffn {Scheme Procedure} current-load-port
3895 @deffnx {C Function} scm_current_load_port ()
3896 Return the current-load-port.
3897 The load port is used internally by @code{primitive-load}.
3898 @end deffn
3899
3900 \fset-current-input-port
3901 @c snarfed from ports.c:400
3902 @deffn {Scheme Procedure} set-current-input-port port
3903 @deffnx {Scheme Procedure} set-current-output-port port
3904 @deffnx {Scheme Procedure} set-current-error-port port
3905 @deffnx {C Function} scm_set_current_input_port (port)
3906 Change the ports returned by @code{current-input-port},
3907 @code{current-output-port} and @code{current-error-port}, respectively,
3908 so that they use the supplied @var{port} for input or output.
3909 @end deffn
3910
3911 \fset-current-output-port
3912 @c snarfed from ports.c:413
3913 @deffn {Scheme Procedure} set-current-output-port port
3914 @deffnx {C Function} scm_set_current_output_port (port)
3915 Set the current default output port to @var{port}.
3916 @end deffn
3917
3918 \fset-current-error-port
3919 @c snarfed from ports.c:427
3920 @deffn {Scheme Procedure} set-current-error-port port
3921 @deffnx {C Function} scm_set_current_error_port (port)
3922 Set the current default error port to @var{port}.
3923 @end deffn
3924
3925 \fport-revealed
3926 @c snarfed from ports.c:625
3927 @deffn {Scheme Procedure} port-revealed port
3928 @deffnx {C Function} scm_port_revealed (port)
3929 Return the revealed count for @var{port}.
3930 @end deffn
3931
3932 \fset-port-revealed!
3933 @c snarfed from ports.c:638
3934 @deffn {Scheme Procedure} set-port-revealed! port rcount
3935 @deffnx {C Function} scm_set_port_revealed_x (port, rcount)
3936 Sets the revealed count for a port to a given value.
3937 The return value is unspecified.
3938 @end deffn
3939
3940 \fport-mode
3941 @c snarfed from ports.c:699
3942 @deffn {Scheme Procedure} port-mode port
3943 @deffnx {C Function} scm_port_mode (port)
3944 Return the port modes associated with the open port @var{port}.
3945 These will not necessarily be identical to the modes used when
3946 the port was opened, since modes such as "append" which are
3947 used only during port creation are not retained.
3948 @end deffn
3949
3950 \fclose-port
3951 @c snarfed from ports.c:736
3952 @deffn {Scheme Procedure} close-port port
3953 @deffnx {C Function} scm_close_port (port)
3954 Close the specified port object. Return @code{#t} if it
3955 successfully closes a port or @code{#f} if it was already
3956 closed. An exception may be raised if an error occurs, for
3957 example when flushing buffered output. See also @ref{Ports and
3958 File Descriptors, close}, for a procedure which can close file
3959 descriptors.
3960 @end deffn
3961
3962 \fclose-input-port
3963 @c snarfed from ports.c:766
3964 @deffn {Scheme Procedure} close-input-port port
3965 @deffnx {C Function} scm_close_input_port (port)
3966 Close the specified input port object. The routine has no effect if
3967 the file has already been closed. An exception may be raised if an
3968 error occurs. The value returned is unspecified.
3969
3970 See also @ref{Ports and File Descriptors, close}, for a procedure
3971 which can close file descriptors.
3972 @end deffn
3973
3974 \fclose-output-port
3975 @c snarfed from ports.c:781
3976 @deffn {Scheme Procedure} close-output-port port
3977 @deffnx {C Function} scm_close_output_port (port)
3978 Close the specified output port object. The routine has no effect if
3979 the file has already been closed. An exception may be raised if an
3980 error occurs. The value returned is unspecified.
3981
3982 See also @ref{Ports and File Descriptors, close}, for a procedure
3983 which can close file descriptors.
3984 @end deffn
3985
3986 \fport-for-each
3987 @c snarfed from ports.c:827
3988 @deffn {Scheme Procedure} port-for-each proc
3989 @deffnx {C Function} scm_port_for_each (proc)
3990 Apply @var{proc} to each port in the Guile port table
3991 in turn. The return value is unspecified. More specifically,
3992 @var{proc} is applied exactly once to every port that exists
3993 in the system at the time @var{port-for-each} is invoked.
3994 Changes to the port table while @var{port-for-each} is running
3995 have no effect as far as @var{port-for-each} is concerned.
3996 @end deffn
3997
3998 \finput-port?
3999 @c snarfed from ports.c:845
4000 @deffn {Scheme Procedure} input-port? x
4001 @deffnx {C Function} scm_input_port_p (x)
4002 Return @code{#t} if @var{x} is an input port, otherwise return
4003 @code{#f}. Any object satisfying this predicate also satisfies
4004 @code{port?}.
4005 @end deffn
4006
4007 \foutput-port?
4008 @c snarfed from ports.c:856
4009 @deffn {Scheme Procedure} output-port? x
4010 @deffnx {C Function} scm_output_port_p (x)
4011 Return @code{#t} if @var{x} is an output port, otherwise return
4012 @code{#f}. Any object satisfying this predicate also satisfies
4013 @code{port?}.
4014 @end deffn
4015
4016 \fport?
4017 @c snarfed from ports.c:868
4018 @deffn {Scheme Procedure} port? x
4019 @deffnx {C Function} scm_port_p (x)
4020 Return a boolean indicating whether @var{x} is a port.
4021 Equivalent to @code{(or (input-port? @var{x}) (output-port?
4022 @var{x}))}.
4023 @end deffn
4024
4025 \fport-closed?
4026 @c snarfed from ports.c:878
4027 @deffn {Scheme Procedure} port-closed? port
4028 @deffnx {C Function} scm_port_closed_p (port)
4029 Return @code{#t} if @var{port} is closed or @code{#f} if it is
4030 open.
4031 @end deffn
4032
4033 \feof-object?
4034 @c snarfed from ports.c:889
4035 @deffn {Scheme Procedure} eof-object? x
4036 @deffnx {C Function} scm_eof_object_p (x)
4037 Return @code{#t} if @var{x} is an end-of-file object; otherwise
4038 return @code{#f}.
4039 @end deffn
4040
4041 \fforce-output
4042 @c snarfed from ports.c:903
4043 @deffn {Scheme Procedure} force-output [port]
4044 @deffnx {C Function} scm_force_output (port)
4045 Flush the specified output port, or the current output port if @var{port}
4046 is omitted. The current output buffer contents are passed to the
4047 underlying port implementation (e.g., in the case of fports, the
4048 data will be written to the file and the output buffer will be cleared.)
4049 It has no effect on an unbuffered port.
4050
4051 The return value is unspecified.
4052 @end deffn
4053
4054 \fflush-all-ports
4055 @c snarfed from ports.c:921
4056 @deffn {Scheme Procedure} flush-all-ports
4057 @deffnx {C Function} scm_flush_all_ports ()
4058 Equivalent to calling @code{force-output} on
4059 all open output ports. The return value is unspecified.
4060 @end deffn
4061
4062 \fread-char
4063 @c snarfed from ports.c:941
4064 @deffn {Scheme Procedure} read-char [port]
4065 @deffnx {C Function} scm_read_char (port)
4066 Return the next character available from @var{port}, updating
4067 @var{port} to point to the following character. If no more
4068 characters are available, the end-of-file object is returned.
4069 @end deffn
4070
4071 \fpeek-char
4072 @c snarfed from ports.c:1283
4073 @deffn {Scheme Procedure} peek-char [port]
4074 @deffnx {C Function} scm_peek_char (port)
4075 Return the next character available from @var{port},
4076 @emph{without} updating @var{port} to point to the following
4077 character. If no more characters are available, the
4078 end-of-file object is returned.
4079
4080 The value returned by
4081 a call to @code{peek-char} is the same as the value that would
4082 have been returned by a call to @code{read-char} on the same
4083 port. The only difference is that the very next call to
4084 @code{read-char} or @code{peek-char} on that @var{port} will
4085 return the value returned by the preceding call to
4086 @code{peek-char}. In particular, a call to @code{peek-char} on
4087 an interactive port will hang waiting for input whenever a call
4088 to @code{read-char} would have hung.
4089 @end deffn
4090
4091 \funread-char
4092 @c snarfed from ports.c:1306
4093 @deffn {Scheme Procedure} unread-char cobj [port]
4094 @deffnx {C Function} scm_unread_char (cobj, port)
4095 Place @var{char} in @var{port} so that it will be read by the
4096 next read operation. If called multiple times, the unread characters
4097 will be read again in last-in first-out order. If @var{port} is
4098 not supplied, the current input port is used.
4099 @end deffn
4100
4101 \funread-string
4102 @c snarfed from ports.c:1329
4103 @deffn {Scheme Procedure} unread-string str port
4104 @deffnx {C Function} scm_unread_string (str, port)
4105 Place the string @var{str} in @var{port} so that its characters will be
4106 read in subsequent read operations. If called multiple times, the
4107 unread characters will be read again in last-in first-out order. If
4108 @var{port} is not supplied, the current-input-port is used.
4109 @end deffn
4110
4111 \fseek
4112 @c snarfed from ports.c:1368
4113 @deffn {Scheme Procedure} seek fd_port offset whence
4114 @deffnx {C Function} scm_seek (fd_port, offset, whence)
4115 Sets the current position of @var{fd/port} to the integer
4116 @var{offset}, which is interpreted according to the value of
4117 @var{whence}.
4118
4119 One of the following variables should be supplied for
4120 @var{whence}:
4121 @defvar SEEK_SET
4122 Seek from the beginning of the file.
4123 @end defvar
4124 @defvar SEEK_CUR
4125 Seek from the current position.
4126 @end defvar
4127 @defvar SEEK_END
4128 Seek from the end of the file.
4129 @end defvar
4130 If @var{fd/port} is a file descriptor, the underlying system
4131 call is @code{lseek}. @var{port} may be a string port.
4132
4133 The value returned is the new position in the file. This means
4134 that the current position of a port can be obtained using:
4135 @lisp
4136 (seek port 0 SEEK_CUR)
4137 @end lisp
4138 @end deffn
4139
4140 \ftruncate-file
4141 @c snarfed from ports.c:1426
4142 @deffn {Scheme Procedure} truncate-file object [length]
4143 @deffnx {C Function} scm_truncate_file (object, length)
4144 Truncates the object referred to by @var{object} to at most
4145 @var{length} bytes. @var{object} can be a string containing a
4146 file name or an integer file descriptor or a port.
4147 @var{length} may be omitted if @var{object} is not a file name,
4148 in which case the truncation occurs at the current port
4149 position. The return value is unspecified.
4150 @end deffn
4151
4152 \fport-line
4153 @c snarfed from ports.c:1486
4154 @deffn {Scheme Procedure} port-line port
4155 @deffnx {C Function} scm_port_line (port)
4156 Return the current line number for @var{port}.
4157
4158 The first line of a file is 0. But you might want to add 1
4159 when printing line numbers, since starting from 1 is
4160 traditional in error messages, and likely to be more natural to
4161 non-programmers.
4162 @end deffn
4163
4164 \fset-port-line!
4165 @c snarfed from ports.c:1498
4166 @deffn {Scheme Procedure} set-port-line! port line
4167 @deffnx {C Function} scm_set_port_line_x (port, line)
4168 Set the current line number for @var{port} to @var{line}. The
4169 first line of a file is 0.
4170 @end deffn
4171
4172 \fport-column
4173 @c snarfed from ports.c:1517
4174 @deffn {Scheme Procedure} port-column port
4175 @deffnx {C Function} scm_port_column (port)
4176 Return the current column number of @var{port}.
4177 If the number is
4178 unknown, the result is #f. Otherwise, the result is a 0-origin integer
4179 - i.e. the first character of the first line is line 0, column 0.
4180 (However, when you display a file position, for example in an error
4181 message, we recommend you add 1 to get 1-origin integers. This is
4182 because lines and column numbers traditionally start with 1, and that is
4183 what non-programmers will find most natural.)
4184 @end deffn
4185
4186 \fset-port-column!
4187 @c snarfed from ports.c:1529
4188 @deffn {Scheme Procedure} set-port-column! port column
4189 @deffnx {C Function} scm_set_port_column_x (port, column)
4190 Set the current column of @var{port}. Before reading the first
4191 character on a line the column should be 0.
4192 @end deffn
4193
4194 \fport-filename
4195 @c snarfed from ports.c:1543
4196 @deffn {Scheme Procedure} port-filename port
4197 @deffnx {C Function} scm_port_filename (port)
4198 Return the filename associated with @var{port}. This function returns
4199 the strings "standard input", "standard output" and "standard error"
4200 when called on the current input, output and error ports respectively.
4201 @end deffn
4202
4203 \fset-port-filename!
4204 @c snarfed from ports.c:1557
4205 @deffn {Scheme Procedure} set-port-filename! port filename
4206 @deffnx {C Function} scm_set_port_filename_x (port, filename)
4207 Change the filename associated with @var{port}, using the current input
4208 port if none is specified. Note that this does not change the port's
4209 source of data, but only the value that is returned by
4210 @code{port-filename} and reported in diagnostic output.
4211 @end deffn
4212
4213 \f%make-void-port
4214 @c snarfed from ports.c:1651
4215 @deffn {Scheme Procedure} %make-void-port mode
4216 @deffnx {C Function} scm_sys_make_void_port (mode)
4217 Create and return a new void port. A void port acts like
4218 @file{/dev/null}. The @var{mode} argument
4219 specifies the input/output modes for this port: see the
4220 documentation for @code{open-file} in @ref{File Ports}.
4221 @end deffn
4222
4223 \fprint-options-interface
4224 @c snarfed from print.c:87
4225 @deffn {Scheme Procedure} print-options-interface [setting]
4226 @deffnx {C Function} scm_print_options (setting)
4227 Option interface for the print options. Instead of using
4228 this procedure directly, use the procedures
4229 @code{print-enable}, @code{print-disable}, @code{print-set!}
4230 and @code{print-options}.
4231 @end deffn
4232
4233 \fsimple-format
4234 @c snarfed from print.c:929
4235 @deffn {Scheme Procedure} simple-format destination message . args
4236 @deffnx {C Function} scm_simple_format (destination, message, args)
4237 Write @var{message} to @var{destination}, defaulting to
4238 the current output port.
4239 @var{message} can contain @code{~A} (was @code{%s}) and
4240 @code{~S} (was @code{%S}) escapes. When printed,
4241 the escapes are replaced with corresponding members of
4242 @var{ARGS}:
4243 @code{~A} formats using @code{display} and @code{~S} formats
4244 using @code{write}.
4245 If @var{destination} is @code{#t}, then use the current output
4246 port, if @var{destination} is @code{#f}, then return a string
4247 containing the formatted text. Does not add a trailing newline.
4248 @end deffn
4249
4250 \fnewline
4251 @c snarfed from print.c:1019
4252 @deffn {Scheme Procedure} newline [port]
4253 @deffnx {C Function} scm_newline (port)
4254 Send a newline to @var{port}.
4255 If @var{port} is omitted, send to the current output port.
4256 @end deffn
4257
4258 \fwrite-char
4259 @c snarfed from print.c:1034
4260 @deffn {Scheme Procedure} write-char chr [port]
4261 @deffnx {C Function} scm_write_char (chr, port)
4262 Send character @var{chr} to @var{port}.
4263 @end deffn
4264
4265 \fport-with-print-state
4266 @c snarfed from print.c:1088
4267 @deffn {Scheme Procedure} port-with-print-state port [pstate]
4268 @deffnx {C Function} scm_port_with_print_state (port, pstate)
4269 Create a new port which behaves like @var{port}, but with an
4270 included print state @var{pstate}. @var{pstate} is optional.
4271 If @var{pstate} isn't supplied and @var{port} already has
4272 a print state, the old print state is reused.
4273 @end deffn
4274
4275 \fget-print-state
4276 @c snarfed from print.c:1101
4277 @deffn {Scheme Procedure} get-print-state port
4278 @deffnx {C Function} scm_get_print_state (port)
4279 Return the print state of the port @var{port}. If @var{port}
4280 has no associated print state, @code{#f} is returned.
4281 @end deffn
4282
4283 \fprocedure-properties
4284 @c snarfed from procprop.c:160
4285 @deffn {Scheme Procedure} procedure-properties proc
4286 @deffnx {C Function} scm_procedure_properties (proc)
4287 Return @var{obj}'s property list.
4288 @end deffn
4289
4290 \fset-procedure-properties!
4291 @c snarfed from procprop.c:173
4292 @deffn {Scheme Procedure} set-procedure-properties! proc new_val
4293 @deffnx {C Function} scm_set_procedure_properties_x (proc, new_val)
4294 Set @var{obj}'s property list to @var{alist}.
4295 @end deffn
4296
4297 \fprocedure-property
4298 @c snarfed from procprop.c:186
4299 @deffn {Scheme Procedure} procedure-property p k
4300 @deffnx {C Function} scm_procedure_property (p, k)
4301 Return the property of @var{obj} with name @var{key}.
4302 @end deffn
4303
4304 \fset-procedure-property!
4305 @c snarfed from procprop.c:209
4306 @deffn {Scheme Procedure} set-procedure-property! p k v
4307 @deffnx {C Function} scm_set_procedure_property_x (p, k, v)
4308 In @var{obj}'s property list, set the property named @var{key} to
4309 @var{value}.
4310 @end deffn
4311
4312 \fprocedure?
4313 @c snarfed from procs.c:162
4314 @deffn {Scheme Procedure} procedure? obj
4315 @deffnx {C Function} scm_procedure_p (obj)
4316 Return @code{#t} if @var{obj} is a procedure.
4317 @end deffn
4318
4319 \fclosure?
4320 @c snarfed from procs.c:189
4321 @deffn {Scheme Procedure} closure? obj
4322 @deffnx {C Function} scm_closure_p (obj)
4323 Return @code{#t} if @var{obj} is a closure.
4324 @end deffn
4325
4326 \fthunk?
4327 @c snarfed from procs.c:198
4328 @deffn {Scheme Procedure} thunk? obj
4329 @deffnx {C Function} scm_thunk_p (obj)
4330 Return @code{#t} if @var{obj} is a thunk.
4331 @end deffn
4332
4333 \fprocedure-documentation
4334 @c snarfed from procs.c:248
4335 @deffn {Scheme Procedure} procedure-documentation proc
4336 @deffnx {C Function} scm_procedure_documentation (proc)
4337 Return the documentation string associated with @code{proc}. By
4338 convention, if a procedure contains more than one expression and the
4339 first expression is a string constant, that string is assumed to contain
4340 documentation for that procedure.
4341 @end deffn
4342
4343 \fprocedure-with-setter?
4344 @c snarfed from procs.c:284
4345 @deffn {Scheme Procedure} procedure-with-setter? obj
4346 @deffnx {C Function} scm_procedure_with_setter_p (obj)
4347 Return @code{#t} if @var{obj} is a procedure with an
4348 associated setter procedure.
4349 @end deffn
4350
4351 \fmake-procedure-with-setter
4352 @c snarfed from procs.c:294
4353 @deffn {Scheme Procedure} make-procedure-with-setter procedure setter
4354 @deffnx {C Function} scm_make_procedure_with_setter (procedure, setter)
4355 Create a new procedure which behaves like @var{procedure}, but
4356 with the associated setter @var{setter}.
4357 @end deffn
4358
4359 \fprocedure
4360 @c snarfed from procs.c:308
4361 @deffn {Scheme Procedure} procedure proc
4362 @deffnx {C Function} scm_procedure (proc)
4363 Return the procedure of @var{proc}, which must be an
4364 applicable struct.
4365 @end deffn
4366
4367 \fprimitive-make-property
4368 @c snarfed from properties.c:40
4369 @deffn {Scheme Procedure} primitive-make-property not_found_proc
4370 @deffnx {C Function} scm_primitive_make_property (not_found_proc)
4371 Create a @dfn{property token} that can be used with
4372 @code{primitive-property-ref} and @code{primitive-property-set!}.
4373 See @code{primitive-property-ref} for the significance of
4374 @var{not_found_proc}.
4375 @end deffn
4376
4377 \fprimitive-property-ref
4378 @c snarfed from properties.c:59
4379 @deffn {Scheme Procedure} primitive-property-ref prop obj
4380 @deffnx {C Function} scm_primitive_property_ref (prop, obj)
4381 Return the property @var{prop} of @var{obj}.
4382
4383 When no value has yet been associated with @var{prop} and
4384 @var{obj}, the @var{not-found-proc} from @var{prop} is used. A
4385 call @code{(@var{not-found-proc} @var{prop} @var{obj})} is made
4386 and the result set as the property value. If
4387 @var{not-found-proc} is @code{#f} then @code{#f} is the
4388 property value.
4389 @end deffn
4390
4391 \fprimitive-property-set!
4392 @c snarfed from properties.c:90
4393 @deffn {Scheme Procedure} primitive-property-set! prop obj val
4394 @deffnx {C Function} scm_primitive_property_set_x (prop, obj, val)
4395 Set the property @var{prop} of @var{obj} to @var{val}.
4396 @end deffn
4397
4398 \fprimitive-property-del!
4399 @c snarfed from properties.c:111
4400 @deffn {Scheme Procedure} primitive-property-del! prop obj
4401 @deffnx {C Function} scm_primitive_property_del_x (prop, obj)
4402 Remove any value associated with @var{prop} and @var{obj}.
4403 @end deffn
4404
4405 \frandom
4406 @c snarfed from random.c:347
4407 @deffn {Scheme Procedure} random n [state]
4408 @deffnx {C Function} scm_random (n, state)
4409 Return a number in [0, N).
4410
4411 Accepts a positive integer or real n and returns a
4412 number of the same type between zero (inclusive) and
4413 N (exclusive). The values returned have a uniform
4414 distribution.
4415
4416 The optional argument @var{state} must be of the type produced
4417 by @code{seed->random-state}. It defaults to the value of the
4418 variable @var{*random-state*}. This object is used to maintain
4419 the state of the pseudo-random-number generator and is altered
4420 as a side effect of the random operation.
4421 @end deffn
4422
4423 \fcopy-random-state
4424 @c snarfed from random.c:372
4425 @deffn {Scheme Procedure} copy-random-state [state]
4426 @deffnx {C Function} scm_copy_random_state (state)
4427 Return a copy of the random state @var{state}.
4428 @end deffn
4429
4430 \fseed->random-state
4431 @c snarfed from random.c:384
4432 @deffn {Scheme Procedure} seed->random-state seed
4433 @deffnx {C Function} scm_seed_to_random_state (seed)
4434 Return a new random state using @var{seed}.
4435 @end deffn
4436
4437 \frandom:uniform
4438 @c snarfed from random.c:402
4439 @deffn {Scheme Procedure} random:uniform [state]
4440 @deffnx {C Function} scm_random_uniform (state)
4441 Return a uniformly distributed inexact real random number in
4442 [0,1).
4443 @end deffn
4444
4445 \frandom:normal
4446 @c snarfed from random.c:417
4447 @deffn {Scheme Procedure} random:normal [state]
4448 @deffnx {C Function} scm_random_normal (state)
4449 Return an inexact real in a normal distribution. The
4450 distribution used has mean 0 and standard deviation 1. For a
4451 normal distribution with mean m and standard deviation d use
4452 @code{(+ m (* d (random:normal)))}.
4453 @end deffn
4454
4455 \frandom:solid-sphere!
4456 @c snarfed from random.c:500
4457 @deffn {Scheme Procedure} random:solid-sphere! v [state]
4458 @deffnx {C Function} scm_random_solid_sphere_x (v, state)
4459 Fills @var{vect} with inexact real random numbers the sum of
4460 whose squares is less than 1.0. Thinking of @var{vect} as
4461 coordinates in space of dimension @var{n} @math{=}
4462 @code{(vector-length @var{vect})}, the coordinates are
4463 uniformly distributed within the unit @var{n}-sphere.
4464 @end deffn
4465
4466 \frandom:hollow-sphere!
4467 @c snarfed from random.c:522
4468 @deffn {Scheme Procedure} random:hollow-sphere! v [state]
4469 @deffnx {C Function} scm_random_hollow_sphere_x (v, state)
4470 Fills vect with inexact real random numbers
4471 the sum of whose squares is equal to 1.0.
4472 Thinking of vect as coordinates in space of
4473 dimension n = (vector-length vect), the coordinates
4474 are uniformly distributed over the surface of the
4475 unit n-sphere.
4476 @end deffn
4477
4478 \frandom:normal-vector!
4479 @c snarfed from random.c:539
4480 @deffn {Scheme Procedure} random:normal-vector! v [state]
4481 @deffnx {C Function} scm_random_normal_vector_x (v, state)
4482 Fills vect with inexact real random numbers that are
4483 independent and standard normally distributed
4484 (i.e., with mean 0 and variance 1).
4485 @end deffn
4486
4487 \frandom:exp
4488 @c snarfed from random.c:577
4489 @deffn {Scheme Procedure} random:exp [state]
4490 @deffnx {C Function} scm_random_exp (state)
4491 Return an inexact real in an exponential distribution with mean
4492 1. For an exponential distribution with mean u use (* u
4493 (random:exp)).
4494 @end deffn
4495
4496 \f%read-delimited!
4497 @c snarfed from rdelim.c:55
4498 @deffn {Scheme Procedure} %read-delimited! delims str gobble [port [start [end]]]
4499 @deffnx {C Function} scm_read_delimited_x (delims, str, gobble, port, start, end)
4500 Read characters from @var{port} into @var{str} until one of the
4501 characters in the @var{delims} string is encountered. If
4502 @var{gobble} is true, discard the delimiter character;
4503 otherwise, leave it in the input stream for the next read. If
4504 @var{port} is not specified, use the value of
4505 @code{(current-input-port)}. If @var{start} or @var{end} are
4506 specified, store data only into the substring of @var{str}
4507 bounded by @var{start} and @var{end} (which default to the
4508 beginning and end of the string, respectively).
4509
4510 Return a pair consisting of the delimiter that terminated the
4511 string and the number of characters read. If reading stopped
4512 at the end of file, the delimiter returned is the
4513 @var{eof-object}; if the string was filled without encountering
4514 a delimiter, this value is @code{#f}.
4515 @end deffn
4516
4517 \f%read-line
4518 @c snarfed from rdelim.c:202
4519 @deffn {Scheme Procedure} %read-line [port]
4520 @deffnx {C Function} scm_read_line (port)
4521 Read a newline-terminated line from @var{port}, allocating storage as
4522 necessary. The newline terminator (if any) is removed from the string,
4523 and a pair consisting of the line and its delimiter is returned. The
4524 delimiter may be either a newline or the @var{eof-object}; if
4525 @code{%read-line} is called at the end of file, it returns the pair
4526 @code{(#<eof> . #<eof>)}.
4527 @end deffn
4528
4529 \fwrite-line
4530 @c snarfed from rdelim.c:255
4531 @deffn {Scheme Procedure} write-line obj [port]
4532 @deffnx {C Function} scm_write_line (obj, port)
4533 Display @var{obj} and a newline character to @var{port}. If
4534 @var{port} is not specified, @code{(current-output-port)} is
4535 used. This function is equivalent to:
4536 @lisp
4537 (display obj [port])
4538 (newline [port])
4539 @end lisp
4540 @end deffn
4541
4542 \fread-options-interface
4543 @c snarfed from read.c:110
4544 @deffn {Scheme Procedure} read-options-interface [setting]
4545 @deffnx {C Function} scm_read_options (setting)
4546 Option interface for the read options. Instead of using
4547 this procedure directly, use the procedures @code{read-enable},
4548 @code{read-disable}, @code{read-set!} and @code{read-options}.
4549 @end deffn
4550
4551 \fread
4552 @c snarfed from read.c:130
4553 @deffn {Scheme Procedure} read [port]
4554 @deffnx {C Function} scm_read (port)
4555 Read an s-expression from the input port @var{port}, or from
4556 the current input port if @var{port} is not specified.
4557 Any whitespace before the next token is discarded.
4558 @end deffn
4559
4560 \fread-hash-extend
4561 @c snarfed from read.c:898
4562 @deffn {Scheme Procedure} read-hash-extend chr proc
4563 @deffnx {C Function} scm_read_hash_extend (chr, proc)
4564 Install the procedure @var{proc} for reading expressions
4565 starting with the character sequence @code{#} and @var{chr}.
4566 @var{proc} will be called with two arguments: the character
4567 @var{chr} and the port to read further data from. The object
4568 returned will be the return value of @code{read}.
4569 Passing @code{#f} for @var{proc} will remove a previous setting.
4570
4571 @end deffn
4572
4573 \fcall-with-dynamic-root
4574 @c snarfed from root.c:160
4575 @deffn {Scheme Procedure} call-with-dynamic-root thunk handler
4576 @deffnx {C Function} scm_call_with_dynamic_root (thunk, handler)
4577 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}.
4578 @end deffn
4579
4580 \fdynamic-root
4581 @c snarfed from root.c:171
4582 @deffn {Scheme Procedure} dynamic-root
4583 @deffnx {C Function} scm_dynamic_root ()
4584 Return an object representing the current dynamic root.
4585
4586 These objects are only useful for comparison using @code{eq?}.
4587
4588 @end deffn
4589
4590 \fread-string!/partial
4591 @c snarfed from rw.c:101
4592 @deffn {Scheme Procedure} read-string!/partial str [port_or_fdes [start [end]]]
4593 @deffnx {C Function} scm_read_string_x_partial (str, port_or_fdes, start, end)
4594 Read characters from a port or file descriptor into a
4595 string @var{str}. A port must have an underlying file
4596 descriptor --- a so-called fport. This procedure is
4597 scsh-compatible and can efficiently read large strings.
4598 It will:
4599
4600 @itemize
4601 @item
4602 attempt to fill the entire string, unless the @var{start}
4603 and/or @var{end} arguments are supplied. i.e., @var{start}
4604 defaults to 0 and @var{end} defaults to
4605 @code{(string-length str)}
4606 @item
4607 use the current input port if @var{port_or_fdes} is not
4608 supplied.
4609 @item
4610 return fewer than the requested number of characters in some
4611 cases, e.g., on end of file, if interrupted by a signal, or if
4612 not all the characters are immediately available.
4613 @item
4614 wait indefinitely for some input if no characters are
4615 currently available,
4616 unless the port is in non-blocking mode.
4617 @item
4618 read characters from the port's input buffers if available,
4619 instead from the underlying file descriptor.
4620 @item
4621 return @code{#f} if end-of-file is encountered before reading
4622 any characters, otherwise return the number of characters
4623 read.
4624 @item
4625 return 0 if the port is in non-blocking mode and no characters
4626 are immediately available.
4627 @item
4628 return 0 if the request is for 0 bytes, with no
4629 end-of-file check.
4630 @end itemize
4631 @end deffn
4632
4633 \fwrite-string/partial
4634 @c snarfed from rw.c:205
4635 @deffn {Scheme Procedure} write-string/partial str [port_or_fdes [start [end]]]
4636 @deffnx {C Function} scm_write_string_partial (str, port_or_fdes, start, end)
4637 Write characters from a string @var{str} to a port or file
4638 descriptor. A port must have an underlying file descriptor
4639 --- a so-called fport. This procedure is
4640 scsh-compatible and can efficiently write large strings.
4641 It will:
4642
4643 @itemize
4644 @item
4645 attempt to write the entire string, unless the @var{start}
4646 and/or @var{end} arguments are supplied. i.e., @var{start}
4647 defaults to 0 and @var{end} defaults to
4648 @code{(string-length str)}
4649 @item
4650 use the current output port if @var{port_of_fdes} is not
4651 supplied.
4652 @item
4653 in the case of a buffered port, store the characters in the
4654 port's output buffer, if all will fit. If they will not fit
4655 then any existing buffered characters will be flushed
4656 before attempting
4657 to write the new characters directly to the underlying file
4658 descriptor. If the port is in non-blocking mode and
4659 buffered characters can not be flushed immediately, then an
4660 @code{EAGAIN} system-error exception will be raised (Note:
4661 scsh does not support the use of non-blocking buffered ports.)
4662 @item
4663 write fewer than the requested number of
4664 characters in some cases, e.g., if interrupted by a signal or
4665 if not all of the output can be accepted immediately.
4666 @item
4667 wait indefinitely for at least one character
4668 from @var{str} to be accepted by the port, unless the port is
4669 in non-blocking mode.
4670 @item
4671 return the number of characters accepted by the port.
4672 @item
4673 return 0 if the port is in non-blocking mode and can not accept
4674 at least one character from @var{str} immediately
4675 @item
4676 return 0 immediately if the request size is 0 bytes.
4677 @end itemize
4678 @end deffn
4679
4680 \fsigaction
4681 @c snarfed from scmsigs.c:253
4682 @deffn {Scheme Procedure} sigaction signum [handler [flags [thread]]]
4683 @deffnx {C Function} scm_sigaction_for_thread (signum, handler, flags, thread)
4684 Install or report the signal handler for a specified signal.
4685
4686 @var{signum} is the signal number, which can be specified using the value
4687 of variables such as @code{SIGINT}.
4688
4689 If @var{handler} is omitted, @code{sigaction} returns a pair: the
4690 CAR is the current
4691 signal hander, which will be either an integer with the value @code{SIG_DFL}
4692 (default action) or @code{SIG_IGN} (ignore), or the Scheme procedure which
4693 handles the signal, or @code{#f} if a non-Scheme procedure handles the
4694 signal. The CDR contains the current @code{sigaction} flags for the handler.
4695
4696 If @var{handler} is provided, it is installed as the new handler for
4697 @var{signum}. @var{handler} can be a Scheme procedure taking one
4698 argument, or the value of @code{SIG_DFL} (default action) or
4699 @code{SIG_IGN} (ignore), or @code{#f} to restore whatever signal handler
4700 was installed before @code{sigaction} was first used. When
4701 a scheme procedure has been specified, that procedure will run
4702 in the given @var{thread}. When no thread has been given, the
4703 thread that made this call to @code{sigaction} is used.
4704 Flags can optionally be specified for the new handler (@code{SA_RESTART} will
4705 always be added if it's available and the system is using restartable
4706 system calls.) The return value is a pair with information about the
4707 old handler as described above.
4708
4709 This interface does not provide access to the "signal blocking"
4710 facility. Maybe this is not needed, since the thread support may
4711 provide solutions to the problem of consistent access to data
4712 structures.
4713 @end deffn
4714
4715 \frestore-signals
4716 @c snarfed from scmsigs.c:427
4717 @deffn {Scheme Procedure} restore-signals
4718 @deffnx {C Function} scm_restore_signals ()
4719 Return all signal handlers to the values they had before any call to
4720 @code{sigaction} was made. The return value is unspecified.
4721 @end deffn
4722
4723 \falarm
4724 @c snarfed from scmsigs.c:464
4725 @deffn {Scheme Procedure} alarm i
4726 @deffnx {C Function} scm_alarm (i)
4727 Set a timer to raise a @code{SIGALRM} signal after the specified
4728 number of seconds (an integer). It's advisable to install a signal
4729 handler for
4730 @code{SIGALRM} beforehand, since the default action is to terminate
4731 the process.
4732
4733 The return value indicates the time remaining for the previous alarm,
4734 if any. The new value replaces the previous alarm. If there was
4735 no previous alarm, the return value is zero.
4736 @end deffn
4737
4738 \fsetitimer
4739 @c snarfed from scmsigs.c:491
4740 @deffn {Scheme Procedure} setitimer which_timer interval_seconds interval_microseconds value_seconds value_microseconds
4741 @deffnx {C Function} scm_setitimer (which_timer, interval_seconds, interval_microseconds, value_seconds, value_microseconds)
4742 Set the timer specified by @var{which_timer} according to the given
4743 @var{interval_seconds}, @var{interval_microseconds},
4744 @var{value_seconds}, and @var{value_microseconds} values.
4745
4746 Return information about the timer's previous setting.
4747 Errors are handled as described in the guile info pages under ``POSIX
4748 Interface Conventions''.
4749
4750 The timers available are: @code{ITIMER_REAL}, @code{ITIMER_VIRTUAL},
4751 and @code{ITIMER_PROF}.
4752
4753 The return value will be a list of two cons pairs representing the
4754 current state of the given timer. The first pair is the seconds and
4755 microseconds of the timer @code{it_interval}, and the second pair is
4756 the seconds and microseconds of the timer @code{it_value}.
4757 @end deffn
4758
4759 \fgetitimer
4760 @c snarfed from scmsigs.c:532
4761 @deffn {Scheme Procedure} getitimer which_timer
4762 @deffnx {C Function} scm_getitimer (which_timer)
4763 Return information about the timer specified by @var{which_timer}
4764 Errors are handled as described in the guile info pages under ``POSIX
4765 Interface Conventions''.
4766
4767 The timers available are: @code{ITIMER_REAL}, @code{ITIMER_VIRTUAL},
4768 and @code{ITIMER_PROF}.
4769
4770 The return value will be a list of two cons pairs representing the
4771 current state of the given timer. The first pair is the seconds and
4772 microseconds of the timer @code{it_interval}, and the second pair is
4773 the seconds and microseconds of the timer @code{it_value}.
4774 @end deffn
4775
4776 \fpause
4777 @c snarfed from scmsigs.c:559
4778 @deffn {Scheme Procedure} pause
4779 @deffnx {C Function} scm_pause ()
4780 Pause the current process (thread?) until a signal arrives whose
4781 action is to either terminate the current process or invoke a
4782 handler procedure. The return value is unspecified.
4783 @end deffn
4784
4785 \fsleep
4786 @c snarfed from scmsigs.c:572
4787 @deffn {Scheme Procedure} sleep i
4788 @deffnx {C Function} scm_sleep (i)
4789 Wait for the given number of seconds (an integer) or until a signal
4790 arrives. The return value is zero if the time elapses or the number
4791 of seconds remaining otherwise.
4792 @end deffn
4793
4794 \fusleep
4795 @c snarfed from scmsigs.c:581
4796 @deffn {Scheme Procedure} usleep i
4797 @deffnx {C Function} scm_usleep (i)
4798 Sleep for @var{i} microseconds.
4799 @end deffn
4800
4801 \fraise
4802 @c snarfed from scmsigs.c:591
4803 @deffn {Scheme Procedure} raise sig
4804 @deffnx {C Function} scm_raise (sig)
4805 Sends a specified signal @var{sig} to the current process, where
4806 @var{sig} is as described for the kill procedure.
4807 @end deffn
4808
4809 \fsystem
4810 @c snarfed from simpos.c:64
4811 @deffn {Scheme Procedure} system [cmd]
4812 @deffnx {C Function} scm_system (cmd)
4813 Execute @var{cmd} using the operating system's "command
4814 processor". Under Unix this is usually the default shell
4815 @code{sh}. The value returned is @var{cmd}'s exit status as
4816 returned by @code{waitpid}, which can be interpreted using
4817 @code{status:exit-val} and friends.
4818
4819 If @code{system} is called without arguments, return a boolean
4820 indicating whether the command processor is available.
4821 @end deffn
4822
4823 \fsystem*
4824 @c snarfed from simpos.c:114
4825 @deffn {Scheme Procedure} system* . args
4826 @deffnx {C Function} scm_system_star (args)
4827 Execute the command indicated by @var{args}. The first element must
4828 be a string indicating the command to be executed, and the remaining
4829 items must be strings representing each of the arguments to that
4830 command.
4831
4832 This function returns the exit status of the command as provided by
4833 @code{waitpid}. This value can be handled with @code{status:exit-val}
4834 and the related functions.
4835
4836 @code{system*} is similar to @code{system}, but accepts only one
4837 string per-argument, and performs no shell interpretation. The
4838 command is executed using fork and execlp. Accordingly this function
4839 may be safer than @code{system} in situations where shell
4840 interpretation is not required.
4841
4842 Example: (system* "echo" "foo" "bar")
4843 @end deffn
4844
4845 \fgetenv
4846 @c snarfed from simpos.c:184
4847 @deffn {Scheme Procedure} getenv nam
4848 @deffnx {C Function} scm_getenv (nam)
4849 Looks up the string @var{name} in the current environment. The return
4850 value is @code{#f} unless a string of the form @code{NAME=VALUE} is
4851 found, in which case the string @code{VALUE} is returned.
4852 @end deffn
4853
4854 \fprimitive-exit
4855 @c snarfed from simpos.c:200
4856 @deffn {Scheme Procedure} primitive-exit [status]
4857 @deffnx {C Function} scm_primitive_exit (status)
4858 Terminate the current process without unwinding the Scheme stack.
4859 This is would typically be useful after a fork. The exit status
4860 is @var{status} if supplied, otherwise zero.
4861 @end deffn
4862
4863 \frestricted-vector-sort!
4864 @c snarfed from sort.c:78
4865 @deffn {Scheme Procedure} restricted-vector-sort! vec less startpos endpos
4866 @deffnx {C Function} scm_restricted_vector_sort_x (vec, less, startpos, endpos)
4867 Sort the vector @var{vec}, using @var{less} for comparing
4868 the vector elements. @var{startpos} (inclusively) and
4869 @var{endpos} (exclusively) delimit
4870 the range of the vector which gets sorted. The return value
4871 is not specified.
4872 @end deffn
4873
4874 \fsorted?
4875 @c snarfed from sort.c:111
4876 @deffn {Scheme Procedure} sorted? items less
4877 @deffnx {C Function} scm_sorted_p (items, less)
4878 Return @code{#t} iff @var{items} is a list or a vector such that
4879 for all 1 <= i <= m, the predicate @var{less} returns true when
4880 applied to all elements i - 1 and i
4881 @end deffn
4882
4883 \fmerge
4884 @c snarfed from sort.c:186
4885 @deffn {Scheme Procedure} merge alist blist less
4886 @deffnx {C Function} scm_merge (alist, blist, less)
4887 Merge two already sorted lists into one.
4888 Given two lists @var{alist} and @var{blist}, such that
4889 @code{(sorted? alist less?)} and @code{(sorted? blist less?)},
4890 return a new list in which the elements of @var{alist} and
4891 @var{blist} have been stably interleaved so that
4892 @code{(sorted? (merge alist blist less?) less?)}.
4893 Note: this does _not_ accept vectors.
4894 @end deffn
4895
4896 \fmerge!
4897 @c snarfed from sort.c:303
4898 @deffn {Scheme Procedure} merge! alist blist less
4899 @deffnx {C Function} scm_merge_x (alist, blist, less)
4900 Takes two lists @var{alist} and @var{blist} such that
4901 @code{(sorted? alist less?)} and @code{(sorted? blist less?)} and
4902 returns a new list in which the elements of @var{alist} and
4903 @var{blist} have been stably interleaved so that
4904 @code{(sorted? (merge alist blist less?) less?)}.
4905 This is the destructive variant of @code{merge}
4906 Note: this does _not_ accept vectors.
4907 @end deffn
4908
4909 \fsort!
4910 @c snarfed from sort.c:373
4911 @deffn {Scheme Procedure} sort! items less
4912 @deffnx {C Function} scm_sort_x (items, less)
4913 Sort the sequence @var{items}, which may be a list or a
4914 vector. @var{less} is used for comparing the sequence
4915 elements. The sorting is destructive, that means that the
4916 input sequence is modified to produce the sorted result.
4917 This is not a stable sort.
4918 @end deffn
4919
4920 \fsort
4921 @c snarfed from sort.c:404
4922 @deffn {Scheme Procedure} sort items less
4923 @deffnx {C Function} scm_sort (items, less)
4924 Sort the sequence @var{items}, which may be a list or a
4925 vector. @var{less} is used for comparing the sequence
4926 elements. This is not a stable sort.
4927 @end deffn
4928
4929 \fstable-sort!
4930 @c snarfed from sort.c:487
4931 @deffn {Scheme Procedure} stable-sort! items less
4932 @deffnx {C Function} scm_stable_sort_x (items, less)
4933 Sort the sequence @var{items}, which may be a list or a
4934 vector. @var{less} is used for comparing the sequence elements.
4935 The sorting is destructive, that means that the input sequence
4936 is modified to produce the sorted result.
4937 This is a stable sort.
4938 @end deffn
4939
4940 \fstable-sort
4941 @c snarfed from sort.c:531
4942 @deffn {Scheme Procedure} stable-sort items less
4943 @deffnx {C Function} scm_stable_sort (items, less)
4944 Sort the sequence @var{items}, which may be a list or a
4945 vector. @var{less} is used for comparing the sequence elements.
4946 This is a stable sort.
4947 @end deffn
4948
4949 \fsort-list!
4950 @c snarfed from sort.c:549
4951 @deffn {Scheme Procedure} sort-list! items less
4952 @deffnx {C Function} scm_sort_list_x (items, less)
4953 Sort the list @var{items}, using @var{less} for comparing the
4954 list elements. The sorting is destructive, that means that the
4955 input list is modified to produce the sorted result.
4956 This is a stable sort.
4957 @end deffn
4958
4959 \fsort-list
4960 @c snarfed from sort.c:564
4961 @deffn {Scheme Procedure} sort-list items less
4962 @deffnx {C Function} scm_sort_list (items, less)
4963 Sort the list @var{items}, using @var{less} for comparing the
4964 list elements. This is a stable sort.
4965 @end deffn
4966
4967 \fsource-properties
4968 @c snarfed from srcprop.c:153
4969 @deffn {Scheme Procedure} source-properties obj
4970 @deffnx {C Function} scm_source_properties (obj)
4971 Return the source property association list of @var{obj}.
4972 @end deffn
4973
4974 \fset-source-properties!
4975 @c snarfed from srcprop.c:176
4976 @deffn {Scheme Procedure} set-source-properties! obj plist
4977 @deffnx {C Function} scm_set_source_properties_x (obj, plist)
4978 Install the association list @var{plist} as the source property
4979 list for @var{obj}.
4980 @end deffn
4981
4982 \fsource-property
4983 @c snarfed from srcprop.c:194
4984 @deffn {Scheme Procedure} source-property obj key
4985 @deffnx {C Function} scm_source_property (obj, key)
4986 Return the source property specified by @var{key} from
4987 @var{obj}'s source property list.
4988 @end deffn
4989
4990 \fset-source-property!
4991 @c snarfed from srcprop.c:225
4992 @deffn {Scheme Procedure} set-source-property! obj key datum
4993 @deffnx {C Function} scm_set_source_property_x (obj, key, datum)
4994 Set the source property of object @var{obj}, which is specified by
4995 @var{key} to @var{datum}. Normally, the key will be a symbol.
4996 @end deffn
4997
4998 \fstack?
4999 @c snarfed from stacks.c:391
5000 @deffn {Scheme Procedure} stack? obj
5001 @deffnx {C Function} scm_stack_p (obj)
5002 Return @code{#t} if @var{obj} is a calling stack.
5003 @end deffn
5004
5005 \fmake-stack
5006 @c snarfed from stacks.c:422
5007 @deffn {Scheme Procedure} make-stack obj . args
5008 @deffnx {C Function} scm_make_stack (obj, args)
5009 Create a new stack. If @var{obj} is @code{#t}, the current
5010 evaluation stack is used for creating the stack frames,
5011 otherwise the frames are taken from @var{obj} (which must be
5012 either a debug object or a continuation).
5013
5014 @var{args} should be a list containing any combination of
5015 integer, procedure and @code{#t} values.
5016
5017 These values specify various ways of cutting away uninteresting
5018 stack frames from the top and bottom of the stack that
5019 @code{make-stack} returns. They come in pairs like this:
5020 @code{(@var{inner_cut_1} @var{outer_cut_1} @var{inner_cut_2}
5021 @var{outer_cut_2} @dots{})}.
5022
5023 Each @var{inner_cut_N} can be @code{#t}, an integer, or a
5024 procedure. @code{#t} means to cut away all frames up to but
5025 excluding the first user module frame. An integer means to cut
5026 away exactly that number of frames. A procedure means to cut
5027 away all frames up to but excluding the application frame whose
5028 procedure matches the specified one.
5029
5030 Each @var{outer_cut_N} can be an integer or a procedure. An
5031 integer means to cut away that number of frames. A procedure
5032 means to cut away frames down to but excluding the application
5033 frame whose procedure matches the specified one.
5034
5035 If the @var{outer_cut_N} of the last pair is missing, it is
5036 taken as 0.
5037 @end deffn
5038
5039 \fstack-id
5040 @c snarfed from stacks.c:511
5041 @deffn {Scheme Procedure} stack-id stack
5042 @deffnx {C Function} scm_stack_id (stack)
5043 Return the identifier given to @var{stack} by @code{start-stack}.
5044 @end deffn
5045
5046 \fstack-ref
5047 @c snarfed from stacks.c:549
5048 @deffn {Scheme Procedure} stack-ref stack index
5049 @deffnx {C Function} scm_stack_ref (stack, index)
5050 Return the @var{index}'th frame from @var{stack}.
5051 @end deffn
5052
5053 \fstack-length
5054 @c snarfed from stacks.c:562
5055 @deffn {Scheme Procedure} stack-length stack
5056 @deffnx {C Function} scm_stack_length (stack)
5057 Return the length of @var{stack}.
5058 @end deffn
5059
5060 \fframe?
5061 @c snarfed from stacks.c:575
5062 @deffn {Scheme Procedure} frame? obj
5063 @deffnx {C Function} scm_frame_p (obj)
5064 Return @code{#t} if @var{obj} is a stack frame.
5065 @end deffn
5066
5067 \flast-stack-frame
5068 @c snarfed from stacks.c:586
5069 @deffn {Scheme Procedure} last-stack-frame obj
5070 @deffnx {C Function} scm_last_stack_frame (obj)
5071 Return a stack which consists of a single frame, which is the
5072 last stack frame for @var{obj}. @var{obj} must be either a
5073 debug object or a continuation.
5074 @end deffn
5075
5076 \fframe-number
5077 @c snarfed from stacks.c:625
5078 @deffn {Scheme Procedure} frame-number frame
5079 @deffnx {C Function} scm_frame_number (frame)
5080 Return the frame number of @var{frame}.
5081 @end deffn
5082
5083 \fframe-source
5084 @c snarfed from stacks.c:635
5085 @deffn {Scheme Procedure} frame-source frame
5086 @deffnx {C Function} scm_frame_source (frame)
5087 Return the source of @var{frame}.
5088 @end deffn
5089
5090 \fframe-procedure
5091 @c snarfed from stacks.c:646
5092 @deffn {Scheme Procedure} frame-procedure frame
5093 @deffnx {C Function} scm_frame_procedure (frame)
5094 Return the procedure for @var{frame}, or @code{#f} if no
5095 procedure is associated with @var{frame}.
5096 @end deffn
5097
5098 \fframe-arguments
5099 @c snarfed from stacks.c:658
5100 @deffn {Scheme Procedure} frame-arguments frame
5101 @deffnx {C Function} scm_frame_arguments (frame)
5102 Return the arguments of @var{frame}.
5103 @end deffn
5104
5105 \fframe-previous
5106 @c snarfed from stacks.c:669
5107 @deffn {Scheme Procedure} frame-previous frame
5108 @deffnx {C Function} scm_frame_previous (frame)
5109 Return the previous frame of @var{frame}, or @code{#f} if
5110 @var{frame} is the first frame in its stack.
5111 @end deffn
5112
5113 \fframe-next
5114 @c snarfed from stacks.c:685
5115 @deffn {Scheme Procedure} frame-next frame
5116 @deffnx {C Function} scm_frame_next (frame)
5117 Return the next frame of @var{frame}, or @code{#f} if
5118 @var{frame} is the last frame in its stack.
5119 @end deffn
5120
5121 \fframe-real?
5122 @c snarfed from stacks.c:700
5123 @deffn {Scheme Procedure} frame-real? frame
5124 @deffnx {C Function} scm_frame_real_p (frame)
5125 Return @code{#t} if @var{frame} is a real frame.
5126 @end deffn
5127
5128 \fframe-procedure?
5129 @c snarfed from stacks.c:710
5130 @deffn {Scheme Procedure} frame-procedure? frame
5131 @deffnx {C Function} scm_frame_procedure_p (frame)
5132 Return @code{#t} if a procedure is associated with @var{frame}.
5133 @end deffn
5134
5135 \fframe-evaluating-args?
5136 @c snarfed from stacks.c:720
5137 @deffn {Scheme Procedure} frame-evaluating-args? frame
5138 @deffnx {C Function} scm_frame_evaluating_args_p (frame)
5139 Return @code{#t} if @var{frame} contains evaluated arguments.
5140 @end deffn
5141
5142 \fframe-overflow?
5143 @c snarfed from stacks.c:730
5144 @deffn {Scheme Procedure} frame-overflow? frame
5145 @deffnx {C Function} scm_frame_overflow_p (frame)
5146 Return @code{#t} if @var{frame} is an overflow frame.
5147 @end deffn
5148
5149 \fget-internal-real-time
5150 @c snarfed from stime.c:133
5151 @deffn {Scheme Procedure} get-internal-real-time
5152 @deffnx {C Function} scm_get_internal_real_time ()
5153 Return the number of time units since the interpreter was
5154 started.
5155 @end deffn
5156
5157 \ftimes
5158 @c snarfed from stime.c:180
5159 @deffn {Scheme Procedure} times
5160 @deffnx {C Function} scm_times ()
5161 Return an object with information about real and processor
5162 time. The following procedures accept such an object as an
5163 argument and return a selected component:
5164
5165 @table @code
5166 @item tms:clock
5167 The current real time, expressed as time units relative to an
5168 arbitrary base.
5169 @item tms:utime
5170 The CPU time units used by the calling process.
5171 @item tms:stime
5172 The CPU time units used by the system on behalf of the calling
5173 process.
5174 @item tms:cutime
5175 The CPU time units used by terminated child processes of the
5176 calling process, whose status has been collected (e.g., using
5177 @code{waitpid}).
5178 @item tms:cstime
5179 Similarly, the CPU times units used by the system on behalf of
5180 terminated child processes.
5181 @end table
5182 @end deffn
5183
5184 \fget-internal-run-time
5185 @c snarfed from stime.c:212
5186 @deffn {Scheme Procedure} get-internal-run-time
5187 @deffnx {C Function} scm_get_internal_run_time ()
5188 Return the number of time units of processor time used by the
5189 interpreter. Both @emph{system} and @emph{user} time are
5190 included but subprocesses are not.
5191 @end deffn
5192
5193 \fcurrent-time
5194 @c snarfed from stime.c:229
5195 @deffn {Scheme Procedure} current-time
5196 @deffnx {C Function} scm_current_time ()
5197 Return the number of seconds since 1970-01-01 00:00:00 UTC,
5198 excluding leap seconds.
5199 @end deffn
5200
5201 \fgettimeofday
5202 @c snarfed from stime.c:248
5203 @deffn {Scheme Procedure} gettimeofday
5204 @deffnx {C Function} scm_gettimeofday ()
5205 Return a pair containing the number of seconds and microseconds
5206 since 1970-01-01 00:00:00 UTC, excluding leap seconds. Note:
5207 whether true microsecond resolution is available depends on the
5208 operating system.
5209 @end deffn
5210
5211 \flocaltime
5212 @c snarfed from stime.c:364
5213 @deffn {Scheme Procedure} localtime time [zone]
5214 @deffnx {C Function} scm_localtime (time, zone)
5215 Return an object representing the broken down components of
5216 @var{time}, an integer like the one returned by
5217 @code{current-time}. The time zone for the calculation is
5218 optionally specified by @var{zone} (a string), otherwise the
5219 @code{TZ} environment variable or the system default is used.
5220 @end deffn
5221
5222 \fgmtime
5223 @c snarfed from stime.c:449
5224 @deffn {Scheme Procedure} gmtime time
5225 @deffnx {C Function} scm_gmtime (time)
5226 Return an object representing the broken down components of
5227 @var{time}, an integer like the one returned by
5228 @code{current-time}. The values are calculated for UTC.
5229 @end deffn
5230
5231 \fmktime
5232 @c snarfed from stime.c:517
5233 @deffn {Scheme Procedure} mktime sbd_time [zone]
5234 @deffnx {C Function} scm_mktime (sbd_time, zone)
5235 @var{bd-time} is an object representing broken down time and @code{zone}
5236 is an optional time zone specifier (otherwise the TZ environment variable
5237 or the system default is used).
5238
5239 Returns a pair: the car is a corresponding
5240 integer time value like that returned
5241 by @code{current-time}; the cdr is a broken down time object, similar to
5242 as @var{bd-time} but with normalized values.
5243 @end deffn
5244
5245 \ftzset
5246 @c snarfed from stime.c:603
5247 @deffn {Scheme Procedure} tzset
5248 @deffnx {C Function} scm_tzset ()
5249 Initialize the timezone from the TZ environment variable
5250 or the system default. It's not usually necessary to call this procedure
5251 since it's done automatically by other procedures that depend on the
5252 timezone.
5253 @end deffn
5254
5255 \fstrftime
5256 @c snarfed from stime.c:620
5257 @deffn {Scheme Procedure} strftime format stime
5258 @deffnx {C Function} scm_strftime (format, stime)
5259 Formats a time specification @var{time} using @var{template}. @var{time}
5260 is an object with time components in the form returned by @code{localtime}
5261 or @code{gmtime}. @var{template} is a string which can include formatting
5262 specifications introduced by a @code{%} character. The formatting of
5263 month and day names is dependent on the current locale. The value returned
5264 is the formatted string.
5265 @xref{Formatting Date and Time, , , libc, The GNU C Library Reference Manual}.)
5266 @end deffn
5267
5268 \fstrptime
5269 @c snarfed from stime.c:721
5270 @deffn {Scheme Procedure} strptime format string
5271 @deffnx {C Function} scm_strptime (format, string)
5272 Performs the reverse action to @code{strftime}, parsing
5273 @var{string} according to the specification supplied in
5274 @var{template}. The interpretation of month and day names is
5275 dependent on the current locale. The value returned is a pair.
5276 The car has an object with time components
5277 in the form returned by @code{localtime} or @code{gmtime},
5278 but the time zone components
5279 are not usefully set.
5280 The cdr reports the number of characters from @var{string}
5281 which were used for the conversion.
5282 @end deffn
5283
5284 \fstring?
5285 @c snarfed from strings.c:526
5286 @deffn {Scheme Procedure} string? obj
5287 @deffnx {C Function} scm_string_p (obj)
5288 Return @code{#t} if @var{obj} is a string, else @code{#f}.
5289 @end deffn
5290
5291 \flist->string
5292 @c snarfed from strings.c:534
5293 @deffn {Scheme Procedure} list->string
5294 implemented by the C function "scm_string"
5295 @end deffn
5296
5297 \fstring
5298 @c snarfed from strings.c:540
5299 @deffn {Scheme Procedure} string . chrs
5300 @deffnx {Scheme Procedure} list->string chrs
5301 @deffnx {C Function} scm_string (chrs)
5302 Return a newly allocated string composed of the arguments,
5303 @var{chrs}.
5304 @end deffn
5305
5306 \fmake-string
5307 @c snarfed from strings.c:578
5308 @deffn {Scheme Procedure} make-string k [chr]
5309 @deffnx {C Function} scm_make_string (k, chr)
5310 Return a newly allocated string of
5311 length @var{k}. If @var{chr} is given, then all elements of
5312 the string are initialized to @var{chr}, otherwise the contents
5313 of the @var{string} are unspecified.
5314 @end deffn
5315
5316 \fstring-length
5317 @c snarfed from strings.c:604
5318 @deffn {Scheme Procedure} string-length string
5319 @deffnx {C Function} scm_string_length (string)
5320 Return the number of characters in @var{string}.
5321 @end deffn
5322
5323 \fstring-ref
5324 @c snarfed from strings.c:623
5325 @deffn {Scheme Procedure} string-ref str k
5326 @deffnx {C Function} scm_string_ref (str, k)
5327 Return character @var{k} of @var{str} using zero-origin
5328 indexing. @var{k} must be a valid index of @var{str}.
5329 @end deffn
5330
5331 \fstring-set!
5332 @c snarfed from strings.c:646
5333 @deffn {Scheme Procedure} string-set! str k chr
5334 @deffnx {C Function} scm_string_set_x (str, k, chr)
5335 Store @var{chr} in element @var{k} of @var{str} and return
5336 an unspecified value. @var{k} must be a valid index of
5337 @var{str}.
5338 @end deffn
5339
5340 \fsubstring
5341 @c snarfed from strings.c:682
5342 @deffn {Scheme Procedure} substring str start [end]
5343 @deffnx {C Function} scm_substring (str, start, end)
5344 Return a newly allocated string formed from the characters
5345 of @var{str} beginning with index @var{start} (inclusive) and
5346 ending with index @var{end} (exclusive).
5347 @var{str} must be a string, @var{start} and @var{end} must be
5348 exact integers satisfying:
5349
5350 0 <= @var{start} <= @var{end} <= (string-length @var{str}).
5351 @end deffn
5352
5353 \fsubstring/read-only
5354 @c snarfed from strings.c:708
5355 @deffn {Scheme Procedure} substring/read-only str start [end]
5356 @deffnx {C Function} scm_substring_read_only (str, start, end)
5357 Return a newly allocated string formed from the characters
5358 of @var{str} beginning with index @var{start} (inclusive) and
5359 ending with index @var{end} (exclusive).
5360 @var{str} must be a string, @var{start} and @var{end} must be
5361 exact integers satisfying:
5362
5363 0 <= @var{start} <= @var{end} <= (string-length @var{str}).
5364
5365 The returned string is read-only.
5366
5367 @end deffn
5368
5369 \fsubstring/copy
5370 @c snarfed from strings.c:731
5371 @deffn {Scheme Procedure} substring/copy str start [end]
5372 @deffnx {C Function} scm_substring_copy (str, start, end)
5373 Return a newly allocated string formed from the characters
5374 of @var{str} beginning with index @var{start} (inclusive) and
5375 ending with index @var{end} (exclusive).
5376 @var{str} must be a string, @var{start} and @var{end} must be
5377 exact integers satisfying:
5378
5379 0 <= @var{start} <= @var{end} <= (string-length @var{str}).
5380 @end deffn
5381
5382 \fsubstring/shared
5383 @c snarfed from strings.c:755
5384 @deffn {Scheme Procedure} substring/shared str start [end]
5385 @deffnx {C Function} scm_substring_shared (str, start, end)
5386 Return string that indirectly refers to the characters
5387 of @var{str} beginning with index @var{start} (inclusive) and
5388 ending with index @var{end} (exclusive).
5389 @var{str} must be a string, @var{start} and @var{end} must be
5390 exact integers satisfying:
5391
5392 0 <= @var{start} <= @var{end} <= (string-length @var{str}).
5393 @end deffn
5394
5395 \fstring-append
5396 @c snarfed from strings.c:774
5397 @deffn {Scheme Procedure} string-append . args
5398 @deffnx {C Function} scm_string_append (args)
5399 Return a newly allocated string whose characters form the
5400 concatenation of the given strings, @var{args}.
5401 @end deffn
5402
5403 \funiform-vector?
5404 @c snarfed from srfi-4.c:651
5405 @deffn {Scheme Procedure} uniform-vector? obj
5406 @deffnx {C Function} scm_uniform_vector_p (obj)
5407 Return @code{#t} if @var{obj} is a uniform vector.
5408 @end deffn
5409
5410 \funiform-vector-ref
5411 @c snarfed from srfi-4.c:677
5412 @deffn {Scheme Procedure} uniform-vector-ref v idx
5413 @deffnx {C Function} scm_uniform_vector_ref (v, idx)
5414 Return the element at index @var{idx} of the
5415 homogenous numeric vector @var{v}.
5416 @end deffn
5417
5418 \funiform-vector-set!
5419 @c snarfed from srfi-4.c:714
5420 @deffn {Scheme Procedure} uniform-vector-set! v idx val
5421 @deffnx {C Function} scm_uniform_vector_set_x (v, idx, val)
5422 Set the element at index @var{idx} of the
5423 homogenous numeric vector @var{v} to @var{val}.
5424 @end deffn
5425
5426 \funiform-vector->list
5427 @c snarfed from srfi-4.c:737
5428 @deffn {Scheme Procedure} uniform-vector->list uvec
5429 @deffnx {C Function} scm_uniform_vector_to_list (uvec)
5430 Convert the uniform numeric vector @var{uvec} to a list.
5431 @end deffn
5432
5433 \funiform-vector-length
5434 @c snarfed from srfi-4.c:820
5435 @deffn {Scheme Procedure} uniform-vector-length v
5436 @deffnx {C Function} scm_uniform_vector_length (v)
5437 Return the number of elements in the uniform vector @var{v}.
5438 @end deffn
5439
5440 \funiform-vector-read!
5441 @c snarfed from srfi-4.c:845
5442 @deffn {Scheme Procedure} uniform-array-read! ura [port_or_fd [start [end]]]
5443 @deffnx {Scheme Procedure} uniform-vector-read! uve [port-or-fdes] [start] [end]
5444 @deffnx {C Function} scm_uniform_array_read_x (ura, port_or_fd, start, end)
5445 Attempt to read all elements of @var{ura}, in lexicographic order, as
5446 binary objects from @var{port-or-fdes}.
5447 If an end of file is encountered,
5448 the objects up to that point are put into @var{ura}
5449 (starting at the beginning) and the remainder of the array is
5450 unchanged.
5451
5452 The optional arguments @var{start} and @var{end} allow
5453 a specified region of a vector (or linearized array) to be read,
5454 leaving the remainder of the vector unchanged.
5455
5456 @code{uniform-array-read!} returns the number of objects read.
5457 @var{port-or-fdes} may be omitted, in which case it defaults to the value
5458 returned by @code{(current-input-port)}.
5459 @end deffn
5460
5461 \funiform-vector-write
5462 @c snarfed from srfi-4.c:958
5463 @deffn {Scheme Procedure} uniform-vector-write uvec [port_or_fd [start [end]]]
5464 @deffnx {C Function} scm_uniform_vector_write (uvec, port_or_fd, start, end)
5465 Write the elements of @var{uvec} as raw bytes to
5466 @var{port-or-fdes}, in the host byte order.
5467
5468 The optional arguments @var{start} (inclusive)
5469 and @var{end} (exclusive) allow
5470 a specified region to be written.
5471
5472 When @var{port-or-fdes} is a port, all specified elements
5473 of @var{uvec} are attempted to be written, potentially blocking
5474 while waiting for more room.
5475 When @var{port-or-fd} is an integer, a single call to
5476 write(2) is made.
5477
5478 An error is signalled when the last element has only
5479 been partially written in the single call to write(2).
5480
5481 The number of objects actually written is returned.
5482 @var{port-or-fdes} may be
5483 omitted, in which case it defaults to the value returned by
5484 @code{(current-output-port)}.
5485 @end deffn
5486
5487 \fu8vector?
5488 @c snarfed from ../libguile/srfi-4.i.c:41
5489 @deffn {Scheme Procedure} u8vector? obj
5490 @deffnx {C Function} scm_u8vector_p (obj)
5491 Return @code{#t} if @var{obj} is a vector of type u8,
5492 @code{#f} otherwise.
5493 @end deffn
5494
5495 \fmake-u8vector
5496 @c snarfed from ../libguile/srfi-4.i.c:53
5497 @deffn {Scheme Procedure} make-u8vector len [fill]
5498 @deffnx {C Function} scm_make_u8vector (len, fill)
5499 Return a newly allocated uniform numeric vector which can
5500 hold @var{len} elements. If @var{fill} is given, it is used to
5501 initialize the elements, otherwise the contents of the vector
5502 is unspecified.
5503 @end deffn
5504
5505 \fu8vector
5506 @c snarfed from ../libguile/srfi-4.i.c:63
5507 @deffn {Scheme Procedure} u8vector . l
5508 @deffnx {C Function} scm_u8vector (l)
5509 Return a newly allocated uniform numeric vector containing
5510 all argument values.
5511 @end deffn
5512
5513 \fu8vector-length
5514 @c snarfed from ../libguile/srfi-4.i.c:74
5515 @deffn {Scheme Procedure} u8vector-length uvec
5516 @deffnx {C Function} scm_u8vector_length (uvec)
5517 Return the number of elements in the uniform numeric vector
5518 @var{uvec}.
5519 @end deffn
5520
5521 \fu8vector-ref
5522 @c snarfed from ../libguile/srfi-4.i.c:85
5523 @deffn {Scheme Procedure} u8vector-ref uvec index
5524 @deffnx {C Function} scm_u8vector_ref (uvec, index)
5525 Return the element at @var{index} in the uniform numeric
5526 vector @var{uvec}.
5527 @end deffn
5528
5529 \fu8vector-set!
5530 @c snarfed from ../libguile/srfi-4.i.c:97
5531 @deffn {Scheme Procedure} u8vector-set! uvec index value
5532 @deffnx {C Function} scm_u8vector_set_x (uvec, index, value)
5533 Set the element at @var{index} in the uniform numeric
5534 vector @var{uvec} to @var{value}. The return value is not
5535 specified.
5536 @end deffn
5537
5538 \fu8vector->list
5539 @c snarfed from ../libguile/srfi-4.i.c:107
5540 @deffn {Scheme Procedure} u8vector->list uvec
5541 @deffnx {C Function} scm_u8vector_to_list (uvec)
5542 Convert the uniform numeric vector @var{uvec} to a list.
5543 @end deffn
5544
5545 \flist->u8vector
5546 @c snarfed from ../libguile/srfi-4.i.c:117
5547 @deffn {Scheme Procedure} list->u8vector l
5548 @deffnx {C Function} scm_list_to_u8vector (l)
5549 Convert the list @var{l} to a numeric uniform vector.
5550 @end deffn
5551
5552 \fany->u8vector
5553 @c snarfed from ../libguile/srfi-4.i.c:128
5554 @deffn {Scheme Procedure} any->u8vector obj
5555 @deffnx {C Function} scm_any_to_u8vector (obj)
5556 Convert @var{obj}, which can be a list, vector, or
5557 uniform vector, to a numeric uniform vector of
5558 type u8.
5559 @end deffn
5560
5561 \fs8vector?
5562 @c snarfed from ../libguile/srfi-4.i.c:41
5563 @deffn {Scheme Procedure} s8vector? obj
5564 @deffnx {C Function} scm_s8vector_p (obj)
5565 Return @code{#t} if @var{obj} is a vector of type s8,
5566 @code{#f} otherwise.
5567 @end deffn
5568
5569 \fmake-s8vector
5570 @c snarfed from ../libguile/srfi-4.i.c:53
5571 @deffn {Scheme Procedure} make-s8vector len [fill]
5572 @deffnx {C Function} scm_make_s8vector (len, fill)
5573 Return a newly allocated uniform numeric vector which can
5574 hold @var{len} elements. If @var{fill} is given, it is used to
5575 initialize the elements, otherwise the contents of the vector
5576 is unspecified.
5577 @end deffn
5578
5579 \fs8vector
5580 @c snarfed from ../libguile/srfi-4.i.c:63
5581 @deffn {Scheme Procedure} s8vector . l
5582 @deffnx {C Function} scm_s8vector (l)
5583 Return a newly allocated uniform numeric vector containing
5584 all argument values.
5585 @end deffn
5586
5587 \fs8vector-length
5588 @c snarfed from ../libguile/srfi-4.i.c:74
5589 @deffn {Scheme Procedure} s8vector-length uvec
5590 @deffnx {C Function} scm_s8vector_length (uvec)
5591 Return the number of elements in the uniform numeric vector
5592 @var{uvec}.
5593 @end deffn
5594
5595 \fs8vector-ref
5596 @c snarfed from ../libguile/srfi-4.i.c:85
5597 @deffn {Scheme Procedure} s8vector-ref uvec index
5598 @deffnx {C Function} scm_s8vector_ref (uvec, index)
5599 Return the element at @var{index} in the uniform numeric
5600 vector @var{uvec}.
5601 @end deffn
5602
5603 \fs8vector-set!
5604 @c snarfed from ../libguile/srfi-4.i.c:97
5605 @deffn {Scheme Procedure} s8vector-set! uvec index value
5606 @deffnx {C Function} scm_s8vector_set_x (uvec, index, value)
5607 Set the element at @var{index} in the uniform numeric
5608 vector @var{uvec} to @var{value}. The return value is not
5609 specified.
5610 @end deffn
5611
5612 \fs8vector->list
5613 @c snarfed from ../libguile/srfi-4.i.c:107
5614 @deffn {Scheme Procedure} s8vector->list uvec
5615 @deffnx {C Function} scm_s8vector_to_list (uvec)
5616 Convert the uniform numeric vector @var{uvec} to a list.
5617 @end deffn
5618
5619 \flist->s8vector
5620 @c snarfed from ../libguile/srfi-4.i.c:117
5621 @deffn {Scheme Procedure} list->s8vector l
5622 @deffnx {C Function} scm_list_to_s8vector (l)
5623 Convert the list @var{l} to a numeric uniform vector.
5624 @end deffn
5625
5626 \fany->s8vector
5627 @c snarfed from ../libguile/srfi-4.i.c:128
5628 @deffn {Scheme Procedure} any->s8vector obj
5629 @deffnx {C Function} scm_any_to_s8vector (obj)
5630 Convert @var{obj}, which can be a list, vector, or
5631 uniform vector, to a numeric uniform vector of
5632 type s8.
5633 @end deffn
5634
5635 \fu16vector?
5636 @c snarfed from ../libguile/srfi-4.i.c:41
5637 @deffn {Scheme Procedure} u16vector? obj
5638 @deffnx {C Function} scm_u16vector_p (obj)
5639 Return @code{#t} if @var{obj} is a vector of type u16,
5640 @code{#f} otherwise.
5641 @end deffn
5642
5643 \fmake-u16vector
5644 @c snarfed from ../libguile/srfi-4.i.c:53
5645 @deffn {Scheme Procedure} make-u16vector len [fill]
5646 @deffnx {C Function} scm_make_u16vector (len, fill)
5647 Return a newly allocated uniform numeric vector which can
5648 hold @var{len} elements. If @var{fill} is given, it is used to
5649 initialize the elements, otherwise the contents of the vector
5650 is unspecified.
5651 @end deffn
5652
5653 \fu16vector
5654 @c snarfed from ../libguile/srfi-4.i.c:63
5655 @deffn {Scheme Procedure} u16vector . l
5656 @deffnx {C Function} scm_u16vector (l)
5657 Return a newly allocated uniform numeric vector containing
5658 all argument values.
5659 @end deffn
5660
5661 \fu16vector-length
5662 @c snarfed from ../libguile/srfi-4.i.c:74
5663 @deffn {Scheme Procedure} u16vector-length uvec
5664 @deffnx {C Function} scm_u16vector_length (uvec)
5665 Return the number of elements in the uniform numeric vector
5666 @var{uvec}.
5667 @end deffn
5668
5669 \fu16vector-ref
5670 @c snarfed from ../libguile/srfi-4.i.c:85
5671 @deffn {Scheme Procedure} u16vector-ref uvec index
5672 @deffnx {C Function} scm_u16vector_ref (uvec, index)
5673 Return the element at @var{index} in the uniform numeric
5674 vector @var{uvec}.
5675 @end deffn
5676
5677 \fu16vector-set!
5678 @c snarfed from ../libguile/srfi-4.i.c:97
5679 @deffn {Scheme Procedure} u16vector-set! uvec index value
5680 @deffnx {C Function} scm_u16vector_set_x (uvec, index, value)
5681 Set the element at @var{index} in the uniform numeric
5682 vector @var{uvec} to @var{value}. The return value is not
5683 specified.
5684 @end deffn
5685
5686 \fu16vector->list
5687 @c snarfed from ../libguile/srfi-4.i.c:107
5688 @deffn {Scheme Procedure} u16vector->list uvec
5689 @deffnx {C Function} scm_u16vector_to_list (uvec)
5690 Convert the uniform numeric vector @var{uvec} to a list.
5691 @end deffn
5692
5693 \flist->u16vector
5694 @c snarfed from ../libguile/srfi-4.i.c:117
5695 @deffn {Scheme Procedure} list->u16vector l
5696 @deffnx {C Function} scm_list_to_u16vector (l)
5697 Convert the list @var{l} to a numeric uniform vector.
5698 @end deffn
5699
5700 \fany->u16vector
5701 @c snarfed from ../libguile/srfi-4.i.c:128
5702 @deffn {Scheme Procedure} any->u16vector obj
5703 @deffnx {C Function} scm_any_to_u16vector (obj)
5704 Convert @var{obj}, which can be a list, vector, or
5705 uniform vector, to a numeric uniform vector of
5706 type u16.
5707 @end deffn
5708
5709 \fs16vector?
5710 @c snarfed from ../libguile/srfi-4.i.c:41
5711 @deffn {Scheme Procedure} s16vector? obj
5712 @deffnx {C Function} scm_s16vector_p (obj)
5713 Return @code{#t} if @var{obj} is a vector of type s16,
5714 @code{#f} otherwise.
5715 @end deffn
5716
5717 \fmake-s16vector
5718 @c snarfed from ../libguile/srfi-4.i.c:53
5719 @deffn {Scheme Procedure} make-s16vector len [fill]
5720 @deffnx {C Function} scm_make_s16vector (len, fill)
5721 Return a newly allocated uniform numeric vector which can
5722 hold @var{len} elements. If @var{fill} is given, it is used to
5723 initialize the elements, otherwise the contents of the vector
5724 is unspecified.
5725 @end deffn
5726
5727 \fs16vector
5728 @c snarfed from ../libguile/srfi-4.i.c:63
5729 @deffn {Scheme Procedure} s16vector . l
5730 @deffnx {C Function} scm_s16vector (l)
5731 Return a newly allocated uniform numeric vector containing
5732 all argument values.
5733 @end deffn
5734
5735 \fs16vector-length
5736 @c snarfed from ../libguile/srfi-4.i.c:74
5737 @deffn {Scheme Procedure} s16vector-length uvec
5738 @deffnx {C Function} scm_s16vector_length (uvec)
5739 Return the number of elements in the uniform numeric vector
5740 @var{uvec}.
5741 @end deffn
5742
5743 \fs16vector-ref
5744 @c snarfed from ../libguile/srfi-4.i.c:85
5745 @deffn {Scheme Procedure} s16vector-ref uvec index
5746 @deffnx {C Function} scm_s16vector_ref (uvec, index)
5747 Return the element at @var{index} in the uniform numeric
5748 vector @var{uvec}.
5749 @end deffn
5750
5751 \fs16vector-set!
5752 @c snarfed from ../libguile/srfi-4.i.c:97
5753 @deffn {Scheme Procedure} s16vector-set! uvec index value
5754 @deffnx {C Function} scm_s16vector_set_x (uvec, index, value)
5755 Set the element at @var{index} in the uniform numeric
5756 vector @var{uvec} to @var{value}. The return value is not
5757 specified.
5758 @end deffn
5759
5760 \fs16vector->list
5761 @c snarfed from ../libguile/srfi-4.i.c:107
5762 @deffn {Scheme Procedure} s16vector->list uvec
5763 @deffnx {C Function} scm_s16vector_to_list (uvec)
5764 Convert the uniform numeric vector @var{uvec} to a list.
5765 @end deffn
5766
5767 \flist->s16vector
5768 @c snarfed from ../libguile/srfi-4.i.c:117
5769 @deffn {Scheme Procedure} list->s16vector l
5770 @deffnx {C Function} scm_list_to_s16vector (l)
5771 Convert the list @var{l} to a numeric uniform vector.
5772 @end deffn
5773
5774 \fany->s16vector
5775 @c snarfed from ../libguile/srfi-4.i.c:128
5776 @deffn {Scheme Procedure} any->s16vector obj
5777 @deffnx {C Function} scm_any_to_s16vector (obj)
5778 Convert @var{obj}, which can be a list, vector, or
5779 uniform vector, to a numeric uniform vector of
5780 type s16.
5781 @end deffn
5782
5783 \fu32vector?
5784 @c snarfed from ../libguile/srfi-4.i.c:41
5785 @deffn {Scheme Procedure} u32vector? obj
5786 @deffnx {C Function} scm_u32vector_p (obj)
5787 Return @code{#t} if @var{obj} is a vector of type u32,
5788 @code{#f} otherwise.
5789 @end deffn
5790
5791 \fmake-u32vector
5792 @c snarfed from ../libguile/srfi-4.i.c:53
5793 @deffn {Scheme Procedure} make-u32vector len [fill]
5794 @deffnx {C Function} scm_make_u32vector (len, fill)
5795 Return a newly allocated uniform numeric vector which can
5796 hold @var{len} elements. If @var{fill} is given, it is used to
5797 initialize the elements, otherwise the contents of the vector
5798 is unspecified.
5799 @end deffn
5800
5801 \fu32vector
5802 @c snarfed from ../libguile/srfi-4.i.c:63
5803 @deffn {Scheme Procedure} u32vector . l
5804 @deffnx {C Function} scm_u32vector (l)
5805 Return a newly allocated uniform numeric vector containing
5806 all argument values.
5807 @end deffn
5808
5809 \fu32vector-length
5810 @c snarfed from ../libguile/srfi-4.i.c:74
5811 @deffn {Scheme Procedure} u32vector-length uvec
5812 @deffnx {C Function} scm_u32vector_length (uvec)
5813 Return the number of elements in the uniform numeric vector
5814 @var{uvec}.
5815 @end deffn
5816
5817 \fu32vector-ref
5818 @c snarfed from ../libguile/srfi-4.i.c:85
5819 @deffn {Scheme Procedure} u32vector-ref uvec index
5820 @deffnx {C Function} scm_u32vector_ref (uvec, index)
5821 Return the element at @var{index} in the uniform numeric
5822 vector @var{uvec}.
5823 @end deffn
5824
5825 \fu32vector-set!
5826 @c snarfed from ../libguile/srfi-4.i.c:97
5827 @deffn {Scheme Procedure} u32vector-set! uvec index value
5828 @deffnx {C Function} scm_u32vector_set_x (uvec, index, value)
5829 Set the element at @var{index} in the uniform numeric
5830 vector @var{uvec} to @var{value}. The return value is not
5831 specified.
5832 @end deffn
5833
5834 \fu32vector->list
5835 @c snarfed from ../libguile/srfi-4.i.c:107
5836 @deffn {Scheme Procedure} u32vector->list uvec
5837 @deffnx {C Function} scm_u32vector_to_list (uvec)
5838 Convert the uniform numeric vector @var{uvec} to a list.
5839 @end deffn
5840
5841 \flist->u32vector
5842 @c snarfed from ../libguile/srfi-4.i.c:117
5843 @deffn {Scheme Procedure} list->u32vector l
5844 @deffnx {C Function} scm_list_to_u32vector (l)
5845 Convert the list @var{l} to a numeric uniform vector.
5846 @end deffn
5847
5848 \fany->u32vector
5849 @c snarfed from ../libguile/srfi-4.i.c:128
5850 @deffn {Scheme Procedure} any->u32vector obj
5851 @deffnx {C Function} scm_any_to_u32vector (obj)
5852 Convert @var{obj}, which can be a list, vector, or
5853 uniform vector, to a numeric uniform vector of
5854 type u32.
5855 @end deffn
5856
5857 \fs32vector?
5858 @c snarfed from ../libguile/srfi-4.i.c:41
5859 @deffn {Scheme Procedure} s32vector? obj
5860 @deffnx {C Function} scm_s32vector_p (obj)
5861 Return @code{#t} if @var{obj} is a vector of type s32,
5862 @code{#f} otherwise.
5863 @end deffn
5864
5865 \fmake-s32vector
5866 @c snarfed from ../libguile/srfi-4.i.c:53
5867 @deffn {Scheme Procedure} make-s32vector len [fill]
5868 @deffnx {C Function} scm_make_s32vector (len, fill)
5869 Return a newly allocated uniform numeric vector which can
5870 hold @var{len} elements. If @var{fill} is given, it is used to
5871 initialize the elements, otherwise the contents of the vector
5872 is unspecified.
5873 @end deffn
5874
5875 \fs32vector
5876 @c snarfed from ../libguile/srfi-4.i.c:63
5877 @deffn {Scheme Procedure} s32vector . l
5878 @deffnx {C Function} scm_s32vector (l)
5879 Return a newly allocated uniform numeric vector containing
5880 all argument values.
5881 @end deffn
5882
5883 \fs32vector-length
5884 @c snarfed from ../libguile/srfi-4.i.c:74
5885 @deffn {Scheme Procedure} s32vector-length uvec
5886 @deffnx {C Function} scm_s32vector_length (uvec)
5887 Return the number of elements in the uniform numeric vector
5888 @var{uvec}.
5889 @end deffn
5890
5891 \fs32vector-ref
5892 @c snarfed from ../libguile/srfi-4.i.c:85
5893 @deffn {Scheme Procedure} s32vector-ref uvec index
5894 @deffnx {C Function} scm_s32vector_ref (uvec, index)
5895 Return the element at @var{index} in the uniform numeric
5896 vector @var{uvec}.
5897 @end deffn
5898
5899 \fs32vector-set!
5900 @c snarfed from ../libguile/srfi-4.i.c:97
5901 @deffn {Scheme Procedure} s32vector-set! uvec index value
5902 @deffnx {C Function} scm_s32vector_set_x (uvec, index, value)
5903 Set the element at @var{index} in the uniform numeric
5904 vector @var{uvec} to @var{value}. The return value is not
5905 specified.
5906 @end deffn
5907
5908 \fs32vector->list
5909 @c snarfed from ../libguile/srfi-4.i.c:107
5910 @deffn {Scheme Procedure} s32vector->list uvec
5911 @deffnx {C Function} scm_s32vector_to_list (uvec)
5912 Convert the uniform numeric vector @var{uvec} to a list.
5913 @end deffn
5914
5915 \flist->s32vector
5916 @c snarfed from ../libguile/srfi-4.i.c:117
5917 @deffn {Scheme Procedure} list->s32vector l
5918 @deffnx {C Function} scm_list_to_s32vector (l)
5919 Convert the list @var{l} to a numeric uniform vector.
5920 @end deffn
5921
5922 \fany->s32vector
5923 @c snarfed from ../libguile/srfi-4.i.c:128
5924 @deffn {Scheme Procedure} any->s32vector obj
5925 @deffnx {C Function} scm_any_to_s32vector (obj)
5926 Convert @var{obj}, which can be a list, vector, or
5927 uniform vector, to a numeric uniform vector of
5928 type s32.
5929 @end deffn
5930
5931 \fu64vector?
5932 @c snarfed from ../libguile/srfi-4.i.c:41
5933 @deffn {Scheme Procedure} u64vector? obj
5934 @deffnx {C Function} scm_u64vector_p (obj)
5935 Return @code{#t} if @var{obj} is a vector of type u64,
5936 @code{#f} otherwise.
5937 @end deffn
5938
5939 \fmake-u64vector
5940 @c snarfed from ../libguile/srfi-4.i.c:53
5941 @deffn {Scheme Procedure} make-u64vector len [fill]
5942 @deffnx {C Function} scm_make_u64vector (len, fill)
5943 Return a newly allocated uniform numeric vector which can
5944 hold @var{len} elements. If @var{fill} is given, it is used to
5945 initialize the elements, otherwise the contents of the vector
5946 is unspecified.
5947 @end deffn
5948
5949 \fu64vector
5950 @c snarfed from ../libguile/srfi-4.i.c:63
5951 @deffn {Scheme Procedure} u64vector . l
5952 @deffnx {C Function} scm_u64vector (l)
5953 Return a newly allocated uniform numeric vector containing
5954 all argument values.
5955 @end deffn
5956
5957 \fu64vector-length
5958 @c snarfed from ../libguile/srfi-4.i.c:74
5959 @deffn {Scheme Procedure} u64vector-length uvec
5960 @deffnx {C Function} scm_u64vector_length (uvec)
5961 Return the number of elements in the uniform numeric vector
5962 @var{uvec}.
5963 @end deffn
5964
5965 \fu64vector-ref
5966 @c snarfed from ../libguile/srfi-4.i.c:85
5967 @deffn {Scheme Procedure} u64vector-ref uvec index
5968 @deffnx {C Function} scm_u64vector_ref (uvec, index)
5969 Return the element at @var{index} in the uniform numeric
5970 vector @var{uvec}.
5971 @end deffn
5972
5973 \fu64vector-set!
5974 @c snarfed from ../libguile/srfi-4.i.c:97
5975 @deffn {Scheme Procedure} u64vector-set! uvec index value
5976 @deffnx {C Function} scm_u64vector_set_x (uvec, index, value)
5977 Set the element at @var{index} in the uniform numeric
5978 vector @var{uvec} to @var{value}. The return value is not
5979 specified.
5980 @end deffn
5981
5982 \fu64vector->list
5983 @c snarfed from ../libguile/srfi-4.i.c:107
5984 @deffn {Scheme Procedure} u64vector->list uvec
5985 @deffnx {C Function} scm_u64vector_to_list (uvec)
5986 Convert the uniform numeric vector @var{uvec} to a list.
5987 @end deffn
5988
5989 \flist->u64vector
5990 @c snarfed from ../libguile/srfi-4.i.c:117
5991 @deffn {Scheme Procedure} list->u64vector l
5992 @deffnx {C Function} scm_list_to_u64vector (l)
5993 Convert the list @var{l} to a numeric uniform vector.
5994 @end deffn
5995
5996 \fany->u64vector
5997 @c snarfed from ../libguile/srfi-4.i.c:128
5998 @deffn {Scheme Procedure} any->u64vector obj
5999 @deffnx {C Function} scm_any_to_u64vector (obj)
6000 Convert @var{obj}, which can be a list, vector, or
6001 uniform vector, to a numeric uniform vector of
6002 type u64.
6003 @end deffn
6004
6005 \fs64vector?
6006 @c snarfed from ../libguile/srfi-4.i.c:41
6007 @deffn {Scheme Procedure} s64vector? obj
6008 @deffnx {C Function} scm_s64vector_p (obj)
6009 Return @code{#t} if @var{obj} is a vector of type s64,
6010 @code{#f} otherwise.
6011 @end deffn
6012
6013 \fmake-s64vector
6014 @c snarfed from ../libguile/srfi-4.i.c:53
6015 @deffn {Scheme Procedure} make-s64vector len [fill]
6016 @deffnx {C Function} scm_make_s64vector (len, fill)
6017 Return a newly allocated uniform numeric vector which can
6018 hold @var{len} elements. If @var{fill} is given, it is used to
6019 initialize the elements, otherwise the contents of the vector
6020 is unspecified.
6021 @end deffn
6022
6023 \fs64vector
6024 @c snarfed from ../libguile/srfi-4.i.c:63
6025 @deffn {Scheme Procedure} s64vector . l
6026 @deffnx {C Function} scm_s64vector (l)
6027 Return a newly allocated uniform numeric vector containing
6028 all argument values.
6029 @end deffn
6030
6031 \fs64vector-length
6032 @c snarfed from ../libguile/srfi-4.i.c:74
6033 @deffn {Scheme Procedure} s64vector-length uvec
6034 @deffnx {C Function} scm_s64vector_length (uvec)
6035 Return the number of elements in the uniform numeric vector
6036 @var{uvec}.
6037 @end deffn
6038
6039 \fs64vector-ref
6040 @c snarfed from ../libguile/srfi-4.i.c:85
6041 @deffn {Scheme Procedure} s64vector-ref uvec index
6042 @deffnx {C Function} scm_s64vector_ref (uvec, index)
6043 Return the element at @var{index} in the uniform numeric
6044 vector @var{uvec}.
6045 @end deffn
6046
6047 \fs64vector-set!
6048 @c snarfed from ../libguile/srfi-4.i.c:97
6049 @deffn {Scheme Procedure} s64vector-set! uvec index value
6050 @deffnx {C Function} scm_s64vector_set_x (uvec, index, value)
6051 Set the element at @var{index} in the uniform numeric
6052 vector @var{uvec} to @var{value}. The return value is not
6053 specified.
6054 @end deffn
6055
6056 \fs64vector->list
6057 @c snarfed from ../libguile/srfi-4.i.c:107
6058 @deffn {Scheme Procedure} s64vector->list uvec
6059 @deffnx {C Function} scm_s64vector_to_list (uvec)
6060 Convert the uniform numeric vector @var{uvec} to a list.
6061 @end deffn
6062
6063 \flist->s64vector
6064 @c snarfed from ../libguile/srfi-4.i.c:117
6065 @deffn {Scheme Procedure} list->s64vector l
6066 @deffnx {C Function} scm_list_to_s64vector (l)
6067 Convert the list @var{l} to a numeric uniform vector.
6068 @end deffn
6069
6070 \fany->s64vector
6071 @c snarfed from ../libguile/srfi-4.i.c:128
6072 @deffn {Scheme Procedure} any->s64vector obj
6073 @deffnx {C Function} scm_any_to_s64vector (obj)
6074 Convert @var{obj}, which can be a list, vector, or
6075 uniform vector, to a numeric uniform vector of
6076 type s64.
6077 @end deffn
6078
6079 \ff32vector?
6080 @c snarfed from ../libguile/srfi-4.i.c:41
6081 @deffn {Scheme Procedure} f32vector? obj
6082 @deffnx {C Function} scm_f32vector_p (obj)
6083 Return @code{#t} if @var{obj} is a vector of type f32,
6084 @code{#f} otherwise.
6085 @end deffn
6086
6087 \fmake-f32vector
6088 @c snarfed from ../libguile/srfi-4.i.c:53
6089 @deffn {Scheme Procedure} make-f32vector len [fill]
6090 @deffnx {C Function} scm_make_f32vector (len, fill)
6091 Return a newly allocated uniform numeric vector which can
6092 hold @var{len} elements. If @var{fill} is given, it is used to
6093 initialize the elements, otherwise the contents of the vector
6094 is unspecified.
6095 @end deffn
6096
6097 \ff32vector
6098 @c snarfed from ../libguile/srfi-4.i.c:63
6099 @deffn {Scheme Procedure} f32vector . l
6100 @deffnx {C Function} scm_f32vector (l)
6101 Return a newly allocated uniform numeric vector containing
6102 all argument values.
6103 @end deffn
6104
6105 \ff32vector-length
6106 @c snarfed from ../libguile/srfi-4.i.c:74
6107 @deffn {Scheme Procedure} f32vector-length uvec
6108 @deffnx {C Function} scm_f32vector_length (uvec)
6109 Return the number of elements in the uniform numeric vector
6110 @var{uvec}.
6111 @end deffn
6112
6113 \ff32vector-ref
6114 @c snarfed from ../libguile/srfi-4.i.c:85
6115 @deffn {Scheme Procedure} f32vector-ref uvec index
6116 @deffnx {C Function} scm_f32vector_ref (uvec, index)
6117 Return the element at @var{index} in the uniform numeric
6118 vector @var{uvec}.
6119 @end deffn
6120
6121 \ff32vector-set!
6122 @c snarfed from ../libguile/srfi-4.i.c:97
6123 @deffn {Scheme Procedure} f32vector-set! uvec index value
6124 @deffnx {C Function} scm_f32vector_set_x (uvec, index, value)
6125 Set the element at @var{index} in the uniform numeric
6126 vector @var{uvec} to @var{value}. The return value is not
6127 specified.
6128 @end deffn
6129
6130 \ff32vector->list
6131 @c snarfed from ../libguile/srfi-4.i.c:107
6132 @deffn {Scheme Procedure} f32vector->list uvec
6133 @deffnx {C Function} scm_f32vector_to_list (uvec)
6134 Convert the uniform numeric vector @var{uvec} to a list.
6135 @end deffn
6136
6137 \flist->f32vector
6138 @c snarfed from ../libguile/srfi-4.i.c:117
6139 @deffn {Scheme Procedure} list->f32vector l
6140 @deffnx {C Function} scm_list_to_f32vector (l)
6141 Convert the list @var{l} to a numeric uniform vector.
6142 @end deffn
6143
6144 \fany->f32vector
6145 @c snarfed from ../libguile/srfi-4.i.c:128
6146 @deffn {Scheme Procedure} any->f32vector obj
6147 @deffnx {C Function} scm_any_to_f32vector (obj)
6148 Convert @var{obj}, which can be a list, vector, or
6149 uniform vector, to a numeric uniform vector of
6150 type f32.
6151 @end deffn
6152
6153 \ff64vector?
6154 @c snarfed from ../libguile/srfi-4.i.c:41
6155 @deffn {Scheme Procedure} f64vector? obj
6156 @deffnx {C Function} scm_f64vector_p (obj)
6157 Return @code{#t} if @var{obj} is a vector of type f64,
6158 @code{#f} otherwise.
6159 @end deffn
6160
6161 \fmake-f64vector
6162 @c snarfed from ../libguile/srfi-4.i.c:53
6163 @deffn {Scheme Procedure} make-f64vector len [fill]
6164 @deffnx {C Function} scm_make_f64vector (len, fill)
6165 Return a newly allocated uniform numeric vector which can
6166 hold @var{len} elements. If @var{fill} is given, it is used to
6167 initialize the elements, otherwise the contents of the vector
6168 is unspecified.
6169 @end deffn
6170
6171 \ff64vector
6172 @c snarfed from ../libguile/srfi-4.i.c:63
6173 @deffn {Scheme Procedure} f64vector . l
6174 @deffnx {C Function} scm_f64vector (l)
6175 Return a newly allocated uniform numeric vector containing
6176 all argument values.
6177 @end deffn
6178
6179 \ff64vector-length
6180 @c snarfed from ../libguile/srfi-4.i.c:74
6181 @deffn {Scheme Procedure} f64vector-length uvec
6182 @deffnx {C Function} scm_f64vector_length (uvec)
6183 Return the number of elements in the uniform numeric vector
6184 @var{uvec}.
6185 @end deffn
6186
6187 \ff64vector-ref
6188 @c snarfed from ../libguile/srfi-4.i.c:85
6189 @deffn {Scheme Procedure} f64vector-ref uvec index
6190 @deffnx {C Function} scm_f64vector_ref (uvec, index)
6191 Return the element at @var{index} in the uniform numeric
6192 vector @var{uvec}.
6193 @end deffn
6194
6195 \ff64vector-set!
6196 @c snarfed from ../libguile/srfi-4.i.c:97
6197 @deffn {Scheme Procedure} f64vector-set! uvec index value
6198 @deffnx {C Function} scm_f64vector_set_x (uvec, index, value)
6199 Set the element at @var{index} in the uniform numeric
6200 vector @var{uvec} to @var{value}. The return value is not
6201 specified.
6202 @end deffn
6203
6204 \ff64vector->list
6205 @c snarfed from ../libguile/srfi-4.i.c:107
6206 @deffn {Scheme Procedure} f64vector->list uvec
6207 @deffnx {C Function} scm_f64vector_to_list (uvec)
6208 Convert the uniform numeric vector @var{uvec} to a list.
6209 @end deffn
6210
6211 \flist->f64vector
6212 @c snarfed from ../libguile/srfi-4.i.c:117
6213 @deffn {Scheme Procedure} list->f64vector l
6214 @deffnx {C Function} scm_list_to_f64vector (l)
6215 Convert the list @var{l} to a numeric uniform vector.
6216 @end deffn
6217
6218 \fany->f64vector
6219 @c snarfed from ../libguile/srfi-4.i.c:128
6220 @deffn {Scheme Procedure} any->f64vector obj
6221 @deffnx {C Function} scm_any_to_f64vector (obj)
6222 Convert @var{obj}, which can be a list, vector, or
6223 uniform vector, to a numeric uniform vector of
6224 type f64.
6225 @end deffn
6226
6227 \fc32vector?
6228 @c snarfed from ../libguile/srfi-4.i.c:41
6229 @deffn {Scheme Procedure} c32vector? obj
6230 @deffnx {C Function} scm_c32vector_p (obj)
6231 Return @code{#t} if @var{obj} is a vector of type c32,
6232 @code{#f} otherwise.
6233 @end deffn
6234
6235 \fmake-c32vector
6236 @c snarfed from ../libguile/srfi-4.i.c:53
6237 @deffn {Scheme Procedure} make-c32vector len [fill]
6238 @deffnx {C Function} scm_make_c32vector (len, fill)
6239 Return a newly allocated uniform numeric vector which can
6240 hold @var{len} elements. If @var{fill} is given, it is used to
6241 initialize the elements, otherwise the contents of the vector
6242 is unspecified.
6243 @end deffn
6244
6245 \fc32vector
6246 @c snarfed from ../libguile/srfi-4.i.c:63
6247 @deffn {Scheme Procedure} c32vector . l
6248 @deffnx {C Function} scm_c32vector (l)
6249 Return a newly allocated uniform numeric vector containing
6250 all argument values.
6251 @end deffn
6252
6253 \fc32vector-length
6254 @c snarfed from ../libguile/srfi-4.i.c:74
6255 @deffn {Scheme Procedure} c32vector-length uvec
6256 @deffnx {C Function} scm_c32vector_length (uvec)
6257 Return the number of elements in the uniform numeric vector
6258 @var{uvec}.
6259 @end deffn
6260
6261 \fc32vector-ref
6262 @c snarfed from ../libguile/srfi-4.i.c:85
6263 @deffn {Scheme Procedure} c32vector-ref uvec index
6264 @deffnx {C Function} scm_c32vector_ref (uvec, index)
6265 Return the element at @var{index} in the uniform numeric
6266 vector @var{uvec}.
6267 @end deffn
6268
6269 \fc32vector-set!
6270 @c snarfed from ../libguile/srfi-4.i.c:97
6271 @deffn {Scheme Procedure} c32vector-set! uvec index value
6272 @deffnx {C Function} scm_c32vector_set_x (uvec, index, value)
6273 Set the element at @var{index} in the uniform numeric
6274 vector @var{uvec} to @var{value}. The return value is not
6275 specified.
6276 @end deffn
6277
6278 \fc32vector->list
6279 @c snarfed from ../libguile/srfi-4.i.c:107
6280 @deffn {Scheme Procedure} c32vector->list uvec
6281 @deffnx {C Function} scm_c32vector_to_list (uvec)
6282 Convert the uniform numeric vector @var{uvec} to a list.
6283 @end deffn
6284
6285 \flist->c32vector
6286 @c snarfed from ../libguile/srfi-4.i.c:117
6287 @deffn {Scheme Procedure} list->c32vector l
6288 @deffnx {C Function} scm_list_to_c32vector (l)
6289 Convert the list @var{l} to a numeric uniform vector.
6290 @end deffn
6291
6292 \fany->c32vector
6293 @c snarfed from ../libguile/srfi-4.i.c:128
6294 @deffn {Scheme Procedure} any->c32vector obj
6295 @deffnx {C Function} scm_any_to_c32vector (obj)
6296 Convert @var{obj}, which can be a list, vector, or
6297 uniform vector, to a numeric uniform vector of
6298 type c32.
6299 @end deffn
6300
6301 \fc64vector?
6302 @c snarfed from ../libguile/srfi-4.i.c:41
6303 @deffn {Scheme Procedure} c64vector? obj
6304 @deffnx {C Function} scm_c64vector_p (obj)
6305 Return @code{#t} if @var{obj} is a vector of type c64,
6306 @code{#f} otherwise.
6307 @end deffn
6308
6309 \fmake-c64vector
6310 @c snarfed from ../libguile/srfi-4.i.c:53
6311 @deffn {Scheme Procedure} make-c64vector len [fill]
6312 @deffnx {C Function} scm_make_c64vector (len, fill)
6313 Return a newly allocated uniform numeric vector which can
6314 hold @var{len} elements. If @var{fill} is given, it is used to
6315 initialize the elements, otherwise the contents of the vector
6316 is unspecified.
6317 @end deffn
6318
6319 \fc64vector
6320 @c snarfed from ../libguile/srfi-4.i.c:63
6321 @deffn {Scheme Procedure} c64vector . l
6322 @deffnx {C Function} scm_c64vector (l)
6323 Return a newly allocated uniform numeric vector containing
6324 all argument values.
6325 @end deffn
6326
6327 \fc64vector-length
6328 @c snarfed from ../libguile/srfi-4.i.c:74
6329 @deffn {Scheme Procedure} c64vector-length uvec
6330 @deffnx {C Function} scm_c64vector_length (uvec)
6331 Return the number of elements in the uniform numeric vector
6332 @var{uvec}.
6333 @end deffn
6334
6335 \fc64vector-ref
6336 @c snarfed from ../libguile/srfi-4.i.c:85
6337 @deffn {Scheme Procedure} c64vector-ref uvec index
6338 @deffnx {C Function} scm_c64vector_ref (uvec, index)
6339 Return the element at @var{index} in the uniform numeric
6340 vector @var{uvec}.
6341 @end deffn
6342
6343 \fc64vector-set!
6344 @c snarfed from ../libguile/srfi-4.i.c:97
6345 @deffn {Scheme Procedure} c64vector-set! uvec index value
6346 @deffnx {C Function} scm_c64vector_set_x (uvec, index, value)
6347 Set the element at @var{index} in the uniform numeric
6348 vector @var{uvec} to @var{value}. The return value is not
6349 specified.
6350 @end deffn
6351
6352 \fc64vector->list
6353 @c snarfed from ../libguile/srfi-4.i.c:107
6354 @deffn {Scheme Procedure} c64vector->list uvec
6355 @deffnx {C Function} scm_c64vector_to_list (uvec)
6356 Convert the uniform numeric vector @var{uvec} to a list.
6357 @end deffn
6358
6359 \flist->c64vector
6360 @c snarfed from ../libguile/srfi-4.i.c:117
6361 @deffn {Scheme Procedure} list->c64vector l
6362 @deffnx {C Function} scm_list_to_c64vector (l)
6363 Convert the list @var{l} to a numeric uniform vector.
6364 @end deffn
6365
6366 \fany->c64vector
6367 @c snarfed from ../libguile/srfi-4.i.c:128
6368 @deffn {Scheme Procedure} any->c64vector obj
6369 @deffnx {C Function} scm_any_to_c64vector (obj)
6370 Convert @var{obj}, which can be a list, vector, or
6371 uniform vector, to a numeric uniform vector of
6372 type c64.
6373 @end deffn
6374
6375 \fstring-null?
6376 @c snarfed from srfi-13.c:62
6377 @deffn {Scheme Procedure} string-null? str
6378 @deffnx {C Function} scm_string_null_p (str)
6379 Return @code{#t} if @var{str}'s length is zero, and
6380 @code{#f} otherwise.
6381 @lisp
6382 (string-null? "") @result{} #t
6383 y @result{} "foo"
6384 (string-null? y) @result{} #f
6385 @end lisp
6386 @end deffn
6387
6388 \fstring-any-c-code
6389 @c snarfed from srfi-13.c:94
6390 @deffn {Scheme Procedure} string-any-c-code char_pred s [start [end]]
6391 @deffnx {C Function} scm_string_any (char_pred, s, start, end)
6392 Check if @var{char_pred} is true for any character in string @var{s}.
6393
6394 @var{char_pred} can be a character to check for any equal to that, or
6395 a character set (@pxref{Character Sets}) to check for any in that set,
6396 or a predicate procedure to call.
6397
6398 For a procedure, calls @code{(@var{char_pred} c)} are made
6399 successively on the characters from @var{start} to @var{end}. If
6400 @var{char_pred} returns true (ie.@: non-@code{#f}), @code{string-any}
6401 stops and that return value is the return from @code{string-any}. The
6402 call on the last character (ie.@: at @math{@var{end}-1}), if that
6403 point is reached, is a tail call.
6404
6405 If there are no characters in @var{s} (ie.@: @var{start} equals
6406 @var{end}) then the return is @code{#f}.
6407
6408 @end deffn
6409
6410 \fstring-every-c-code
6411 @c snarfed from srfi-13.c:158
6412 @deffn {Scheme Procedure} string-every-c-code char_pred s [start [end]]
6413 @deffnx {C Function} scm_string_every (char_pred, s, start, end)
6414 Check if @var{char_pred} is true for every character in string
6415 @var{s}.
6416
6417 @var{char_pred} can be a character to check for every character equal
6418 to that, or a character set (@pxref{Character Sets}) to check for
6419 every character being in that set, or a predicate procedure to call.
6420
6421 For a procedure, calls @code{(@var{char_pred} c)} are made
6422 successively on the characters from @var{start} to @var{end}. If
6423 @var{char_pred} returns @code{#f}, @code{string-every} stops and
6424 returns @code{#f}. The call on the last character (ie.@: at
6425 @math{@var{end}-1}), if that point is reached, is a tail call and the
6426 return from that call is the return from @code{string-every}.
6427
6428 If there are no characters in @var{s} (ie.@: @var{start} equals
6429 @var{end}) then the return is @code{#t}.
6430
6431 @end deffn
6432
6433 \fstring-tabulate
6434 @c snarfed from srfi-13.c:214
6435 @deffn {Scheme Procedure} string-tabulate proc len
6436 @deffnx {C Function} scm_string_tabulate (proc, len)
6437 @var{proc} is an integer->char procedure. Construct a string
6438 of size @var{len} by applying @var{proc} to each index to
6439 produce the corresponding string element. The order in which
6440 @var{proc} is applied to the indices is not specified.
6441 @end deffn
6442
6443 \fstring->list
6444 @c snarfed from srfi-13.c:246
6445 @deffn {Scheme Procedure} string->list str [start [end]]
6446 @deffnx {C Function} scm_substring_to_list (str, start, end)
6447 Convert the string @var{str} into a list of characters.
6448 @end deffn
6449
6450 \freverse-list->string
6451 @c snarfed from srfi-13.c:285
6452 @deffn {Scheme Procedure} reverse-list->string chrs
6453 @deffnx {C Function} scm_reverse_list_to_string (chrs)
6454 An efficient implementation of @code{(compose string->list
6455 reverse)}:
6456
6457 @smalllisp
6458 (reverse-list->string '(#\a #\B #\c)) @result{} "cBa"
6459 @end smalllisp
6460 @end deffn
6461
6462 \fstring-join
6463 @c snarfed from srfi-13.c:352
6464 @deffn {Scheme Procedure} string-join ls [delimiter [grammar]]
6465 @deffnx {C Function} scm_string_join (ls, delimiter, grammar)
6466 Append the string in the string list @var{ls}, using the string
6467 @var{delim} as a delimiter between the elements of @var{ls}.
6468 @var{grammar} is a symbol which specifies how the delimiter is
6469 placed between the strings, and defaults to the symbol
6470 @code{infix}.
6471
6472 @table @code
6473 @item infix
6474 Insert the separator between list elements. An empty string
6475 will produce an empty list.
6476 @item string-infix
6477 Like @code{infix}, but will raise an error if given the empty
6478 list.
6479 @item suffix
6480 Insert the separator after every list element.
6481 @item prefix
6482 Insert the separator before each list element.
6483 @end table
6484 @end deffn
6485
6486 \fstring-copy
6487 @c snarfed from srfi-13.c:486
6488 @deffn {Scheme Procedure} string-copy str [start [end]]
6489 @deffnx {C Function} scm_srfi13_substring_copy (str, start, end)
6490 Return a freshly allocated copy of the string @var{str}. If
6491 given, @var{start} and @var{end} delimit the portion of
6492 @var{str} which is copied.
6493 @end deffn
6494
6495 \fstring-copy!
6496 @c snarfed from srfi-13.c:513
6497 @deffn {Scheme Procedure} string-copy! target tstart s [start [end]]
6498 @deffnx {C Function} scm_string_copy_x (target, tstart, s, start, end)
6499 Copy the sequence of characters from index range [@var{start},
6500 @var{end}) in string @var{s} to string @var{target}, beginning
6501 at index @var{tstart}. The characters are copied left-to-right
6502 or right-to-left as needed -- the copy is guaranteed to work,
6503 even if @var{target} and @var{s} are the same string. It is an
6504 error if the copy operation runs off the end of the target
6505 string.
6506 @end deffn
6507
6508 \fsubstring-move!
6509 @c snarfed from srfi-13.c:543
6510 @deffn {Scheme Procedure} substring-move! str1 start1 end1 str2 start2
6511 @deffnx {C Function} scm_substring_move_x (str1, start1, end1, str2, start2)
6512 Copy the substring of @var{str1} bounded by @var{start1} and @var{end1}
6513 into @var{str2} beginning at position @var{start2}.
6514 @var{str1} and @var{str2} can be the same string.
6515 @end deffn
6516
6517 \fstring-take
6518 @c snarfed from srfi-13.c:552
6519 @deffn {Scheme Procedure} string-take s n
6520 @deffnx {C Function} scm_string_take (s, n)
6521 Return the @var{n} first characters of @var{s}.
6522 @end deffn
6523
6524 \fstring-drop
6525 @c snarfed from srfi-13.c:562
6526 @deffn {Scheme Procedure} string-drop s n
6527 @deffnx {C Function} scm_string_drop (s, n)
6528 Return all but the first @var{n} characters of @var{s}.
6529 @end deffn
6530
6531 \fstring-take-right
6532 @c snarfed from srfi-13.c:572
6533 @deffn {Scheme Procedure} string-take-right s n
6534 @deffnx {C Function} scm_string_take_right (s, n)
6535 Return the @var{n} last characters of @var{s}.
6536 @end deffn
6537
6538 \fstring-drop-right
6539 @c snarfed from srfi-13.c:584
6540 @deffn {Scheme Procedure} string-drop-right s n
6541 @deffnx {C Function} scm_string_drop_right (s, n)
6542 Return all but the last @var{n} characters of @var{s}.
6543 @end deffn
6544
6545 \fstring-pad
6546 @c snarfed from srfi-13.c:599
6547 @deffn {Scheme Procedure} string-pad s len [chr [start [end]]]
6548 @deffnx {C Function} scm_string_pad (s, len, chr, start, end)
6549 Take that characters from @var{start} to @var{end} from the
6550 string @var{s} and return a new string, right-padded by the
6551 character @var{chr} to length @var{len}. If the resulting
6552 string is longer than @var{len}, it is truncated on the right.
6553 @end deffn
6554
6555 \fstring-pad-right
6556 @c snarfed from srfi-13.c:639
6557 @deffn {Scheme Procedure} string-pad-right s len [chr [start [end]]]
6558 @deffnx {C Function} scm_string_pad_right (s, len, chr, start, end)
6559 Take that characters from @var{start} to @var{end} from the
6560 string @var{s} and return a new string, left-padded by the
6561 character @var{chr} to length @var{len}. If the resulting
6562 string is longer than @var{len}, it is truncated on the left.
6563 @end deffn
6564
6565 \fstring-trim
6566 @c snarfed from srfi-13.c:692
6567 @deffn {Scheme Procedure} string-trim s [char_pred [start [end]]]
6568 @deffnx {C Function} scm_string_trim (s, char_pred, start, end)
6569 Trim @var{s} by skipping over all characters on the left
6570 that satisfy the parameter @var{char_pred}:
6571
6572 @itemize @bullet
6573 @item
6574 if it is the character @var{ch}, characters equal to
6575 @var{ch} are trimmed,
6576
6577 @item
6578 if it is a procedure @var{pred} characters that
6579 satisfy @var{pred} are trimmed,
6580
6581 @item
6582 if it is a character set, characters in that set are trimmed.
6583 @end itemize
6584
6585 If called without a @var{char_pred} argument, all whitespace is
6586 trimmed.
6587 @end deffn
6588
6589 \fstring-trim-right
6590 @c snarfed from srfi-13.c:768
6591 @deffn {Scheme Procedure} string-trim-right s [char_pred [start [end]]]
6592 @deffnx {C Function} scm_string_trim_right (s, char_pred, start, end)
6593 Trim @var{s} by skipping over all characters on the rightt
6594 that satisfy the parameter @var{char_pred}:
6595
6596 @itemize @bullet
6597 @item
6598 if it is the character @var{ch}, characters equal to @var{ch}
6599 are trimmed,
6600
6601 @item
6602 if it is a procedure @var{pred} characters that satisfy
6603 @var{pred} are trimmed,
6604
6605 @item
6606 if it is a character sets, all characters in that set are
6607 trimmed.
6608 @end itemize
6609
6610 If called without a @var{char_pred} argument, all whitespace is
6611 trimmed.
6612 @end deffn
6613
6614 \fstring-trim-both
6615 @c snarfed from srfi-13.c:844
6616 @deffn {Scheme Procedure} string-trim-both s [char_pred [start [end]]]
6617 @deffnx {C Function} scm_string_trim_both (s, char_pred, start, end)
6618 Trim @var{s} by skipping over all characters on both sides of
6619 the string that satisfy the parameter @var{char_pred}:
6620
6621 @itemize @bullet
6622 @item
6623 if it is the character @var{ch}, characters equal to @var{ch}
6624 are trimmed,
6625
6626 @item
6627 if it is a procedure @var{pred} characters that satisfy
6628 @var{pred} are trimmed,
6629
6630 @item
6631 if it is a character set, the characters in the set are
6632 trimmed.
6633 @end itemize
6634
6635 If called without a @var{char_pred} argument, all whitespace is
6636 trimmed.
6637 @end deffn
6638
6639 \fstring-fill!
6640 @c snarfed from srfi-13.c:931
6641 @deffn {Scheme Procedure} string-fill! str chr [start [end]]
6642 @deffnx {C Function} scm_substring_fill_x (str, chr, start, end)
6643 Stores @var{chr} in every element of the given @var{str} and
6644 returns an unspecified value.
6645 @end deffn
6646
6647 \fstring-compare
6648 @c snarfed from srfi-13.c:983
6649 @deffn {Scheme Procedure} string-compare s1 s2 proc_lt proc_eq proc_gt [start1 [end1 [start2 [end2]]]]
6650 @deffnx {C Function} scm_string_compare (s1, s2, proc_lt, proc_eq, proc_gt, start1, end1, start2, end2)
6651 Apply @var{proc_lt}, @var{proc_eq}, @var{proc_gt} to the
6652 mismatch index, depending upon whether @var{s1} is less than,
6653 equal to, or greater than @var{s2}. The mismatch index is the
6654 largest index @var{i} such that for every 0 <= @var{j} <
6655 @var{i}, @var{s1}[@var{j}] = @var{s2}[@var{j}] -- that is,
6656 @var{i} is the first position that does not match.
6657 @end deffn
6658
6659 \fstring-compare-ci
6660 @c snarfed from srfi-13.c:1037
6661 @deffn {Scheme Procedure} string-compare-ci s1 s2 proc_lt proc_eq proc_gt [start1 [end1 [start2 [end2]]]]
6662 @deffnx {C Function} scm_string_compare_ci (s1, s2, proc_lt, proc_eq, proc_gt, start1, end1, start2, end2)
6663 Apply @var{proc_lt}, @var{proc_eq}, @var{proc_gt} to the
6664 mismatch index, depending upon whether @var{s1} is less than,
6665 equal to, or greater than @var{s2}. The mismatch index is the
6666 largest index @var{i} such that for every 0 <= @var{j} <
6667 @var{i}, @var{s1}[@var{j}] = @var{s2}[@var{j}] -- that is,
6668 @var{i} is the first position where the lowercased letters
6669 do not match.
6670
6671 @end deffn
6672
6673 \fstring=
6674 @c snarfed from srfi-13.c:1088
6675 @deffn {Scheme Procedure} string= s1 s2 [start1 [end1 [start2 [end2]]]]
6676 @deffnx {C Function} scm_string_eq (s1, s2, start1, end1, start2, end2)
6677 Return @code{#f} if @var{s1} and @var{s2} are not equal, a true
6678 value otherwise.
6679 @end deffn
6680
6681 \fstring<>
6682 @c snarfed from srfi-13.c:1127
6683 @deffn {Scheme Procedure} string<> s1 s2 [start1 [end1 [start2 [end2]]]]
6684 @deffnx {C Function} scm_string_neq (s1, s2, start1, end1, start2, end2)
6685 Return @code{#f} if @var{s1} and @var{s2} are equal, a true
6686 value otherwise.
6687 @end deffn
6688
6689 \fstring<
6690 @c snarfed from srfi-13.c:1170
6691 @deffn {Scheme Procedure} string< s1 s2 [start1 [end1 [start2 [end2]]]]
6692 @deffnx {C Function} scm_string_lt (s1, s2, start1, end1, start2, end2)
6693 Return @code{#f} if @var{s1} is greater or equal to @var{s2}, a
6694 true value otherwise.
6695 @end deffn
6696
6697 \fstring>
6698 @c snarfed from srfi-13.c:1213
6699 @deffn {Scheme Procedure} string> s1 s2 [start1 [end1 [start2 [end2]]]]
6700 @deffnx {C Function} scm_string_gt (s1, s2, start1, end1, start2, end2)
6701 Return @code{#f} if @var{s1} is less or equal to @var{s2}, a
6702 true value otherwise.
6703 @end deffn
6704
6705 \fstring<=
6706 @c snarfed from srfi-13.c:1256
6707 @deffn {Scheme Procedure} string<= s1 s2 [start1 [end1 [start2 [end2]]]]
6708 @deffnx {C Function} scm_string_le (s1, s2, start1, end1, start2, end2)
6709 Return @code{#f} if @var{s1} is greater to @var{s2}, a true
6710 value otherwise.
6711 @end deffn
6712
6713 \fstring>=
6714 @c snarfed from srfi-13.c:1299
6715 @deffn {Scheme Procedure} string>= s1 s2 [start1 [end1 [start2 [end2]]]]
6716 @deffnx {C Function} scm_string_ge (s1, s2, start1, end1, start2, end2)
6717 Return @code{#f} if @var{s1} is less to @var{s2}, a true value
6718 otherwise.
6719 @end deffn
6720
6721 \fstring-ci=
6722 @c snarfed from srfi-13.c:1343
6723 @deffn {Scheme Procedure} string-ci= s1 s2 [start1 [end1 [start2 [end2]]]]
6724 @deffnx {C Function} scm_string_ci_eq (s1, s2, start1, end1, start2, end2)
6725 Return @code{#f} if @var{s1} and @var{s2} are not equal, a true
6726 value otherwise. The character comparison is done
6727 case-insensitively.
6728 @end deffn
6729
6730 \fstring-ci<>
6731 @c snarfed from srfi-13.c:1387
6732 @deffn {Scheme Procedure} string-ci<> s1 s2 [start1 [end1 [start2 [end2]]]]
6733 @deffnx {C Function} scm_string_ci_neq (s1, s2, start1, end1, start2, end2)
6734 Return @code{#f} if @var{s1} and @var{s2} are equal, a true
6735 value otherwise. The character comparison is done
6736 case-insensitively.
6737 @end deffn
6738
6739 \fstring-ci<
6740 @c snarfed from srfi-13.c:1431
6741 @deffn {Scheme Procedure} string-ci< s1 s2 [start1 [end1 [start2 [end2]]]]
6742 @deffnx {C Function} scm_string_ci_lt (s1, s2, start1, end1, start2, end2)
6743 Return @code{#f} if @var{s1} is greater or equal to @var{s2}, a
6744 true value otherwise. The character comparison is done
6745 case-insensitively.
6746 @end deffn
6747
6748 \fstring-ci>
6749 @c snarfed from srfi-13.c:1475
6750 @deffn {Scheme Procedure} string-ci> s1 s2 [start1 [end1 [start2 [end2]]]]
6751 @deffnx {C Function} scm_string_ci_gt (s1, s2, start1, end1, start2, end2)
6752 Return @code{#f} if @var{s1} is less or equal to @var{s2}, a
6753 true value otherwise. The character comparison is done
6754 case-insensitively.
6755 @end deffn
6756
6757 \fstring-ci<=
6758 @c snarfed from srfi-13.c:1519
6759 @deffn {Scheme Procedure} string-ci<= s1 s2 [start1 [end1 [start2 [end2]]]]
6760 @deffnx {C Function} scm_string_ci_le (s1, s2, start1, end1, start2, end2)
6761 Return @code{#f} if @var{s1} is greater to @var{s2}, a true
6762 value otherwise. The character comparison is done
6763 case-insensitively.
6764 @end deffn
6765
6766 \fstring-ci>=
6767 @c snarfed from srfi-13.c:1563
6768 @deffn {Scheme Procedure} string-ci>= s1 s2 [start1 [end1 [start2 [end2]]]]
6769 @deffnx {C Function} scm_string_ci_ge (s1, s2, start1, end1, start2, end2)
6770 Return @code{#f} if @var{s1} is less to @var{s2}, a true value
6771 otherwise. The character comparison is done
6772 case-insensitively.
6773 @end deffn
6774
6775 \fstring-hash
6776 @c snarfed from srfi-13.c:1608
6777 @deffn {Scheme Procedure} string-hash s [bound [start [end]]]
6778 @deffnx {C Function} scm_substring_hash (s, bound, start, end)
6779 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).
6780 @end deffn
6781
6782 \fstring-hash-ci
6783 @c snarfed from srfi-13.c:1625
6784 @deffn {Scheme Procedure} string-hash-ci s [bound [start [end]]]
6785 @deffnx {C Function} scm_substring_hash_ci (s, bound, start, end)
6786 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).
6787 @end deffn
6788
6789 \fstring-prefix-length
6790 @c snarfed from srfi-13.c:1637
6791 @deffn {Scheme Procedure} string-prefix-length s1 s2 [start1 [end1 [start2 [end2]]]]
6792 @deffnx {C Function} scm_string_prefix_length (s1, s2, start1, end1, start2, end2)
6793 Return the length of the longest common prefix of the two
6794 strings.
6795 @end deffn
6796
6797 \fstring-prefix-length-ci
6798 @c snarfed from srfi-13.c:1669
6799 @deffn {Scheme Procedure} string-prefix-length-ci s1 s2 [start1 [end1 [start2 [end2]]]]
6800 @deffnx {C Function} scm_string_prefix_length_ci (s1, s2, start1, end1, start2, end2)
6801 Return the length of the longest common prefix of the two
6802 strings, ignoring character case.
6803 @end deffn
6804
6805 \fstring-suffix-length
6806 @c snarfed from srfi-13.c:1701
6807 @deffn {Scheme Procedure} string-suffix-length s1 s2 [start1 [end1 [start2 [end2]]]]
6808 @deffnx {C Function} scm_string_suffix_length (s1, s2, start1, end1, start2, end2)
6809 Return the length of the longest common suffix of the two
6810 strings.
6811 @end deffn
6812
6813 \fstring-suffix-length-ci
6814 @c snarfed from srfi-13.c:1733
6815 @deffn {Scheme Procedure} string-suffix-length-ci s1 s2 [start1 [end1 [start2 [end2]]]]
6816 @deffnx {C Function} scm_string_suffix_length_ci (s1, s2, start1, end1, start2, end2)
6817 Return the length of the longest common suffix of the two
6818 strings, ignoring character case.
6819 @end deffn
6820
6821 \fstring-prefix?
6822 @c snarfed from srfi-13.c:1764
6823 @deffn {Scheme Procedure} string-prefix? s1 s2 [start1 [end1 [start2 [end2]]]]
6824 @deffnx {C Function} scm_string_prefix_p (s1, s2, start1, end1, start2, end2)
6825 Is @var{s1} a prefix of @var{s2}?
6826 @end deffn
6827
6828 \fstring-prefix-ci?
6829 @c snarfed from srfi-13.c:1796
6830 @deffn {Scheme Procedure} string-prefix-ci? s1 s2 [start1 [end1 [start2 [end2]]]]
6831 @deffnx {C Function} scm_string_prefix_ci_p (s1, s2, start1, end1, start2, end2)
6832 Is @var{s1} a prefix of @var{s2}, ignoring character case?
6833 @end deffn
6834
6835 \fstring-suffix?
6836 @c snarfed from srfi-13.c:1828
6837 @deffn {Scheme Procedure} string-suffix? s1 s2 [start1 [end1 [start2 [end2]]]]
6838 @deffnx {C Function} scm_string_suffix_p (s1, s2, start1, end1, start2, end2)
6839 Is @var{s1} a suffix of @var{s2}?
6840 @end deffn
6841
6842 \fstring-suffix-ci?
6843 @c snarfed from srfi-13.c:1860
6844 @deffn {Scheme Procedure} string-suffix-ci? s1 s2 [start1 [end1 [start2 [end2]]]]
6845 @deffnx {C Function} scm_string_suffix_ci_p (s1, s2, start1, end1, start2, end2)
6846 Is @var{s1} a suffix of @var{s2}, ignoring character case?
6847 @end deffn
6848
6849 \fstring-index
6850 @c snarfed from srfi-13.c:1904
6851 @deffn {Scheme Procedure} string-index s char_pred [start [end]]
6852 @deffnx {C Function} scm_string_index (s, char_pred, start, end)
6853 Search through the string @var{s} from left to right, returning
6854 the index of the first occurence of a character which
6855
6856 @itemize @bullet
6857 @item
6858 equals @var{char_pred}, if it is character,
6859
6860 @item
6861 satisifies the predicate @var{char_pred}, if it is a procedure,
6862
6863 @item
6864 is in the set @var{char_pred}, if it is a character set.
6865 @end itemize
6866 @end deffn
6867
6868 \fstring-index-right
6869 @c snarfed from srfi-13.c:1969
6870 @deffn {Scheme Procedure} string-index-right s char_pred [start [end]]
6871 @deffnx {C Function} scm_string_index_right (s, char_pred, start, end)
6872 Search through the string @var{s} from right to left, returning
6873 the index of the last occurence of a character which
6874
6875 @itemize @bullet
6876 @item
6877 equals @var{char_pred}, if it is character,
6878
6879 @item
6880 satisifies the predicate @var{char_pred}, if it is a procedure,
6881
6882 @item
6883 is in the set if @var{char_pred} is a character set.
6884 @end itemize
6885 @end deffn
6886
6887 \fstring-rindex
6888 @c snarfed from srfi-13.c:2034
6889 @deffn {Scheme Procedure} string-rindex s char_pred [start [end]]
6890 @deffnx {C Function} scm_string_rindex (s, char_pred, start, end)
6891 Search through the string @var{s} from right to left, returning
6892 the index of the last occurence of a character which
6893
6894 @itemize @bullet
6895 @item
6896 equals @var{char_pred}, if it is character,
6897
6898 @item
6899 satisifies the predicate @var{char_pred}, if it is a procedure,
6900
6901 @item
6902 is in the set if @var{char_pred} is a character set.
6903 @end itemize
6904 @end deffn
6905
6906 \fstring-skip
6907 @c snarfed from srfi-13.c:2056
6908 @deffn {Scheme Procedure} string-skip s char_pred [start [end]]
6909 @deffnx {C Function} scm_string_skip (s, char_pred, start, end)
6910 Search through the string @var{s} from left to right, returning
6911 the index of the first occurence of a character which
6912
6913 @itemize @bullet
6914 @item
6915 does not equal @var{char_pred}, if it is character,
6916
6917 @item
6918 does not satisify the predicate @var{char_pred}, if it is a
6919 procedure,
6920
6921 @item
6922 is not in the set if @var{char_pred} is a character set.
6923 @end itemize
6924 @end deffn
6925
6926 \fstring-skip-right
6927 @c snarfed from srfi-13.c:2123
6928 @deffn {Scheme Procedure} string-skip-right s char_pred [start [end]]
6929 @deffnx {C Function} scm_string_skip_right (s, char_pred, start, end)
6930 Search through the string @var{s} from right to left, returning
6931 the index of the last occurence of a character which
6932
6933 @itemize @bullet
6934 @item
6935 does not equal @var{char_pred}, if it is character,
6936
6937 @item
6938 does not satisfy the predicate @var{char_pred}, if it is a
6939 procedure,
6940
6941 @item
6942 is not in the set if @var{char_pred} is a character set.
6943 @end itemize
6944 @end deffn
6945
6946 \fstring-count
6947 @c snarfed from srfi-13.c:2190
6948 @deffn {Scheme Procedure} string-count s char_pred [start [end]]
6949 @deffnx {C Function} scm_string_count (s, char_pred, start, end)
6950 Return the count of the number of characters in the string
6951 @var{s} which
6952
6953 @itemize @bullet
6954 @item
6955 equals @var{char_pred}, if it is character,
6956
6957 @item
6958 satisifies the predicate @var{char_pred}, if it is a procedure.
6959
6960 @item
6961 is in the set @var{char_pred}, if it is a character set.
6962 @end itemize
6963 @end deffn
6964
6965 \fstring-contains
6966 @c snarfed from srfi-13.c:2247
6967 @deffn {Scheme Procedure} string-contains s1 s2 [start1 [end1 [start2 [end2]]]]
6968 @deffnx {C Function} scm_string_contains (s1, s2, start1, end1, start2, end2)
6969 Does string @var{s1} contain string @var{s2}? Return the index
6970 in @var{s1} where @var{s2} occurs as a substring, or false.
6971 The optional start/end indices restrict the operation to the
6972 indicated substrings.
6973 @end deffn
6974
6975 \fstring-contains-ci
6976 @c snarfed from srfi-13.c:2294
6977 @deffn {Scheme Procedure} string-contains-ci s1 s2 [start1 [end1 [start2 [end2]]]]
6978 @deffnx {C Function} scm_string_contains_ci (s1, s2, start1, end1, start2, end2)
6979 Does string @var{s1} contain string @var{s2}? Return the index
6980 in @var{s1} where @var{s2} occurs as a substring, or false.
6981 The optional start/end indices restrict the operation to the
6982 indicated substrings. Character comparison is done
6983 case-insensitively.
6984 @end deffn
6985
6986 \fstring-upcase!
6987 @c snarfed from srfi-13.c:2359
6988 @deffn {Scheme Procedure} string-upcase! str [start [end]]
6989 @deffnx {C Function} scm_substring_upcase_x (str, start, end)
6990 Destructively upcase every character in @code{str}.
6991
6992 @lisp
6993 (string-upcase! y)
6994 @result{} "ARRDEFG"
6995 y
6996 @result{} "ARRDEFG"
6997 @end lisp
6998 @end deffn
6999
7000 \fstring-upcase
7001 @c snarfed from srfi-13.c:2380
7002 @deffn {Scheme Procedure} string-upcase str [start [end]]
7003 @deffnx {C Function} scm_substring_upcase (str, start, end)
7004 Upcase every character in @code{str}.
7005 @end deffn
7006
7007 \fstring-downcase!
7008 @c snarfed from srfi-13.c:2427
7009 @deffn {Scheme Procedure} string-downcase! str [start [end]]
7010 @deffnx {C Function} scm_substring_downcase_x (str, start, end)
7011 Destructively downcase every character in @var{str}.
7012
7013 @lisp
7014 y
7015 @result{} "ARRDEFG"
7016 (string-downcase! y)
7017 @result{} "arrdefg"
7018 y
7019 @result{} "arrdefg"
7020 @end lisp
7021 @end deffn
7022
7023 \fstring-downcase
7024 @c snarfed from srfi-13.c:2448
7025 @deffn {Scheme Procedure} string-downcase str [start [end]]
7026 @deffnx {C Function} scm_substring_downcase (str, start, end)
7027 Downcase every character in @var{str}.
7028 @end deffn
7029
7030 \fstring-titlecase!
7031 @c snarfed from srfi-13.c:2504
7032 @deffn {Scheme Procedure} string-titlecase! str [start [end]]
7033 @deffnx {C Function} scm_string_titlecase_x (str, start, end)
7034 Destructively titlecase every first character in a word in
7035 @var{str}.
7036 @end deffn
7037
7038 \fstring-titlecase
7039 @c snarfed from srfi-13.c:2520
7040 @deffn {Scheme Procedure} string-titlecase str [start [end]]
7041 @deffnx {C Function} scm_string_titlecase (str, start, end)
7042 Titlecase every first character in a word in @var{str}.
7043 @end deffn
7044
7045 \fstring-capitalize!
7046 @c snarfed from srfi-13.c:2542
7047 @deffn {Scheme Procedure} string-capitalize! str
7048 @deffnx {C Function} scm_string_capitalize_x (str)
7049 Upcase the first character of every word in @var{str}
7050 destructively and return @var{str}.
7051
7052 @lisp
7053 y @result{} "hello world"
7054 (string-capitalize! y) @result{} "Hello World"
7055 y @result{} "Hello World"
7056 @end lisp
7057 @end deffn
7058
7059 \fstring-capitalize
7060 @c snarfed from srfi-13.c:2554
7061 @deffn {Scheme Procedure} string-capitalize str
7062 @deffnx {C Function} scm_string_capitalize (str)
7063 Return a freshly allocated string with the characters in
7064 @var{str}, where the first character of every word is
7065 capitalized.
7066 @end deffn
7067
7068 \fstring-reverse
7069 @c snarfed from srfi-13.c:2588
7070 @deffn {Scheme Procedure} string-reverse str [start [end]]
7071 @deffnx {C Function} scm_string_reverse (str, start, end)
7072 Reverse the string @var{str}. The optional arguments
7073 @var{start} and @var{end} delimit the region of @var{str} to
7074 operate on.
7075 @end deffn
7076
7077 \fstring-reverse!
7078 @c snarfed from srfi-13.c:2613
7079 @deffn {Scheme Procedure} string-reverse! str [start [end]]
7080 @deffnx {C Function} scm_string_reverse_x (str, start, end)
7081 Reverse the string @var{str} in-place. The optional arguments
7082 @var{start} and @var{end} delimit the region of @var{str} to
7083 operate on. The return value is unspecified.
7084 @end deffn
7085
7086 \fstring-append/shared
7087 @c snarfed from srfi-13.c:2635
7088 @deffn {Scheme Procedure} string-append/shared . rest
7089 @deffnx {C Function} scm_string_append_shared (rest)
7090 Like @code{string-append}, but the result may share memory
7091 with the argument strings.
7092 @end deffn
7093
7094 \fstring-concatenate
7095 @c snarfed from srfi-13.c:2656
7096 @deffn {Scheme Procedure} string-concatenate ls
7097 @deffnx {C Function} scm_string_concatenate (ls)
7098 Append the elements of @var{ls} (which must be strings)
7099 together into a single string. Guaranteed to return a freshly
7100 allocated string.
7101 @end deffn
7102
7103 \fstring-concatenate-reverse
7104 @c snarfed from srfi-13.c:2678
7105 @deffn {Scheme Procedure} string-concatenate-reverse ls [final_string [end]]
7106 @deffnx {C Function} scm_string_concatenate_reverse (ls, final_string, end)
7107 Without optional arguments, this procedure is equivalent to
7108
7109 @smalllisp
7110 (string-concatenate (reverse ls))
7111 @end smalllisp
7112
7113 If the optional argument @var{final_string} is specified, it is
7114 consed onto the beginning to @var{ls} before performing the
7115 list-reverse and string-concatenate operations. If @var{end}
7116 is given, only the characters of @var{final_string} up to index
7117 @var{end} are used.
7118
7119 Guaranteed to return a freshly allocated string.
7120 @end deffn
7121
7122 \fstring-concatenate/shared
7123 @c snarfed from srfi-13.c:2695
7124 @deffn {Scheme Procedure} string-concatenate/shared ls
7125 @deffnx {C Function} scm_string_concatenate_shared (ls)
7126 Like @code{string-concatenate}, but the result may share memory
7127 with the strings in the list @var{ls}.
7128 @end deffn
7129
7130 \fstring-concatenate-reverse/shared
7131 @c snarfed from srfi-13.c:2706
7132 @deffn {Scheme Procedure} string-concatenate-reverse/shared ls [final_string [end]]
7133 @deffnx {C Function} scm_string_concatenate_reverse_shared (ls, final_string, end)
7134 Like @code{string-concatenate-reverse}, but the result may
7135 share memory with the the strings in the @var{ls} arguments.
7136 @end deffn
7137
7138 \fstring-map
7139 @c snarfed from srfi-13.c:2719
7140 @deffn {Scheme Procedure} string-map proc s [start [end]]
7141 @deffnx {C Function} scm_string_map (proc, s, start, end)
7142 @var{proc} is a char->char procedure, it is mapped over
7143 @var{s}. The order in which the procedure is applied to the
7144 string elements is not specified.
7145 @end deffn
7146
7147 \fstring-map!
7148 @c snarfed from srfi-13.c:2749
7149 @deffn {Scheme Procedure} string-map! proc s [start [end]]
7150 @deffnx {C Function} scm_string_map_x (proc, s, start, end)
7151 @var{proc} is a char->char procedure, it is mapped over
7152 @var{s}. The order in which the procedure is applied to the
7153 string elements is not specified. The string @var{s} is
7154 modified in-place, the return value is not specified.
7155 @end deffn
7156
7157 \fstring-fold
7158 @c snarfed from srfi-13.c:2776
7159 @deffn {Scheme Procedure} string-fold kons knil s [start [end]]
7160 @deffnx {C Function} scm_string_fold (kons, knil, s, start, end)
7161 Fold @var{kons} over the characters of @var{s}, with @var{knil}
7162 as the terminating element, from left to right. @var{kons}
7163 must expect two arguments: The actual character and the last
7164 result of @var{kons}' application.
7165 @end deffn
7166
7167 \fstring-fold-right
7168 @c snarfed from srfi-13.c:2807
7169 @deffn {Scheme Procedure} string-fold-right kons knil s [start [end]]
7170 @deffnx {C Function} scm_string_fold_right (kons, knil, s, start, end)
7171 Fold @var{kons} over the characters of @var{s}, with @var{knil}
7172 as the terminating element, from right to left. @var{kons}
7173 must expect two arguments: The actual character and the last
7174 result of @var{kons}' application.
7175 @end deffn
7176
7177 \fstring-unfold
7178 @c snarfed from srfi-13.c:2852
7179 @deffn {Scheme Procedure} string-unfold p f g seed [base [make_final]]
7180 @deffnx {C Function} scm_string_unfold (p, f, g, seed, base, make_final)
7181 @itemize @bullet
7182 @item @var{g} is used to generate a series of @emph{seed}
7183 values from the initial @var{seed}: @var{seed}, (@var{g}
7184 @var{seed}), (@var{g}^2 @var{seed}), (@var{g}^3 @var{seed}),
7185 @dots{}
7186 @item @var{p} tells us when to stop -- when it returns true
7187 when applied to one of these seed values.
7188 @item @var{f} maps each seed value to the corresponding
7189 character in the result string. These chars are assembled
7190 into the string in a left-to-right order.
7191 @item @var{base} is the optional initial/leftmost portion
7192 of the constructed string; it default to the empty
7193 string.
7194 @item @var{make_final} is applied to the terminal seed
7195 value (on which @var{p} returns true) to produce
7196 the final/rightmost portion of the constructed string.
7197 It defaults to @code{(lambda (x) )}.
7198 @end itemize
7199 @end deffn
7200
7201 \fstring-unfold-right
7202 @c snarfed from srfi-13.c:2915
7203 @deffn {Scheme Procedure} string-unfold-right p f g seed [base [make_final]]
7204 @deffnx {C Function} scm_string_unfold_right (p, f, g, seed, base, make_final)
7205 @itemize @bullet
7206 @item @var{g} is used to generate a series of @emph{seed}
7207 values from the initial @var{seed}: @var{seed}, (@var{g}
7208 @var{seed}), (@var{g}^2 @var{seed}), (@var{g}^3 @var{seed}),
7209 @dots{}
7210 @item @var{p} tells us when to stop -- when it returns true
7211 when applied to one of these seed values.
7212 @item @var{f} maps each seed value to the corresponding
7213 character in the result string. These chars are assembled
7214 into the string in a right-to-left order.
7215 @item @var{base} is the optional initial/rightmost portion
7216 of the constructed string; it default to the empty
7217 string.
7218 @item @var{make_final} is applied to the terminal seed
7219 value (on which @var{p} returns true) to produce
7220 the final/leftmost portion of the constructed string.
7221 It defaults to @code{(lambda (x) )}.
7222 @end itemize
7223 @end deffn
7224
7225 \fstring-for-each
7226 @c snarfed from srfi-13.c:2962
7227 @deffn {Scheme Procedure} string-for-each proc s [start [end]]
7228 @deffnx {C Function} scm_string_for_each (proc, s, start, end)
7229 @var{proc} is mapped over @var{s} in left-to-right order. The
7230 return value is not specified.
7231 @end deffn
7232
7233 \fstring-for-each-index
7234 @c snarfed from srfi-13.c:2988
7235 @deffn {Scheme Procedure} string-for-each-index proc s [start [end]]
7236 @deffnx {C Function} scm_string_for_each_index (proc, s, start, end)
7237 @var{proc} is mapped over @var{s} in left-to-right order. The
7238 return value is not specified.
7239 @end deffn
7240
7241 \fxsubstring
7242 @c snarfed from srfi-13.c:3020
7243 @deffn {Scheme Procedure} xsubstring s from [to [start [end]]]
7244 @deffnx {C Function} scm_xsubstring (s, from, to, start, end)
7245 This is the @emph{extended substring} procedure that implements
7246 replicated copying of a substring of some string.
7247
7248 @var{s} is a string, @var{start} and @var{end} are optional
7249 arguments that demarcate a substring of @var{s}, defaulting to
7250 0 and the length of @var{s}. Replicate this substring up and
7251 down index space, in both the positive and negative directions.
7252 @code{xsubstring} returns the substring of this string
7253 beginning at index @var{from}, and ending at @var{to}, which
7254 defaults to @var{from} + (@var{end} - @var{start}).
7255 @end deffn
7256
7257 \fstring-xcopy!
7258 @c snarfed from srfi-13.c:3067
7259 @deffn {Scheme Procedure} string-xcopy! target tstart s sfrom [sto [start [end]]]
7260 @deffnx {C Function} scm_string_xcopy_x (target, tstart, s, sfrom, sto, start, end)
7261 Exactly the same as @code{xsubstring}, but the extracted text
7262 is written into the string @var{target} starting at index
7263 @var{tstart}. The operation is not defined if @code{(eq?
7264 @var{target} @var{s})} or these arguments share storage -- you
7265 cannot copy a string on top of itself.
7266 @end deffn
7267
7268 \fstring-replace
7269 @c snarfed from srfi-13.c:3117
7270 @deffn {Scheme Procedure} string-replace s1 s2 [start1 [end1 [start2 [end2]]]]
7271 @deffnx {C Function} scm_string_replace (s1, s2, start1, end1, start2, end2)
7272 Return the string @var{s1}, but with the characters
7273 @var{start1} @dots{} @var{end1} replaced by the characters
7274 @var{start2} @dots{} @var{end2} from @var{s2}.
7275 @end deffn
7276
7277 \fstring-tokenize
7278 @c snarfed from srfi-13.c:3154
7279 @deffn {Scheme Procedure} string-tokenize s [token_set [start [end]]]
7280 @deffnx {C Function} scm_string_tokenize (s, token_set, start, end)
7281 Split the string @var{s} into a list of substrings, where each
7282 substring is a maximal non-empty contiguous sequence of
7283 characters from the character set @var{token_set}, which
7284 defaults to @code{char-set:graphic}.
7285 If @var{start} or @var{end} indices are provided, they restrict
7286 @code{string-tokenize} to operating on the indicated substring
7287 of @var{s}.
7288 @end deffn
7289
7290 \fstring-split
7291 @c snarfed from srfi-13.c:3220
7292 @deffn {Scheme Procedure} string-split str chr
7293 @deffnx {C Function} scm_string_split (str, chr)
7294 Split the string @var{str} into the a list of the substrings delimited
7295 by appearances of the character @var{chr}. Note that an empty substring
7296 between separator characters will result in an empty string in the
7297 result list.
7298
7299 @lisp
7300 (string-split "root:x:0:0:root:/root:/bin/bash" #\:)
7301 @result{}
7302 ("root" "x" "0" "0" "root" "/root" "/bin/bash")
7303
7304 (string-split "::" #\:)
7305 @result{}
7306 ("" "" "")
7307
7308 (string-split "" #\:)
7309 @result{}
7310 ("")
7311 @end lisp
7312 @end deffn
7313
7314 \fstring-filter
7315 @c snarfed from srfi-13.c:3258
7316 @deffn {Scheme Procedure} string-filter s char_pred [start [end]]
7317 @deffnx {C Function} scm_string_filter (s, char_pred, start, end)
7318 Filter the string @var{s}, retaining only those characters that
7319 satisfy the @var{char_pred} argument. If the argument is a
7320 procedure, it is applied to each character as a predicate, if
7321 it is a character, it is tested for equality and if it is a
7322 character set, it is tested for membership.
7323 @end deffn
7324
7325 \fstring-delete
7326 @c snarfed from srfi-13.c:3330
7327 @deffn {Scheme Procedure} string-delete s char_pred [start [end]]
7328 @deffnx {C Function} scm_string_delete (s, char_pred, start, end)
7329 Filter the string @var{s}, retaining only those characters that
7330 do not satisfy the @var{char_pred} argument. If the argument
7331 is a procedure, it is applied to each character as a predicate,
7332 if it is a character, it is tested for equality and if it is a
7333 character set, it is tested for membership.
7334 @end deffn
7335
7336 \fchar-set?
7337 @c snarfed from srfi-14.c:85
7338 @deffn {Scheme Procedure} char-set? obj
7339 @deffnx {C Function} scm_char_set_p (obj)
7340 Return @code{#t} if @var{obj} is a character set, @code{#f}
7341 otherwise.
7342 @end deffn
7343
7344 \fchar-set=
7345 @c snarfed from srfi-14.c:95
7346 @deffn {Scheme Procedure} char-set= . char_sets
7347 @deffnx {C Function} scm_char_set_eq (char_sets)
7348 Return @code{#t} if all given character sets are equal.
7349 @end deffn
7350
7351 \fchar-set<=
7352 @c snarfed from srfi-14.c:125
7353 @deffn {Scheme Procedure} char-set<= . char_sets
7354 @deffnx {C Function} scm_char_set_leq (char_sets)
7355 Return @code{#t} if every character set @var{cs}i is a subset
7356 of character set @var{cs}i+1.
7357 @end deffn
7358
7359 \fchar-set-hash
7360 @c snarfed from srfi-14.c:163
7361 @deffn {Scheme Procedure} char-set-hash cs [bound]
7362 @deffnx {C Function} scm_char_set_hash (cs, bound)
7363 Compute a hash value for the character set @var{cs}. If
7364 @var{bound} is given and non-zero, it restricts the
7365 returned value to the range 0 @dots{} @var{bound - 1}.
7366 @end deffn
7367
7368 \fchar-set-cursor
7369 @c snarfed from srfi-14.c:196
7370 @deffn {Scheme Procedure} char-set-cursor cs
7371 @deffnx {C Function} scm_char_set_cursor (cs)
7372 Return a cursor into the character set @var{cs}.
7373 @end deffn
7374
7375 \fchar-set-ref
7376 @c snarfed from srfi-14.c:216
7377 @deffn {Scheme Procedure} char-set-ref cs cursor
7378 @deffnx {C Function} scm_char_set_ref (cs, cursor)
7379 Return the character at the current cursor position
7380 @var{cursor} in the character set @var{cs}. It is an error to
7381 pass a cursor for which @code{end-of-char-set?} returns true.
7382 @end deffn
7383
7384 \fchar-set-cursor-next
7385 @c snarfed from srfi-14.c:233
7386 @deffn {Scheme Procedure} char-set-cursor-next cs cursor
7387 @deffnx {C Function} scm_char_set_cursor_next (cs, cursor)
7388 Advance the character set cursor @var{cursor} to the next
7389 character in the character set @var{cs}. It is an error if the
7390 cursor given satisfies @code{end-of-char-set?}.
7391 @end deffn
7392
7393 \fend-of-char-set?
7394 @c snarfed from srfi-14.c:254
7395 @deffn {Scheme Procedure} end-of-char-set? cursor
7396 @deffnx {C Function} scm_end_of_char_set_p (cursor)
7397 Return @code{#t} if @var{cursor} has reached the end of a
7398 character set, @code{#f} otherwise.
7399 @end deffn
7400
7401 \fchar-set-fold
7402 @c snarfed from srfi-14.c:266
7403 @deffn {Scheme Procedure} char-set-fold kons knil cs
7404 @deffnx {C Function} scm_char_set_fold (kons, knil, cs)
7405 Fold the procedure @var{kons} over the character set @var{cs},
7406 initializing it with @var{knil}.
7407 @end deffn
7408
7409 \fchar-set-unfold
7410 @c snarfed from srfi-14.c:296
7411 @deffn {Scheme Procedure} char-set-unfold p f g seed [base_cs]
7412 @deffnx {C Function} scm_char_set_unfold (p, f, g, seed, base_cs)
7413 This is a fundamental constructor for character sets.
7414 @itemize @bullet
7415 @item @var{g} is used to generate a series of ``seed'' values
7416 from the initial seed: @var{seed}, (@var{g} @var{seed}),
7417 (@var{g}^2 @var{seed}), (@var{g}^3 @var{seed}), @dots{}
7418 @item @var{p} tells us when to stop -- when it returns true
7419 when applied to one of the seed values.
7420 @item @var{f} maps each seed value to a character. These
7421 characters are added to the base character set @var{base_cs} to
7422 form the result; @var{base_cs} defaults to the empty set.
7423 @end itemize
7424 @end deffn
7425
7426 \fchar-set-unfold!
7427 @c snarfed from srfi-14.c:340
7428 @deffn {Scheme Procedure} char-set-unfold! p f g seed base_cs
7429 @deffnx {C Function} scm_char_set_unfold_x (p, f, g, seed, base_cs)
7430 This is a fundamental constructor for character sets.
7431 @itemize @bullet
7432 @item @var{g} is used to generate a series of ``seed'' values
7433 from the initial seed: @var{seed}, (@var{g} @var{seed}),
7434 (@var{g}^2 @var{seed}), (@var{g}^3 @var{seed}), @dots{}
7435 @item @var{p} tells us when to stop -- when it returns true
7436 when applied to one of the seed values.
7437 @item @var{f} maps each seed value to a character. These
7438 characters are added to the base character set @var{base_cs} to
7439 form the result; @var{base_cs} defaults to the empty set.
7440 @end itemize
7441 @end deffn
7442
7443 \fchar-set-for-each
7444 @c snarfed from srfi-14.c:369
7445 @deffn {Scheme Procedure} char-set-for-each proc cs
7446 @deffnx {C Function} scm_char_set_for_each (proc, cs)
7447 Apply @var{proc} to every character in the character set
7448 @var{cs}. The return value is not specified.
7449 @end deffn
7450
7451 \fchar-set-map
7452 @c snarfed from srfi-14.c:388
7453 @deffn {Scheme Procedure} char-set-map proc cs
7454 @deffnx {C Function} scm_char_set_map (proc, cs)
7455 Map the procedure @var{proc} over every character in @var{cs}.
7456 @var{proc} must be a character -> character procedure.
7457 @end deffn
7458
7459 \fchar-set-copy
7460 @c snarfed from srfi-14.c:414
7461 @deffn {Scheme Procedure} char-set-copy cs
7462 @deffnx {C Function} scm_char_set_copy (cs)
7463 Return a newly allocated character set containing all
7464 characters in @var{cs}.
7465 @end deffn
7466
7467 \fchar-set
7468 @c snarfed from srfi-14.c:434
7469 @deffn {Scheme Procedure} char-set . rest
7470 @deffnx {C Function} scm_char_set (rest)
7471 Return a character set containing all given characters.
7472 @end deffn
7473
7474 \flist->char-set
7475 @c snarfed from srfi-14.c:462
7476 @deffn {Scheme Procedure} list->char-set list [base_cs]
7477 @deffnx {C Function} scm_list_to_char_set (list, base_cs)
7478 Convert the character list @var{list} to a character set. If
7479 the character set @var{base_cs} is given, the character in this
7480 set are also included in the result.
7481 @end deffn
7482
7483 \flist->char-set!
7484 @c snarfed from srfi-14.c:496
7485 @deffn {Scheme Procedure} list->char-set! list base_cs
7486 @deffnx {C Function} scm_list_to_char_set_x (list, base_cs)
7487 Convert the character list @var{list} to a character set. The
7488 characters are added to @var{base_cs} and @var{base_cs} is
7489 returned.
7490 @end deffn
7491
7492 \fstring->char-set
7493 @c snarfed from srfi-14.c:523
7494 @deffn {Scheme Procedure} string->char-set str [base_cs]
7495 @deffnx {C Function} scm_string_to_char_set (str, base_cs)
7496 Convert the string @var{str} to a character set. If the
7497 character set @var{base_cs} is given, the characters in this
7498 set are also included in the result.
7499 @end deffn
7500
7501 \fstring->char-set!
7502 @c snarfed from srfi-14.c:557
7503 @deffn {Scheme Procedure} string->char-set! str base_cs
7504 @deffnx {C Function} scm_string_to_char_set_x (str, base_cs)
7505 Convert the string @var{str} to a character set. The
7506 characters from the string are added to @var{base_cs}, and
7507 @var{base_cs} is returned.
7508 @end deffn
7509
7510 \fchar-set-filter
7511 @c snarfed from srfi-14.c:584
7512 @deffn {Scheme Procedure} char-set-filter pred cs [base_cs]
7513 @deffnx {C Function} scm_char_set_filter (pred, cs, base_cs)
7514 Return a character set containing every character from @var{cs}
7515 so that it satisfies @var{pred}. If provided, the characters
7516 from @var{base_cs} are added to the result.
7517 @end deffn
7518
7519 \fchar-set-filter!
7520 @c snarfed from srfi-14.c:620
7521 @deffn {Scheme Procedure} char-set-filter! pred cs base_cs
7522 @deffnx {C Function} scm_char_set_filter_x (pred, cs, base_cs)
7523 Return a character set containing every character from @var{cs}
7524 so that it satisfies @var{pred}. The characters are added to
7525 @var{base_cs} and @var{base_cs} is returned.
7526 @end deffn
7527
7528 \fucs-range->char-set
7529 @c snarfed from srfi-14.c:658
7530 @deffn {Scheme Procedure} ucs-range->char-set lower upper [error [base_cs]]
7531 @deffnx {C Function} scm_ucs_range_to_char_set (lower, upper, error, base_cs)
7532 Return a character set containing all characters whose
7533 character codes lie in the half-open range
7534 [@var{lower},@var{upper}).
7535
7536 If @var{error} is a true value, an error is signalled if the
7537 specified range contains characters which are not contained in
7538 the implemented character range. If @var{error} is @code{#f},
7539 these characters are silently left out of the resultung
7540 character set.
7541
7542 The characters in @var{base_cs} are added to the result, if
7543 given.
7544 @end deffn
7545
7546 \fucs-range->char-set!
7547 @c snarfed from srfi-14.c:711
7548 @deffn {Scheme Procedure} ucs-range->char-set! lower upper error base_cs
7549 @deffnx {C Function} scm_ucs_range_to_char_set_x (lower, upper, error, base_cs)
7550 Return a character set containing all characters whose
7551 character codes lie in the half-open range
7552 [@var{lower},@var{upper}).
7553
7554 If @var{error} is a true value, an error is signalled if the
7555 specified range contains characters which are not contained in
7556 the implemented character range. If @var{error} is @code{#f},
7557 these characters are silently left out of the resultung
7558 character set.
7559
7560 The characters are added to @var{base_cs} and @var{base_cs} is
7561 returned.
7562 @end deffn
7563
7564 \f->char-set
7565 @c snarfed from srfi-14.c:741
7566 @deffn {Scheme Procedure} ->char-set x
7567 @deffnx {C Function} scm_to_char_set (x)
7568 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.
7569 @end deffn
7570
7571 \fchar-set-size
7572 @c snarfed from srfi-14.c:757
7573 @deffn {Scheme Procedure} char-set-size cs
7574 @deffnx {C Function} scm_char_set_size (cs)
7575 Return the number of elements in character set @var{cs}.
7576 @end deffn
7577
7578 \fchar-set-count
7579 @c snarfed from srfi-14.c:774
7580 @deffn {Scheme Procedure} char-set-count pred cs
7581 @deffnx {C Function} scm_char_set_count (pred, cs)
7582 Return the number of the elements int the character set
7583 @var{cs} which satisfy the predicate @var{pred}.
7584 @end deffn
7585
7586 \fchar-set->list
7587 @c snarfed from srfi-14.c:797
7588 @deffn {Scheme Procedure} char-set->list cs
7589 @deffnx {C Function} scm_char_set_to_list (cs)
7590 Return a list containing the elements of the character set
7591 @var{cs}.
7592 @end deffn
7593
7594 \fchar-set->string
7595 @c snarfed from srfi-14.c:816
7596 @deffn {Scheme Procedure} char-set->string cs
7597 @deffnx {C Function} scm_char_set_to_string (cs)
7598 Return a string containing the elements of the character set
7599 @var{cs}. The order in which the characters are placed in the
7600 string is not defined.
7601 @end deffn
7602
7603 \fchar-set-contains?
7604 @c snarfed from srfi-14.c:841
7605 @deffn {Scheme Procedure} char-set-contains? cs ch
7606 @deffnx {C Function} scm_char_set_contains_p (cs, ch)
7607 Return @code{#t} iff the character @var{ch} is contained in the
7608 character set @var{cs}.
7609 @end deffn
7610
7611 \fchar-set-every
7612 @c snarfed from srfi-14.c:854
7613 @deffn {Scheme Procedure} char-set-every pred cs
7614 @deffnx {C Function} scm_char_set_every (pred, cs)
7615 Return a true value if every character in the character set
7616 @var{cs} satisfies the predicate @var{pred}.
7617 @end deffn
7618
7619 \fchar-set-any
7620 @c snarfed from srfi-14.c:878
7621 @deffn {Scheme Procedure} char-set-any pred cs
7622 @deffnx {C Function} scm_char_set_any (pred, cs)
7623 Return a true value if any character in the character set
7624 @var{cs} satisfies the predicate @var{pred}.
7625 @end deffn
7626
7627 \fchar-set-adjoin
7628 @c snarfed from srfi-14.c:901
7629 @deffn {Scheme Procedure} char-set-adjoin cs . rest
7630 @deffnx {C Function} scm_char_set_adjoin (cs, rest)
7631 Add all character arguments to the first argument, which must
7632 be a character set.
7633 @end deffn
7634
7635 \fchar-set-delete
7636 @c snarfed from srfi-14.c:929
7637 @deffn {Scheme Procedure} char-set-delete cs . rest
7638 @deffnx {C Function} scm_char_set_delete (cs, rest)
7639 Delete all character arguments from the first argument, which
7640 must be a character set.
7641 @end deffn
7642
7643 \fchar-set-adjoin!
7644 @c snarfed from srfi-14.c:957
7645 @deffn {Scheme Procedure} char-set-adjoin! cs . rest
7646 @deffnx {C Function} scm_char_set_adjoin_x (cs, rest)
7647 Add all character arguments to the first argument, which must
7648 be a character set.
7649 @end deffn
7650
7651 \fchar-set-delete!
7652 @c snarfed from srfi-14.c:984
7653 @deffn {Scheme Procedure} char-set-delete! cs . rest
7654 @deffnx {C Function} scm_char_set_delete_x (cs, rest)
7655 Delete all character arguments from the first argument, which
7656 must be a character set.
7657 @end deffn
7658
7659 \fchar-set-complement
7660 @c snarfed from srfi-14.c:1010
7661 @deffn {Scheme Procedure} char-set-complement cs
7662 @deffnx {C Function} scm_char_set_complement (cs)
7663 Return the complement of the character set @var{cs}.
7664 @end deffn
7665
7666 \fchar-set-union
7667 @c snarfed from srfi-14.c:1031
7668 @deffn {Scheme Procedure} char-set-union . rest
7669 @deffnx {C Function} scm_char_set_union (rest)
7670 Return the union of all argument character sets.
7671 @end deffn
7672
7673 \fchar-set-intersection
7674 @c snarfed from srfi-14.c:1060
7675 @deffn {Scheme Procedure} char-set-intersection . rest
7676 @deffnx {C Function} scm_char_set_intersection (rest)
7677 Return the intersection of all argument character sets.
7678 @end deffn
7679
7680 \fchar-set-difference
7681 @c snarfed from srfi-14.c:1100
7682 @deffn {Scheme Procedure} char-set-difference cs1 . rest
7683 @deffnx {C Function} scm_char_set_difference (cs1, rest)
7684 Return the difference of all argument character sets.
7685 @end deffn
7686
7687 \fchar-set-xor
7688 @c snarfed from srfi-14.c:1130
7689 @deffn {Scheme Procedure} char-set-xor . rest
7690 @deffnx {C Function} scm_char_set_xor (rest)
7691 Return the exclusive-or of all argument character sets.
7692 @end deffn
7693
7694 \fchar-set-diff+intersection
7695 @c snarfed from srfi-14.c:1171
7696 @deffn {Scheme Procedure} char-set-diff+intersection cs1 . rest
7697 @deffnx {C Function} scm_char_set_diff_plus_intersection (cs1, rest)
7698 Return the difference and the intersection of all argument
7699 character sets.
7700 @end deffn
7701
7702 \fchar-set-complement!
7703 @c snarfed from srfi-14.c:1209
7704 @deffn {Scheme Procedure} char-set-complement! cs
7705 @deffnx {C Function} scm_char_set_complement_x (cs)
7706 Return the complement of the character set @var{cs}.
7707 @end deffn
7708
7709 \fchar-set-union!
7710 @c snarfed from srfi-14.c:1226
7711 @deffn {Scheme Procedure} char-set-union! cs1 . rest
7712 @deffnx {C Function} scm_char_set_union_x (cs1, rest)
7713 Return the union of all argument character sets.
7714 @end deffn
7715
7716 \fchar-set-intersection!
7717 @c snarfed from srfi-14.c:1254
7718 @deffn {Scheme Procedure} char-set-intersection! cs1 . rest
7719 @deffnx {C Function} scm_char_set_intersection_x (cs1, rest)
7720 Return the intersection of all argument character sets.
7721 @end deffn
7722
7723 \fchar-set-difference!
7724 @c snarfed from srfi-14.c:1282
7725 @deffn {Scheme Procedure} char-set-difference! cs1 . rest
7726 @deffnx {C Function} scm_char_set_difference_x (cs1, rest)
7727 Return the difference of all argument character sets.
7728 @end deffn
7729
7730 \fchar-set-xor!
7731 @c snarfed from srfi-14.c:1310
7732 @deffn {Scheme Procedure} char-set-xor! cs1 . rest
7733 @deffnx {C Function} scm_char_set_xor_x (cs1, rest)
7734 Return the exclusive-or of all argument character sets.
7735 @end deffn
7736
7737 \fchar-set-diff+intersection!
7738 @c snarfed from srfi-14.c:1349
7739 @deffn {Scheme Procedure} char-set-diff+intersection! cs1 cs2 . rest
7740 @deffnx {C Function} scm_char_set_diff_plus_intersection_x (cs1, cs2, rest)
7741 Return the difference and the intersection of all argument
7742 character sets.
7743 @end deffn
7744
7745 \fstring=?
7746 @c snarfed from strorder.c:50
7747 @deffn {Scheme Procedure} string=? [s1 [s2 . rest]]
7748 @deffnx {C Function} scm_i_string_equal_p (s1, s2, rest)
7749 Lexicographic equality predicate; return @code{#t} if the two
7750 strings are the same length and contain the same characters in
7751 the same positions, otherwise return @code{#f}.
7752
7753 The procedure @code{string-ci=?} treats upper and lower case
7754 letters as though they were the same character, but
7755 @code{string=?} treats upper and lower case as distinct
7756 characters.
7757 @end deffn
7758
7759 \fstring-ci=?
7760 @c snarfed from strorder.c:62
7761 @deffn {Scheme Procedure} string-ci=? [s1 [s2 . rest]]
7762 @deffnx {C Function} scm_i_string_ci_equal_p (s1, s2, rest)
7763 Case-insensitive string equality predicate; return @code{#t} if
7764 the two strings are the same length and their component
7765 characters match (ignoring case) at each position; otherwise
7766 return @code{#f}.
7767 @end deffn
7768
7769 \fstring<?
7770 @c snarfed from strorder.c:72
7771 @deffn {Scheme Procedure} string<? [s1 [s2 . rest]]
7772 @deffnx {C Function} scm_i_string_less_p (s1, s2, rest)
7773 Lexicographic ordering predicate; return @code{#t} if @var{s1}
7774 is lexicographically less than @var{s2}.
7775 @end deffn
7776
7777 \fstring<=?
7778 @c snarfed from strorder.c:82
7779 @deffn {Scheme Procedure} string<=? [s1 [s2 . rest]]
7780 @deffnx {C Function} scm_i_string_leq_p (s1, s2, rest)
7781 Lexicographic ordering predicate; return @code{#t} if @var{s1}
7782 is lexicographically less than or equal to @var{s2}.
7783 @end deffn
7784
7785 \fstring>?
7786 @c snarfed from strorder.c:92
7787 @deffn {Scheme Procedure} string>? [s1 [s2 . rest]]
7788 @deffnx {C Function} scm_i_string_gr_p (s1, s2, rest)
7789 Lexicographic ordering predicate; return @code{#t} if @var{s1}
7790 is lexicographically greater than @var{s2}.
7791 @end deffn
7792
7793 \fstring>=?
7794 @c snarfed from strorder.c:102
7795 @deffn {Scheme Procedure} string>=? [s1 [s2 . rest]]
7796 @deffnx {C Function} scm_i_string_geq_p (s1, s2, rest)
7797 Lexicographic ordering predicate; return @code{#t} if @var{s1}
7798 is lexicographically greater than or equal to @var{s2}.
7799 @end deffn
7800
7801 \fstring-ci<?
7802 @c snarfed from strorder.c:113
7803 @deffn {Scheme Procedure} string-ci<? [s1 [s2 . rest]]
7804 @deffnx {C Function} scm_i_string_ci_less_p (s1, s2, rest)
7805 Case insensitive lexicographic ordering predicate; return
7806 @code{#t} if @var{s1} is lexicographically less than @var{s2}
7807 regardless of case.
7808 @end deffn
7809
7810 \fstring-ci<=?
7811 @c snarfed from strorder.c:124
7812 @deffn {Scheme Procedure} string-ci<=? [s1 [s2 . rest]]
7813 @deffnx {C Function} scm_i_string_ci_leq_p (s1, s2, rest)
7814 Case insensitive lexicographic ordering predicate; return
7815 @code{#t} if @var{s1} is lexicographically less than or equal
7816 to @var{s2} regardless of case.
7817 @end deffn
7818
7819 \fstring-ci>?
7820 @c snarfed from strorder.c:135
7821 @deffn {Scheme Procedure} string-ci>? [s1 [s2 . rest]]
7822 @deffnx {C Function} scm_i_string_ci_gr_p (s1, s2, rest)
7823 Case insensitive lexicographic ordering predicate; return
7824 @code{#t} if @var{s1} is lexicographically greater than
7825 @var{s2} regardless of case.
7826 @end deffn
7827
7828 \fstring-ci>=?
7829 @c snarfed from strorder.c:146
7830 @deffn {Scheme Procedure} string-ci>=? [s1 [s2 . rest]]
7831 @deffnx {C Function} scm_i_string_ci_geq_p (s1, s2, rest)
7832 Case insensitive lexicographic ordering predicate; return
7833 @code{#t} if @var{s1} is lexicographically greater than or
7834 equal to @var{s2} regardless of case.
7835 @end deffn
7836
7837 \fobject->string
7838 @c snarfed from strports.c:332
7839 @deffn {Scheme Procedure} object->string obj [printer]
7840 @deffnx {C Function} scm_object_to_string (obj, printer)
7841 Return a Scheme string obtained by printing @var{obj}.
7842 Printing function can be specified by the optional second
7843 argument @var{printer} (default: @code{write}).
7844 @end deffn
7845
7846 \fcall-with-output-string
7847 @c snarfed from strports.c:356
7848 @deffn {Scheme Procedure} call-with-output-string proc
7849 @deffnx {C Function} scm_call_with_output_string (proc)
7850 Calls the one-argument procedure @var{proc} with a newly created output
7851 port. When the function returns, the string composed of the characters
7852 written into the port is returned.
7853 @end deffn
7854
7855 \fcall-with-input-string
7856 @c snarfed from strports.c:375
7857 @deffn {Scheme Procedure} call-with-input-string string proc
7858 @deffnx {C Function} scm_call_with_input_string (string, proc)
7859 Calls the one-argument procedure @var{proc} with a newly
7860 created input port from which @var{string}'s contents may be
7861 read. The value yielded by the @var{proc} is returned.
7862 @end deffn
7863
7864 \fopen-input-string
7865 @c snarfed from strports.c:388
7866 @deffn {Scheme Procedure} open-input-string str
7867 @deffnx {C Function} scm_open_input_string (str)
7868 Take a string and return an input port that delivers characters
7869 from the string. The port can be closed by
7870 @code{close-input-port}, though its storage will be reclaimed
7871 by the garbage collector if it becomes inaccessible.
7872 @end deffn
7873
7874 \fopen-output-string
7875 @c snarfed from strports.c:402
7876 @deffn {Scheme Procedure} open-output-string
7877 @deffnx {C Function} scm_open_output_string ()
7878 Return an output port that will accumulate characters for
7879 retrieval by @code{get-output-string}. The port can be closed
7880 by the procedure @code{close-output-port}, though its storage
7881 will be reclaimed by the garbage collector if it becomes
7882 inaccessible.
7883 @end deffn
7884
7885 \fget-output-string
7886 @c snarfed from strports.c:419
7887 @deffn {Scheme Procedure} get-output-string port
7888 @deffnx {C Function} scm_get_output_string (port)
7889 Given an output port created by @code{open-output-string},
7890 return a string consisting of the characters that have been
7891 output to the port so far.
7892 @end deffn
7893
7894 \feval-string
7895 @c snarfed from strports.c:488
7896 @deffn {Scheme Procedure} eval-string string [module]
7897 @deffnx {C Function} scm_eval_string_in_module (string, module)
7898 Evaluate @var{string} as the text representation of a Scheme
7899 form or forms, and return whatever value they produce.
7900 Evaluation takes place in the given module, or the current
7901 module when no module is given.
7902 While the code is evaluated, the given module is made the
7903 current one. The current module is restored when this
7904 procedure returns.
7905 @end deffn
7906
7907 \fmake-struct-layout
7908 @c snarfed from struct.c:56
7909 @deffn {Scheme Procedure} make-struct-layout fields
7910 @deffnx {C Function} scm_make_struct_layout (fields)
7911 Return a new structure layout object.
7912
7913 @var{fields} must be a string made up of pairs of characters
7914 strung together. The first character of each pair describes a field
7915 type, the second a field protection. Allowed types are 'p' for
7916 GC-protected Scheme data, 'u' for unprotected binary data, and 's' for
7917 a field that points to the structure itself. Allowed protections
7918 are 'w' for mutable fields, 'r' for read-only fields, and 'o' for opaque
7919 fields. The last field protection specification may be capitalized to
7920 indicate that the field is a tail-array.
7921 @end deffn
7922
7923 \fstruct?
7924 @c snarfed from struct.c:223
7925 @deffn {Scheme Procedure} struct? x
7926 @deffnx {C Function} scm_struct_p (x)
7927 Return @code{#t} iff @var{x} is a structure object, else
7928 @code{#f}.
7929 @end deffn
7930
7931 \fstruct-vtable?
7932 @c snarfed from struct.c:232
7933 @deffn {Scheme Procedure} struct-vtable? x
7934 @deffnx {C Function} scm_struct_vtable_p (x)
7935 Return @code{#t} iff @var{x} is a vtable structure.
7936 @end deffn
7937
7938 \fmake-struct
7939 @c snarfed from struct.c:418
7940 @deffn {Scheme Procedure} make-struct vtable tail_array_size . init
7941 @deffnx {C Function} scm_make_struct (vtable, tail_array_size, init)
7942 Create a new structure.
7943
7944 @var{type} must be a vtable structure (@pxref{Vtables}).
7945
7946 @var{tail-elts} must be a non-negative integer. If the layout
7947 specification indicated by @var{type} includes a tail-array,
7948 this is the number of elements allocated to that array.
7949
7950 The @var{init1}, @dots{} are optional arguments describing how
7951 successive fields of the structure should be initialized. Only fields
7952 with protection 'r' or 'w' can be initialized, except for fields of
7953 type 's', which are automatically initialized to point to the new
7954 structure itself; fields with protection 'o' can not be initialized by
7955 Scheme programs.
7956
7957 If fewer optional arguments than initializable fields are supplied,
7958 fields of type 'p' get default value #f while fields of type 'u' are
7959 initialized to 0.
7960
7961 Structs are currently the basic representation for record-like data
7962 structures in Guile. The plan is to eventually replace them with a
7963 new representation which will at the same time be easier to use and
7964 more powerful.
7965
7966 For more information, see the documentation for @code{make-vtable-vtable}.
7967 @end deffn
7968
7969 \fmake-vtable-vtable
7970 @c snarfed from struct.c:502
7971 @deffn {Scheme Procedure} make-vtable-vtable user_fields tail_array_size . init
7972 @deffnx {C Function} scm_make_vtable_vtable (user_fields, tail_array_size, init)
7973 Return a new, self-describing vtable structure.
7974
7975 @var{user-fields} is a string describing user defined fields of the
7976 vtable beginning at index @code{vtable-offset-user}
7977 (see @code{make-struct-layout}).
7978
7979 @var{tail-size} specifies the size of the tail-array (if any) of
7980 this vtable.
7981
7982 @var{init1}, @dots{} are the optional initializers for the fields of
7983 the vtable.
7984
7985 Vtables have one initializable system field---the struct printer.
7986 This field comes before the user fields in the initializers passed
7987 to @code{make-vtable-vtable} and @code{make-struct}, and thus works as
7988 a third optional argument to @code{make-vtable-vtable} and a fourth to
7989 @code{make-struct} when creating vtables:
7990
7991 If the value is a procedure, it will be called instead of the standard
7992 printer whenever a struct described by this vtable is printed.
7993 The procedure will be called with arguments STRUCT and PORT.
7994
7995 The structure of a struct is described by a vtable, so the vtable is
7996 in essence the type of the struct. The vtable is itself a struct with
7997 a vtable. This could go on forever if it weren't for the
7998 vtable-vtables which are self-describing vtables, and thus terminate
7999 the chain.
8000
8001 There are several potential ways of using structs, but the standard
8002 one is to use three kinds of structs, together building up a type
8003 sub-system: one vtable-vtable working as the root and one or several
8004 "types", each with a set of "instances". (The vtable-vtable should be
8005 compared to the class <class> which is the class of itself.)
8006
8007 @lisp
8008 (define ball-root (make-vtable-vtable "pr" 0))
8009
8010 (define (make-ball-type ball-color)
8011 (make-struct ball-root 0
8012 (make-struct-layout "pw")
8013 (lambda (ball port)
8014 (format port "#<a ~A ball owned by ~A>"
8015 (color ball)
8016 (owner ball)))
8017 ball-color))
8018 (define (color ball) (struct-ref (struct-vtable ball) vtable-offset-user))
8019 (define (owner ball) (struct-ref ball 0))
8020
8021 (define red (make-ball-type 'red))
8022 (define green (make-ball-type 'green))
8023
8024 (define (make-ball type owner) (make-struct type 0 owner))
8025
8026 (define ball (make-ball green 'Nisse))
8027 ball @result{} #<a green ball owned by Nisse>
8028 @end lisp
8029 @end deffn
8030
8031 \fstruct-ref
8032 @c snarfed from struct.c:542
8033 @deffn {Scheme Procedure} struct-ref handle pos
8034 @deffnx {Scheme Procedure} struct-set! struct n value
8035 @deffnx {C Function} scm_struct_ref (handle, pos)
8036 Access (or modify) the @var{n}th field of @var{struct}.
8037
8038 If the field is of type 'p', then it can be set to an arbitrary value.
8039
8040 If the field is of type 'u', then it can only be set to a non-negative
8041 integer value small enough to fit in one machine word.
8042 @end deffn
8043
8044 \fstruct-set!
8045 @c snarfed from struct.c:621
8046 @deffn {Scheme Procedure} struct-set! handle pos val
8047 @deffnx {C Function} scm_struct_set_x (handle, pos, val)
8048 Set the slot of the structure @var{handle} with index @var{pos}
8049 to @var{val}. Signal an error if the slot can not be written
8050 to.
8051 @end deffn
8052
8053 \fstruct-vtable
8054 @c snarfed from struct.c:692
8055 @deffn {Scheme Procedure} struct-vtable handle
8056 @deffnx {C Function} scm_struct_vtable (handle)
8057 Return the vtable structure that describes the type of @var{struct}.
8058 @end deffn
8059
8060 \fstruct-vtable-tag
8061 @c snarfed from struct.c:703
8062 @deffn {Scheme Procedure} struct-vtable-tag handle
8063 @deffnx {C Function} scm_struct_vtable_tag (handle)
8064 Return the vtable tag of the structure @var{handle}.
8065 @end deffn
8066
8067 \fstruct-vtable-name
8068 @c snarfed from struct.c:742
8069 @deffn {Scheme Procedure} struct-vtable-name vtable
8070 @deffnx {C Function} scm_struct_vtable_name (vtable)
8071 Return the name of the vtable @var{vtable}.
8072 @end deffn
8073
8074 \fset-struct-vtable-name!
8075 @c snarfed from struct.c:752
8076 @deffn {Scheme Procedure} set-struct-vtable-name! vtable name
8077 @deffnx {C Function} scm_set_struct_vtable_name_x (vtable, name)
8078 Set the name of the vtable @var{vtable} to @var{name}.
8079 @end deffn
8080
8081 \fsymbol?
8082 @c snarfed from symbols.c:156
8083 @deffn {Scheme Procedure} symbol? obj
8084 @deffnx {C Function} scm_symbol_p (obj)
8085 Return @code{#t} if @var{obj} is a symbol, otherwise return
8086 @code{#f}.
8087 @end deffn
8088
8089 \fsymbol-interned?
8090 @c snarfed from symbols.c:166
8091 @deffn {Scheme Procedure} symbol-interned? symbol
8092 @deffnx {C Function} scm_symbol_interned_p (symbol)
8093 Return @code{#t} if @var{symbol} is interned, otherwise return
8094 @code{#f}.
8095 @end deffn
8096
8097 \fmake-symbol
8098 @c snarfed from symbols.c:178
8099 @deffn {Scheme Procedure} make-symbol name
8100 @deffnx {C Function} scm_make_symbol (name)
8101 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.
8102 @end deffn
8103
8104 \fsymbol->string
8105 @c snarfed from symbols.c:210
8106 @deffn {Scheme Procedure} symbol->string s
8107 @deffnx {C Function} scm_symbol_to_string (s)
8108 Return the name of @var{symbol} as a string. If the symbol was
8109 part of an object returned as the value of a literal expression
8110 (section @pxref{Literal expressions,,,r5rs, The Revised^5
8111 Report on Scheme}) or by a call to the @code{read} procedure,
8112 and its name contains alphabetic characters, then the string
8113 returned will contain characters in the implementation's
8114 preferred standard case---some implementations will prefer
8115 upper case, others lower case. If the symbol was returned by
8116 @code{string->symbol}, the case of characters in the string
8117 returned will be the same as the case in the string that was
8118 passed to @code{string->symbol}. It is an error to apply
8119 mutation procedures like @code{string-set!} to strings returned
8120 by this procedure.
8121
8122 The following examples assume that the implementation's
8123 standard case is lower case:
8124
8125 @lisp
8126 (symbol->string 'flying-fish) @result{} "flying-fish"
8127 (symbol->string 'Martin) @result{} "martin"
8128 (symbol->string
8129 (string->symbol "Malvina")) @result{} "Malvina"
8130 @end lisp
8131 @end deffn
8132
8133 \fstring->symbol
8134 @c snarfed from symbols.c:240
8135 @deffn {Scheme Procedure} string->symbol string
8136 @deffnx {C Function} scm_string_to_symbol (string)
8137 Return the symbol whose name is @var{string}. This procedure
8138 can create symbols with names containing special characters or
8139 letters in the non-standard case, but it is usually a bad idea
8140 to create such symbols because in some implementations of
8141 Scheme they cannot be read as themselves. See
8142 @code{symbol->string}.
8143
8144 The following examples assume that the implementation's
8145 standard case is lower case:
8146
8147 @lisp
8148 (eq? 'mISSISSIppi 'mississippi) @result{} #t
8149 (string->symbol "mISSISSIppi") @result{} @r{the symbol with name "mISSISSIppi"}
8150 (eq? 'bitBlt (string->symbol "bitBlt")) @result{} #f
8151 (eq? 'JollyWog
8152 (string->symbol (symbol->string 'JollyWog))) @result{} #t
8153 (string=? "K. Harper, M.D."
8154 (symbol->string
8155 (string->symbol "K. Harper, M.D."))) @result{}#t
8156 @end lisp
8157 @end deffn
8158
8159 \fstring-ci->symbol
8160 @c snarfed from symbols.c:252
8161 @deffn {Scheme Procedure} string-ci->symbol str
8162 @deffnx {C Function} scm_string_ci_to_symbol (str)
8163 Return the symbol whose name is @var{str}. @var{str} is
8164 converted to lowercase before the conversion is done, if Guile
8165 is currently reading symbols case-insensitively.
8166 @end deffn
8167
8168 \fgensym
8169 @c snarfed from symbols.c:269
8170 @deffn {Scheme Procedure} gensym [prefix]
8171 @deffnx {C Function} scm_gensym (prefix)
8172 Create a new symbol with a name constructed from a prefix and
8173 a counter value. The string @var{prefix} can be specified as
8174 an optional argument. Default prefix is @code{ g}. The counter
8175 is increased by 1 at each call. There is no provision for
8176 resetting the counter.
8177 @end deffn
8178
8179 \fsymbol-hash
8180 @c snarfed from symbols.c:295
8181 @deffn {Scheme Procedure} symbol-hash symbol
8182 @deffnx {C Function} scm_symbol_hash (symbol)
8183 Return a hash value for @var{symbol}.
8184 @end deffn
8185
8186 \fsymbol-fref
8187 @c snarfed from symbols.c:305
8188 @deffn {Scheme Procedure} symbol-fref s
8189 @deffnx {C Function} scm_symbol_fref (s)
8190 Return the contents of @var{symbol}'s @dfn{function slot}.
8191 @end deffn
8192
8193 \fsymbol-pref
8194 @c snarfed from symbols.c:316
8195 @deffn {Scheme Procedure} symbol-pref s
8196 @deffnx {C Function} scm_symbol_pref (s)
8197 Return the @dfn{property list} currently associated with @var{symbol}.
8198 @end deffn
8199
8200 \fsymbol-fset!
8201 @c snarfed from symbols.c:327
8202 @deffn {Scheme Procedure} symbol-fset! s val
8203 @deffnx {C Function} scm_symbol_fset_x (s, val)
8204 Change the binding of @var{symbol}'s function slot.
8205 @end deffn
8206
8207 \fsymbol-pset!
8208 @c snarfed from symbols.c:339
8209 @deffn {Scheme Procedure} symbol-pset! s val
8210 @deffnx {C Function} scm_symbol_pset_x (s, val)
8211 Change the binding of @var{symbol}'s property slot.
8212 @end deffn
8213
8214 \fcall-with-new-thread
8215 @c snarfed from threads.c:611
8216 @deffn {Scheme Procedure} call-with-new-thread thunk [handler]
8217 @deffnx {C Function} scm_call_with_new_thread (thunk, handler)
8218 Call @code{thunk} in a new thread and with a new dynamic state,
8219 returning a new thread object representing the thread. The procedure
8220 @var{thunk} is called via @code{with-continuation-barrier}.
8221
8222 When @var{handler} is specified, then @var{thunk} is called from
8223 within a @code{catch} with tag @code{#t} that has @var{handler} as its
8224 handler. This catch is established inside the continuation barrier.
8225
8226 Once @var{thunk} or @var{handler} returns, the return value is made
8227 the @emph{exit value} of the thread and the thread is terminated.
8228 @end deffn
8229
8230 \fyield
8231 @c snarfed from threads.c:722
8232 @deffn {Scheme Procedure} yield
8233 @deffnx {C Function} scm_yield ()
8234 Move the calling thread to the end of the scheduling queue.
8235 @end deffn
8236
8237 \fjoin-thread
8238 @c snarfed from threads.c:732
8239 @deffn {Scheme Procedure} join-thread thread
8240 @deffnx {C Function} scm_join_thread (thread)
8241 Suspend execution of the calling thread until the target @var{thread} terminates, unless the target @var{thread} has already terminated.
8242 @end deffn
8243
8244 \fmake-mutex
8245 @c snarfed from threads.c:828
8246 @deffn {Scheme Procedure} make-mutex
8247 @deffnx {C Function} scm_make_mutex ()
8248 Create a new mutex.
8249 @end deffn
8250
8251 \fmake-recursive-mutex
8252 @c snarfed from threads.c:837
8253 @deffn {Scheme Procedure} make-recursive-mutex
8254 @deffnx {C Function} scm_make_recursive_mutex ()
8255 Create a new recursive mutex.
8256 @end deffn
8257
8258 \flock-mutex
8259 @c snarfed from threads.c:883
8260 @deffn {Scheme Procedure} lock-mutex mx
8261 @deffnx {C Function} scm_lock_mutex (mx)
8262 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}.
8263 @end deffn
8264
8265 \ftry-mutex
8266 @c snarfed from threads.c:931
8267 @deffn {Scheme Procedure} try-mutex mutex
8268 @deffnx {C Function} scm_try_mutex (mutex)
8269 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}.
8270 @end deffn
8271
8272 \funlock-mutex
8273 @c snarfed from threads.c:976
8274 @deffn {Scheme Procedure} unlock-mutex mx
8275 @deffnx {C Function} scm_unlock_mutex (mx)
8276 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.
8277 @end deffn
8278
8279 \fmake-condition-variable
8280 @c snarfed from threads.c:1052
8281 @deffn {Scheme Procedure} make-condition-variable
8282 @deffnx {C Function} scm_make_condition_variable ()
8283 Make a new condition variable.
8284 @end deffn
8285
8286 \fwait-condition-variable
8287 @c snarfed from threads.c:1120
8288 @deffn {Scheme Procedure} wait-condition-variable cv mx [t]
8289 @deffnx {C Function} scm_timed_wait_condition_variable (cv, mx, t)
8290 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.
8291 @end deffn
8292
8293 \fsignal-condition-variable
8294 @c snarfed from threads.c:1157
8295 @deffn {Scheme Procedure} signal-condition-variable cv
8296 @deffnx {C Function} scm_signal_condition_variable (cv)
8297 Wake up one thread that is waiting for @var{cv}
8298 @end deffn
8299
8300 \fbroadcast-condition-variable
8301 @c snarfed from threads.c:1177
8302 @deffn {Scheme Procedure} broadcast-condition-variable cv
8303 @deffnx {C Function} scm_broadcast_condition_variable (cv)
8304 Wake up all threads that are waiting for @var{cv}.
8305 @end deffn
8306
8307 \fcurrent-thread
8308 @c snarfed from threads.c:1354
8309 @deffn {Scheme Procedure} current-thread
8310 @deffnx {C Function} scm_current_thread ()
8311 Return the thread that called this function.
8312 @end deffn
8313
8314 \fall-threads
8315 @c snarfed from threads.c:1372
8316 @deffn {Scheme Procedure} all-threads
8317 @deffnx {C Function} scm_all_threads ()
8318 Return a list of all threads.
8319 @end deffn
8320
8321 \fthread-exited?
8322 @c snarfed from threads.c:1398
8323 @deffn {Scheme Procedure} thread-exited? thread
8324 @deffnx {C Function} scm_thread_exited_p (thread)
8325 Return @code{#t} iff @var{thread} has exited.
8326
8327 @end deffn
8328
8329 \fcatch
8330 @c snarfed from throw.c:512
8331 @deffn {Scheme Procedure} catch key thunk handler
8332 @deffnx {C Function} scm_catch (key, thunk, handler)
8333 Invoke @var{thunk} in the dynamic context of @var{handler} for
8334 exceptions matching @var{key}. If thunk throws to the symbol
8335 @var{key}, then @var{handler} is invoked this way:
8336 @lisp
8337 (handler key args ...)
8338 @end lisp
8339
8340 @var{key} is a symbol or @code{#t}.
8341
8342 @var{thunk} takes no arguments. If @var{thunk} returns
8343 normally, that is the return value of @code{catch}.
8344
8345 Handler is invoked outside the scope of its own @code{catch}.
8346 If @var{handler} again throws to the same key, a new handler
8347 from further up the call chain is invoked.
8348
8349 If the key is @code{#t}, then a throw to @emph{any} symbol will
8350 match this call to @code{catch}.
8351 @end deffn
8352
8353 \flazy-catch
8354 @c snarfed from throw.c:540
8355 @deffn {Scheme Procedure} lazy-catch key thunk handler
8356 @deffnx {C Function} scm_lazy_catch (key, thunk, handler)
8357 This behaves exactly like @code{catch}, except that it does
8358 not unwind the stack before invoking @var{handler}.
8359 The @var{handler} procedure is not allowed to return:
8360 it must throw to another catch, or otherwise exit non-locally.
8361 @end deffn
8362
8363 \fthrow
8364 @c snarfed from throw.c:573
8365 @deffn {Scheme Procedure} throw key . args
8366 @deffnx {C Function} scm_throw (key, args)
8367 Invoke the catch form matching @var{key}, passing @var{args} to the
8368 @var{handler}.
8369
8370 @var{key} is a symbol. It will match catches of the same symbol or of
8371 @code{#t}.
8372
8373 If there is no handler at all, Guile prints an error and then exits.
8374 @end deffn
8375
8376 \fvalues
8377 @c snarfed from values.c:53
8378 @deffn {Scheme Procedure} values . args
8379 @deffnx {C Function} scm_values (args)
8380 Delivers all of its arguments to its continuation. Except for
8381 continuations created by the @code{call-with-values} procedure,
8382 all continuations take exactly one value. The effect of
8383 passing no value or more than one value to continuations that
8384 were not created by @code{call-with-values} is unspecified.
8385 @end deffn
8386
8387 \fmake-variable
8388 @c snarfed from variable.c:52
8389 @deffn {Scheme Procedure} make-variable init
8390 @deffnx {C Function} scm_make_variable (init)
8391 Return a variable initialized to value @var{init}.
8392 @end deffn
8393
8394 \fmake-undefined-variable
8395 @c snarfed from variable.c:62
8396 @deffn {Scheme Procedure} make-undefined-variable
8397 @deffnx {C Function} scm_make_undefined_variable ()
8398 Return a variable that is initially unbound.
8399 @end deffn
8400
8401 \fvariable?
8402 @c snarfed from variable.c:73
8403 @deffn {Scheme Procedure} variable? obj
8404 @deffnx {C Function} scm_variable_p (obj)
8405 Return @code{#t} iff @var{obj} is a variable object, else
8406 return @code{#f}.
8407 @end deffn
8408
8409 \fvariable-ref
8410 @c snarfed from variable.c:85
8411 @deffn {Scheme Procedure} variable-ref var
8412 @deffnx {C Function} scm_variable_ref (var)
8413 Dereference @var{var} and return its value.
8414 @var{var} must be a variable object; see @code{make-variable}
8415 and @code{make-undefined-variable}.
8416 @end deffn
8417
8418 \fvariable-set!
8419 @c snarfed from variable.c:101
8420 @deffn {Scheme Procedure} variable-set! var val
8421 @deffnx {C Function} scm_variable_set_x (var, val)
8422 Set the value of the variable @var{var} to @var{val}.
8423 @var{var} must be a variable object, @var{val} can be any
8424 value. Return an unspecified value.
8425 @end deffn
8426
8427 \fvariable-bound?
8428 @c snarfed from variable.c:113
8429 @deffn {Scheme Procedure} variable-bound? var
8430 @deffnx {C Function} scm_variable_bound_p (var)
8431 Return @code{#t} iff @var{var} is bound to a value.
8432 Throws an error if @var{var} is not a variable object.
8433 @end deffn
8434
8435 \fvector?
8436 @c snarfed from vectors.c:91
8437 @deffn {Scheme Procedure} vector? obj
8438 @deffnx {C Function} scm_vector_p (obj)
8439 Return @code{#t} if @var{obj} is a vector, otherwise return
8440 @code{#f}.
8441 @end deffn
8442
8443 \flist->vector
8444 @c snarfed from vectors.c:123
8445 @deffn {Scheme Procedure} list->vector
8446 implemented by the C function "scm_vector"
8447 @end deffn
8448
8449 \fvector
8450 @c snarfed from vectors.c:140
8451 @deffn {Scheme Procedure} vector . l
8452 @deffnx {Scheme Procedure} list->vector l
8453 @deffnx {C Function} scm_vector (l)
8454 Return a newly allocated vector composed of the
8455 given arguments. Analogous to @code{list}.
8456
8457 @lisp
8458 (vector 'a 'b 'c) @result{} #(a b c)
8459 @end lisp
8460 @end deffn
8461
8462 \fmake-vector
8463 @c snarfed from vectors.c:276
8464 @deffn {Scheme Procedure} make-vector k [fill]
8465 @deffnx {C Function} scm_make_vector (k, fill)
8466 Return a newly allocated vector of @var{k} elements. If a
8467 second argument is given, then each position is initialized to
8468 @var{fill}. Otherwise the initial contents of each position is
8469 unspecified.
8470 @end deffn
8471
8472 \fvector-copy
8473 @c snarfed from vectors.c:318
8474 @deffn {Scheme Procedure} vector-copy vec
8475 @deffnx {C Function} scm_vector_copy (vec)
8476 Return a copy of @var{vec}.
8477 @end deffn
8478
8479 \fvector->list
8480 @c snarfed from vectors.c:389
8481 @deffn {Scheme Procedure} vector->list v
8482 @deffnx {C Function} scm_vector_to_list (v)
8483 Return a newly allocated list composed of the elements of @var{v}.
8484
8485 @lisp
8486 (vector->list '#(dah dah didah)) @result{} (dah dah didah)
8487 (list->vector '(dididit dah)) @result{} #(dididit dah)
8488 @end lisp
8489 @end deffn
8490
8491 \fvector-fill!
8492 @c snarfed from vectors.c:413
8493 @deffn {Scheme Procedure} vector-fill! v fill
8494 @deffnx {C Function} scm_vector_fill_x (v, fill)
8495 Store @var{fill} in every position of @var{vector}. The value
8496 returned by @code{vector-fill!} is unspecified.
8497 @end deffn
8498
8499 \fvector-move-left!
8500 @c snarfed from vectors.c:450
8501 @deffn {Scheme Procedure} vector-move-left! vec1 start1 end1 vec2 start2
8502 @deffnx {C Function} scm_vector_move_left_x (vec1, start1, end1, vec2, start2)
8503 Copy elements from @var{vec1}, positions @var{start1} to @var{end1},
8504 to @var{vec2} starting at position @var{start2}. @var{start1} and
8505 @var{start2} are inclusive indices; @var{end1} is exclusive.
8506
8507 @code{vector-move-left!} copies elements in leftmost order.
8508 Therefore, in the case where @var{vec1} and @var{vec2} refer to the
8509 same vector, @code{vector-move-left!} is usually appropriate when
8510 @var{start1} is greater than @var{start2}.
8511 @end deffn
8512
8513 \fvector-move-right!
8514 @c snarfed from vectors.c:488
8515 @deffn {Scheme Procedure} vector-move-right! vec1 start1 end1 vec2 start2
8516 @deffnx {C Function} scm_vector_move_right_x (vec1, start1, end1, vec2, start2)
8517 Copy elements from @var{vec1}, positions @var{start1} to @var{end1},
8518 to @var{vec2} starting at position @var{start2}. @var{start1} and
8519 @var{start2} are inclusive indices; @var{end1} is exclusive.
8520
8521 @code{vector-move-right!} copies elements in rightmost order.
8522 Therefore, in the case where @var{vec1} and @var{vec2} refer to the
8523 same vector, @code{vector-move-right!} is usually appropriate when
8524 @var{start1} is less than @var{start2}.
8525 @end deffn
8526
8527 \fgeneralized-vector?
8528 @c snarfed from vectors.c:537
8529 @deffn {Scheme Procedure} generalized-vector? obj
8530 @deffnx {C Function} scm_generalized_vector_p (obj)
8531 Return @code{#t} if @var{obj} is a vector, string,
8532 bitvector, or uniform numeric vector.
8533 @end deffn
8534
8535 \fgeneralized-vector-length
8536 @c snarfed from vectors.c:569
8537 @deffn {Scheme Procedure} generalized-vector-length v
8538 @deffnx {C Function} scm_generalized_vector_length (v)
8539 Return the length of the generalized vector @var{v}.
8540 @end deffn
8541
8542 \fgeneralized-vector-ref
8543 @c snarfed from vectors.c:594
8544 @deffn {Scheme Procedure} generalized-vector-ref v idx
8545 @deffnx {C Function} scm_generalized_vector_ref (v, idx)
8546 Return the element at index @var{idx} of the
8547 generalized vector @var{v}.
8548 @end deffn
8549
8550 \fgeneralized-vector-set!
8551 @c snarfed from vectors.c:619
8552 @deffn {Scheme Procedure} generalized-vector-set! v idx val
8553 @deffnx {C Function} scm_generalized_vector_set_x (v, idx, val)
8554 Set the element at index @var{idx} of the
8555 generalized vector @var{v} to @var{val}.
8556 @end deffn
8557
8558 \fgeneralized-vector->list
8559 @c snarfed from vectors.c:630
8560 @deffn {Scheme Procedure} generalized-vector->list v
8561 @deffnx {C Function} scm_generalized_vector_to_list (v)
8562 Return a new list whose elements are the elements of the
8563 generalized vector @var{v}.
8564 @end deffn
8565
8566 \fmajor-version
8567 @c snarfed from version.c:35
8568 @deffn {Scheme Procedure} major-version
8569 @deffnx {C Function} scm_major_version ()
8570 Return a string containing Guile's major version number.
8571 E.g., the 1 in "1.6.5".
8572 @end deffn
8573
8574 \fminor-version
8575 @c snarfed from version.c:48
8576 @deffn {Scheme Procedure} minor-version
8577 @deffnx {C Function} scm_minor_version ()
8578 Return a string containing Guile's minor version number.
8579 E.g., the 6 in "1.6.5".
8580 @end deffn
8581
8582 \fmicro-version
8583 @c snarfed from version.c:61
8584 @deffn {Scheme Procedure} micro-version
8585 @deffnx {C Function} scm_micro_version ()
8586 Return a string containing Guile's micro version number.
8587 E.g., the 5 in "1.6.5".
8588 @end deffn
8589
8590 \fversion
8591 @c snarfed from version.c:83
8592 @deffn {Scheme Procedure} version
8593 @deffnx {Scheme Procedure} major-version
8594 @deffnx {Scheme Procedure} minor-version
8595 @deffnx {Scheme Procedure} micro-version
8596 @deffnx {C Function} scm_version ()
8597 Return a string describing Guile's version number, or its major, minor
8598 or micro version number, respectively.
8599
8600 @lisp
8601 (version) @result{} "1.6.0"
8602 (major-version) @result{} "1"
8603 (minor-version) @result{} "6"
8604 (micro-version) @result{} "0"
8605 @end lisp
8606 @end deffn
8607
8608 \feffective-version
8609 @c snarfed from version.c:113
8610 @deffn {Scheme Procedure} effective-version
8611 @deffnx {C Function} scm_effective_version ()
8612 Return a string describing Guile's effective version number.
8613 @lisp
8614 (version) @result{} "1.6.0"
8615 (effective-version) @result{} "1.6"
8616 (major-version) @result{} "1"
8617 (minor-version) @result{} "6"
8618 (micro-version) @result{} "0"
8619 @end lisp
8620 @end deffn
8621
8622 \fmake-soft-port
8623 @c snarfed from vports.c:185
8624 @deffn {Scheme Procedure} make-soft-port pv modes
8625 @deffnx {C Function} scm_make_soft_port (pv, modes)
8626 Return a port capable of receiving or delivering characters as
8627 specified by the @var{modes} string (@pxref{File Ports,
8628 open-file}). @var{pv} must be a vector of length 5 or 6. Its
8629 components are as follows:
8630
8631 @enumerate 0
8632 @item
8633 procedure accepting one character for output
8634 @item
8635 procedure accepting a string for output
8636 @item
8637 thunk for flushing output
8638 @item
8639 thunk for getting one character
8640 @item
8641 thunk for closing port (not by garbage collection)
8642 @item
8643 (if present and not @code{#f}) thunk for computing the number of
8644 characters that can be read from the port without blocking.
8645 @end enumerate
8646
8647 For an output-only port only elements 0, 1, 2, and 4 need be
8648 procedures. For an input-only port only elements 3 and 4 need
8649 be procedures. Thunks 2 and 4 can instead be @code{#f} if
8650 there is no useful operation for them to perform.
8651
8652 If thunk 3 returns @code{#f} or an @code{eof-object}
8653 (@pxref{Input, eof-object?, ,r5rs, The Revised^5 Report on
8654 Scheme}) it indicates that the port has reached end-of-file.
8655 For example:
8656
8657 @lisp
8658 (define stdout (current-output-port))
8659 (define p (make-soft-port
8660 (vector
8661 (lambda (c) (write c stdout))
8662 (lambda (s) (display s stdout))
8663 (lambda () (display "." stdout))
8664 (lambda () (char-upcase (read-char)))
8665 (lambda () (display "@@" stdout)))
8666 "rw"))
8667
8668 (write p p) @result{} #<input-output: soft 8081e20>
8669 @end lisp
8670 @end deffn
8671
8672 \fmake-weak-vector
8673 @c snarfed from weaks.c:74
8674 @deffn {Scheme Procedure} make-weak-vector size [fill]
8675 @deffnx {C Function} scm_make_weak_vector (size, fill)
8676 Return a weak vector with @var{size} elements. If the optional
8677 argument @var{fill} is given, all entries in the vector will be
8678 set to @var{fill}. The default value for @var{fill} is the
8679 empty list.
8680 @end deffn
8681
8682 \flist->weak-vector
8683 @c snarfed from weaks.c:82
8684 @deffn {Scheme Procedure} list->weak-vector
8685 implemented by the C function "scm_weak_vector"
8686 @end deffn
8687
8688 \fweak-vector
8689 @c snarfed from weaks.c:90
8690 @deffn {Scheme Procedure} weak-vector . l
8691 @deffnx {Scheme Procedure} list->weak-vector l
8692 @deffnx {C Function} scm_weak_vector (l)
8693 Construct a weak vector from a list: @code{weak-vector} uses
8694 the list of its arguments while @code{list->weak-vector} uses
8695 its only argument @var{l} (a list) to construct a weak vector
8696 the same way @code{list->vector} would.
8697 @end deffn
8698
8699 \fweak-vector?
8700 @c snarfed from weaks.c:120
8701 @deffn {Scheme Procedure} weak-vector? obj
8702 @deffnx {C Function} scm_weak_vector_p (obj)
8703 Return @code{#t} if @var{obj} is a weak vector. Note that all
8704 weak hashes are also weak vectors.
8705 @end deffn
8706
8707 \fmake-weak-key-alist-vector
8708 @c snarfed from weaks.c:138
8709 @deffn {Scheme Procedure} make-weak-key-alist-vector [size]
8710 @deffnx {Scheme Procedure} make-weak-value-alist-vector size
8711 @deffnx {Scheme Procedure} make-doubly-weak-alist-vector size
8712 @deffnx {C Function} scm_make_weak_key_alist_vector (size)
8713 Return a weak hash table with @var{size} buckets. As with any
8714 hash table, choosing a good size for the table requires some
8715 caution.
8716
8717 You can modify weak hash tables in exactly the same way you
8718 would modify regular hash tables. (@pxref{Hash Tables})
8719 @end deffn
8720
8721 \fmake-weak-value-alist-vector
8722 @c snarfed from weaks.c:150
8723 @deffn {Scheme Procedure} make-weak-value-alist-vector [size]
8724 @deffnx {C Function} scm_make_weak_value_alist_vector (size)
8725 Return a hash table with weak values with @var{size} buckets.
8726 (@pxref{Hash Tables})
8727 @end deffn
8728
8729 \fmake-doubly-weak-alist-vector
8730 @c snarfed from weaks.c:162
8731 @deffn {Scheme Procedure} make-doubly-weak-alist-vector size
8732 @deffnx {C Function} scm_make_doubly_weak_alist_vector (size)
8733 Return a hash table with weak keys and values with @var{size}
8734 buckets. (@pxref{Hash Tables})
8735 @end deffn
8736
8737 \fweak-key-alist-vector?
8738 @c snarfed from weaks.c:177
8739 @deffn {Scheme Procedure} weak-key-alist-vector? obj
8740 @deffnx {Scheme Procedure} weak-value-alist-vector? obj
8741 @deffnx {Scheme Procedure} doubly-weak-alist-vector? obj
8742 @deffnx {C Function} scm_weak_key_alist_vector_p (obj)
8743 Return @code{#t} if @var{obj} is the specified weak hash
8744 table. Note that a doubly weak hash table is neither a weak key
8745 nor a weak value hash table.
8746 @end deffn
8747
8748 \fweak-value-alist-vector?
8749 @c snarfed from weaks.c:187
8750 @deffn {Scheme Procedure} weak-value-alist-vector? obj
8751 @deffnx {C Function} scm_weak_value_alist_vector_p (obj)
8752 Return @code{#t} if @var{obj} is a weak value hash table.
8753 @end deffn
8754
8755 \fdoubly-weak-alist-vector?
8756 @c snarfed from weaks.c:197
8757 @deffn {Scheme Procedure} doubly-weak-alist-vector? obj
8758 @deffnx {C Function} scm_doubly_weak_alist_vector_p (obj)
8759 Return @code{#t} if @var{obj} is a doubly weak hash table.
8760 @end deffn
8761
8762 \farray-fill!
8763 @c snarfed from ramap.c:352
8764 @deffn {Scheme Procedure} array-fill! ra fill
8765 @deffnx {C Function} scm_array_fill_x (ra, fill)
8766 Store @var{fill} in every element of @var{array}. The value returned
8767 is unspecified.
8768 @end deffn
8769
8770 \farray-copy-in-order!
8771 @c snarfed from ramap.c:399
8772 @deffn {Scheme Procedure} array-copy-in-order!
8773 implemented by the C function "scm_array_copy_x"
8774 @end deffn
8775
8776 \farray-copy!
8777 @c snarfed from ramap.c:408
8778 @deffn {Scheme Procedure} array-copy! src dst
8779 @deffnx {Scheme Procedure} array-copy-in-order! src dst
8780 @deffnx {C Function} scm_array_copy_x (src, dst)
8781 Copy every element from vector or array @var{source} to the
8782 corresponding element of @var{destination}. @var{destination} must have
8783 the same rank as @var{source}, and be at least as large in each
8784 dimension. The order is unspecified.
8785 @end deffn
8786
8787 \farray-map-in-order!
8788 @c snarfed from ramap.c:798
8789 @deffn {Scheme Procedure} array-map-in-order!
8790 implemented by the C function "scm_array_map_x"
8791 @end deffn
8792
8793 \farray-map!
8794 @c snarfed from ramap.c:809
8795 @deffn {Scheme Procedure} array-map! ra0 proc . lra
8796 @deffnx {Scheme Procedure} array-map-in-order! ra0 proc . lra
8797 @deffnx {C Function} scm_array_map_x (ra0, proc, lra)
8798 @var{array1}, @dots{} must have the same number of dimensions as
8799 @var{array0} and have a range for each index which includes the range
8800 for the corresponding index in @var{array0}. @var{proc} is applied to
8801 each tuple of elements of @var{array1} @dots{} and the result is stored
8802 as the corresponding element in @var{array0}. The value returned is
8803 unspecified. The order of application is unspecified.
8804 @end deffn
8805
8806 \farray-for-each
8807 @c snarfed from ramap.c:950
8808 @deffn {Scheme Procedure} array-for-each proc ra0 . lra
8809 @deffnx {C Function} scm_array_for_each (proc, ra0, lra)
8810 Apply @var{proc} to each tuple of elements of @var{array0} @dots{}
8811 in row-major order. The value returned is unspecified.
8812 @end deffn
8813
8814 \farray-index-map!
8815 @c snarfed from ramap.c:978
8816 @deffn {Scheme Procedure} array-index-map! ra proc
8817 @deffnx {C Function} scm_array_index_map_x (ra, proc)
8818 Apply @var{proc} to the indices of each element of @var{array} in
8819 turn, storing the result in the corresponding element. The value
8820 returned and the order of application are unspecified.
8821
8822 One can implement @var{array-indexes} as
8823 @lisp
8824 (define (array-indexes array)
8825 (let ((ra (apply make-array #f (array-shape array))))
8826 (array-index-map! ra (lambda x x))
8827 ra))
8828 @end lisp
8829 Another example:
8830 @lisp
8831 (define (apl:index-generator n)
8832 (let ((v (make-uniform-vector n 1)))
8833 (array-index-map! v (lambda (i) i))
8834 v))
8835 @end lisp
8836 @end deffn
8837
8838 \farray?
8839 @c snarfed from unif.c:501
8840 @deffn {Scheme Procedure} array? obj [prot]
8841 @deffnx {C Function} scm_array_p (obj, prot)
8842 Return @code{#t} if the @var{obj} is an array, and @code{#f} if
8843 not.
8844 @end deffn
8845
8846 \ftyped-array?
8847 @c snarfed from unif.c:548
8848 @deffn {Scheme Procedure} typed-array? obj type
8849 @deffnx {C Function} scm_typed_array_p (obj, type)
8850 Return @code{#t} if the @var{obj} is an array of type
8851 @var{type}, and @code{#f} if not.
8852 @end deffn
8853
8854 \farray-rank
8855 @c snarfed from unif.c:569
8856 @deffn {Scheme Procedure} array-rank array
8857 @deffnx {C Function} scm_array_rank (array)
8858 Return the number of dimensions of the array @var{array.}
8859
8860 @end deffn
8861
8862 \farray-dimensions
8863 @c snarfed from unif.c:583
8864 @deffn {Scheme Procedure} array-dimensions ra
8865 @deffnx {C Function} scm_array_dimensions (ra)
8866 @code{array-dimensions} is similar to @code{array-shape} but replaces
8867 elements with a @code{0} minimum with one greater than the maximum. So:
8868 @lisp
8869 (array-dimensions (make-array 'foo '(-1 3) 5)) @result{} ((-1 3) 5)
8870 @end lisp
8871 @end deffn
8872
8873 \fshared-array-root
8874 @c snarfed from unif.c:611
8875 @deffn {Scheme Procedure} shared-array-root ra
8876 @deffnx {C Function} scm_shared_array_root (ra)
8877 Return the root vector of a shared array.
8878 @end deffn
8879
8880 \fshared-array-offset
8881 @c snarfed from unif.c:625
8882 @deffn {Scheme Procedure} shared-array-offset ra
8883 @deffnx {C Function} scm_shared_array_offset (ra)
8884 Return the root vector index of the first element in the array.
8885 @end deffn
8886
8887 \fshared-array-increments
8888 @c snarfed from unif.c:641
8889 @deffn {Scheme Procedure} shared-array-increments ra
8890 @deffnx {C Function} scm_shared_array_increments (ra)
8891 For each dimension, return the distance between elements in the root vector.
8892 @end deffn
8893
8894 \fmake-typed-array
8895 @c snarfed from unif.c:740
8896 @deffn {Scheme Procedure} make-typed-array type fill . bounds
8897 @deffnx {C Function} scm_make_typed_array (type, fill, bounds)
8898 Create and return an array of type @var{type}.
8899 @end deffn
8900
8901 \fmake-array
8902 @c snarfed from unif.c:775
8903 @deffn {Scheme Procedure} make-array fill . bounds
8904 @deffnx {C Function} scm_make_array (fill, bounds)
8905 Create and return an array.
8906 @end deffn
8907
8908 \fdimensions->uniform-array
8909 @c snarfed from unif.c:790
8910 @deffn {Scheme Procedure} dimensions->uniform-array dims prot [fill]
8911 @deffnx {Scheme Procedure} make-uniform-vector length prototype [fill]
8912 @deffnx {C Function} scm_dimensions_to_uniform_array (dims, prot, fill)
8913 Create and return a uniform array or vector of type
8914 corresponding to @var{prototype} with dimensions @var{dims} or
8915 length @var{length}. If @var{fill} is supplied, it's used to
8916 fill the array, otherwise @var{prototype} is used.
8917 @end deffn
8918
8919 \fmake-shared-array
8920 @c snarfed from unif.c:843
8921 @deffn {Scheme Procedure} make-shared-array oldra mapfunc . dims
8922 @deffnx {C Function} scm_make_shared_array (oldra, mapfunc, dims)
8923 @code{make-shared-array} can be used to create shared subarrays of other
8924 arrays. The @var{mapper} is a function that translates coordinates in
8925 the new array into coordinates in the old array. A @var{mapper} must be
8926 linear, and its range must stay within the bounds of the old array, but
8927 it can be otherwise arbitrary. A simple example:
8928 @lisp
8929 (define fred (make-array #f 8 8))
8930 (define freds-diagonal
8931 (make-shared-array fred (lambda (i) (list i i)) 8))
8932 (array-set! freds-diagonal 'foo 3)
8933 (array-ref fred 3 3) @result{} foo
8934 (define freds-center
8935 (make-shared-array fred (lambda (i j) (list (+ 3 i) (+ 3 j))) 2 2))
8936 (array-ref freds-center 0 0) @result{} foo
8937 @end lisp
8938 @end deffn
8939
8940 \ftranspose-array
8941 @c snarfed from unif.c:961
8942 @deffn {Scheme Procedure} transpose-array ra . args
8943 @deffnx {C Function} scm_transpose_array (ra, args)
8944 Return an array sharing contents with @var{array}, but with
8945 dimensions arranged in a different order. There must be one
8946 @var{dim} argument for each dimension of @var{array}.
8947 @var{dim0}, @var{dim1}, @dots{} should be integers between 0
8948 and the rank of the array to be returned. Each integer in that
8949 range must appear at least once in the argument list.
8950
8951 The values of @var{dim0}, @var{dim1}, @dots{} correspond to
8952 dimensions in the array to be returned, their positions in the
8953 argument list to dimensions of @var{array}. Several @var{dim}s
8954 may have the same value, in which case the returned array will
8955 have smaller rank than @var{array}.
8956
8957 @lisp
8958 (transpose-array '#2((a b) (c d)) 1 0) @result{} #2((a c) (b d))
8959 (transpose-array '#2((a b) (c d)) 0 0) @result{} #1(a d)
8960 (transpose-array '#3(((a b c) (d e f)) ((1 2 3) (4 5 6))) 1 1 0) @result{}
8961 #2((a 4) (b 5) (c 6))
8962 @end lisp
8963 @end deffn
8964
8965 \fenclose-array
8966 @c snarfed from unif.c:1059
8967 @deffn {Scheme Procedure} enclose-array ra . axes
8968 @deffnx {C Function} scm_enclose_array (ra, axes)
8969 @var{dim0}, @var{dim1} @dots{} should be nonnegative integers less than
8970 the rank of @var{array}. @var{enclose-array} returns an array
8971 resembling an array of shared arrays. The dimensions of each shared
8972 array are the same as the @var{dim}th dimensions of the original array,
8973 the dimensions of the outer array are the same as those of the original
8974 array that did not match a @var{dim}.
8975
8976 An enclosed array is not a general Scheme array. Its elements may not
8977 be set using @code{array-set!}. Two references to the same element of
8978 an enclosed array will be @code{equal?} but will not in general be
8979 @code{eq?}. The value returned by @var{array-prototype} when given an
8980 enclosed array is unspecified.
8981
8982 examples:
8983 @lisp
8984 (enclose-array '#3(((a b c) (d e f)) ((1 2 3) (4 5 6))) 1) @result{}
8985 #<enclosed-array (#1(a d) #1(b e) #1(c f)) (#1(1 4) #1(2 5) #1(3 6))>
8986
8987 (enclose-array '#3(((a b c) (d e f)) ((1 2 3) (4 5 6))) 1 0) @result{}
8988 #<enclosed-array #2((a 1) (d 4)) #2((b 2) (e 5)) #2((c 3) (f 6))>
8989 @end lisp
8990 @end deffn
8991
8992 \farray-in-bounds?
8993 @c snarfed from unif.c:1132
8994 @deffn {Scheme Procedure} array-in-bounds? v . args
8995 @deffnx {C Function} scm_array_in_bounds_p (v, args)
8996 Return @code{#t} if its arguments would be acceptable to
8997 @code{array-ref}.
8998 @end deffn
8999
9000 \farray-ref
9001 @c snarfed from unif.c:1209
9002 @deffn {Scheme Procedure} array-ref v . args
9003 @deffnx {C Function} scm_array_ref (v, args)
9004 Return the element at the @code{(index1, index2)} element in
9005 @var{array}.
9006 @end deffn
9007
9008 \farray-set!
9009 @c snarfed from unif.c:1226
9010 @deffn {Scheme Procedure} array-set! v obj . args
9011 @deffnx {C Function} scm_array_set_x (v, obj, args)
9012 Set the element at the @code{(index1, index2)} element in @var{array} to
9013 @var{new-value}. The value returned by array-set! is unspecified.
9014 @end deffn
9015
9016 \farray-contents
9017 @c snarfed from unif.c:1252
9018 @deffn {Scheme Procedure} array-contents ra [strict]
9019 @deffnx {C Function} scm_array_contents (ra, strict)
9020 If @var{array} may be @dfn{unrolled} into a one dimensional shared array
9021 without changing their order (last subscript changing fastest), then
9022 @code{array-contents} returns that shared array, otherwise it returns
9023 @code{#f}. All arrays made by @var{make-array} and
9024 @var{make-uniform-array} may be unrolled, some arrays made by
9025 @var{make-shared-array} may not be.
9026
9027 If the optional argument @var{strict} is provided, a shared array will
9028 be returned only if its elements are stored internally contiguous in
9029 memory.
9030 @end deffn
9031
9032 \funiform-array-read!
9033 @c snarfed from unif.c:1352
9034 @deffn {Scheme Procedure} uniform-array-read! ura [port_or_fd [start [end]]]
9035 @deffnx {Scheme Procedure} uniform-vector-read! uve [port-or-fdes] [start] [end]
9036 @deffnx {C Function} scm_uniform_array_read_x (ura, port_or_fd, start, end)
9037 Attempt to read all elements of @var{ura}, in lexicographic order, as
9038 binary objects from @var{port-or-fdes}.
9039 If an end of file is encountered,
9040 the objects up to that point are put into @var{ura}
9041 (starting at the beginning) and the remainder of the array is
9042 unchanged.
9043
9044 The optional arguments @var{start} and @var{end} allow
9045 a specified region of a vector (or linearized array) to be read,
9046 leaving the remainder of the vector unchanged.
9047
9048 @code{uniform-array-read!} returns the number of objects read.
9049 @var{port-or-fdes} may be omitted, in which case it defaults to the value
9050 returned by @code{(current-input-port)}.
9051 @end deffn
9052
9053 \funiform-array-write
9054 @c snarfed from unif.c:1406
9055 @deffn {Scheme Procedure} uniform-array-write ura [port_or_fd [start [end]]]
9056 @deffnx {C Function} scm_uniform_array_write (ura, port_or_fd, start, end)
9057 Writes all elements of @var{ura} as binary objects to
9058 @var{port-or-fdes}.
9059
9060 The optional arguments @var{start}
9061 and @var{end} allow
9062 a specified region of a vector (or linearized array) to be written.
9063
9064 The number of objects actually written is returned.
9065 @var{port-or-fdes} may be
9066 omitted, in which case it defaults to the value returned by
9067 @code{(current-output-port)}.
9068 @end deffn
9069
9070 \fbitvector?
9071 @c snarfed from unif.c:1518
9072 @deffn {Scheme Procedure} bitvector? obj
9073 @deffnx {C Function} scm_bitvector_p (obj)
9074 Return @code{#t} when @var{obj} is a bitvector, else
9075 return @code{#f}.
9076 @end deffn
9077
9078 \fmake-bitvector
9079 @c snarfed from unif.c:1545
9080 @deffn {Scheme Procedure} make-bitvector len [fill]
9081 @deffnx {C Function} scm_make_bitvector (len, fill)
9082 Create a new bitvector of length @var{len} and
9083 optionally initialize all elements to @var{fill}.
9084 @end deffn
9085
9086 \fbitvector
9087 @c snarfed from unif.c:1554
9088 @deffn {Scheme Procedure} bitvector . bits
9089 @deffnx {C Function} scm_bitvector (bits)
9090 Create a new bitvector with the arguments as elements.
9091 @end deffn
9092
9093 \fbitvector-length
9094 @c snarfed from unif.c:1570
9095 @deffn {Scheme Procedure} bitvector-length vec
9096 @deffnx {C Function} scm_bitvector_length (vec)
9097 Return the length of the bitvector @var{vec}.
9098 @end deffn
9099
9100 \fbitvector-ref
9101 @c snarfed from unif.c:1661
9102 @deffn {Scheme Procedure} bitvector-ref vec idx
9103 @deffnx {C Function} scm_bitvector_ref (vec, idx)
9104 Return the element at index @var{idx} of the bitvector
9105 @var{vec}.
9106 @end deffn
9107
9108 \fbitvector-set!
9109 @c snarfed from unif.c:1704
9110 @deffn {Scheme Procedure} bitvector-set! vec idx val
9111 @deffnx {C Function} scm_bitvector_set_x (vec, idx, val)
9112 Set the element at index @var{idx} of the bitvector
9113 @var{vec} when @var{val} is true, else clear it.
9114 @end deffn
9115
9116 \fbitvector-fill!
9117 @c snarfed from unif.c:1715
9118 @deffn {Scheme Procedure} bitvector-fill! vec val
9119 @deffnx {C Function} scm_bitvector_fill_x (vec, val)
9120 Set all elements of the bitvector
9121 @var{vec} when @var{val} is true, else clear them.
9122 @end deffn
9123
9124 \flist->bitvector
9125 @c snarfed from unif.c:1760
9126 @deffn {Scheme Procedure} list->bitvector list
9127 @deffnx {C Function} scm_list_to_bitvector (list)
9128 Return a new bitvector initialized with the elements
9129 of @var{list}.
9130 @end deffn
9131
9132 \fbitvector->list
9133 @c snarfed from unif.c:1790
9134 @deffn {Scheme Procedure} bitvector->list vec
9135 @deffnx {C Function} scm_bitvector_to_list (vec)
9136 Return a new list initialized with the elements
9137 of the bitvector @var{vec}.
9138 @end deffn
9139
9140 \fbit-count
9141 @c snarfed from unif.c:1854
9142 @deffn {Scheme Procedure} bit-count b bitvector
9143 @deffnx {C Function} scm_bit_count (b, bitvector)
9144 Return the number of occurrences of the boolean @var{b} in
9145 @var{bitvector}.
9146 @end deffn
9147
9148 \fbit-position
9149 @c snarfed from unif.c:1923
9150 @deffn {Scheme Procedure} bit-position item v k
9151 @deffnx {C Function} scm_bit_position (item, v, k)
9152 Return the index of the first occurrance of @var{item} in bit
9153 vector @var{v}, starting from @var{k}. If there is no
9154 @var{item} entry between @var{k} and the end of
9155 @var{bitvector}, then return @code{#f}. For example,
9156
9157 @example
9158 (bit-position #t #*000101 0) @result{} 3
9159 (bit-position #f #*0001111 3) @result{} #f
9160 @end example
9161 @end deffn
9162
9163 \fbit-set*!
9164 @c snarfed from unif.c:2006
9165 @deffn {Scheme Procedure} bit-set*! v kv obj
9166 @deffnx {C Function} scm_bit_set_star_x (v, kv, obj)
9167 Set entries of bit vector @var{v} to @var{obj}, with @var{kv}
9168 selecting the entries to change. The return value is
9169 unspecified.
9170
9171 If @var{kv} is a bit vector, then those entries where it has
9172 @code{#t} are the ones in @var{v} which are set to @var{obj}.
9173 @var{kv} and @var{v} must be the same length. When @var{obj}
9174 is @code{#t} it's like @var{kv} is OR'ed into @var{v}. Or when
9175 @var{obj} is @code{#f} it can be seen as an ANDNOT.
9176
9177 @example
9178 (define bv #*01000010)
9179 (bit-set*! bv #*10010001 #t)
9180 bv
9181 @result{} #*11010011
9182 @end example
9183
9184 If @var{kv} is a u32vector, then its elements are
9185 indices into @var{v} which are set to @var{obj}.
9186
9187 @example
9188 (define bv #*01000010)
9189 (bit-set*! bv #u32(5 2 7) #t)
9190 bv
9191 @result{} #*01100111
9192 @end example
9193 @end deffn
9194
9195 \fbit-count*
9196 @c snarfed from unif.c:2109
9197 @deffn {Scheme Procedure} bit-count* v kv obj
9198 @deffnx {C Function} scm_bit_count_star (v, kv, obj)
9199 Return a count of how many entries in bit vector @var{v} are
9200 equal to @var{obj}, with @var{kv} selecting the entries to
9201 consider.
9202
9203 If @var{kv} is a bit vector, then those entries where it has
9204 @code{#t} are the ones in @var{v} which are considered.
9205 @var{kv} and @var{v} must be the same length.
9206
9207 If @var{kv} is a u32vector, then it contains
9208 the indexes in @var{v} to consider.
9209
9210 For example,
9211
9212 @example
9213 (bit-count* #*01110111 #*11001101 #t) @result{} 3
9214 (bit-count* #*01110111 #u32(7 0 4) #f) @result{} 2
9215 @end example
9216 @end deffn
9217
9218 \fbit-invert!
9219 @c snarfed from unif.c:2196
9220 @deffn {Scheme Procedure} bit-invert! v
9221 @deffnx {C Function} scm_bit_invert_x (v)
9222 Modify the bit vector @var{v} by replacing each element with
9223 its negation.
9224 @end deffn
9225
9226 \farray->list
9227 @c snarfed from unif.c:2303
9228 @deffn {Scheme Procedure} array->list v
9229 @deffnx {C Function} scm_array_to_list (v)
9230 Return a list consisting of all the elements, in order, of
9231 @var{array}.
9232 @end deffn
9233
9234 \flist->typed-array
9235 @c snarfed from unif.c:2332
9236 @deffn {Scheme Procedure} list->typed-array type shape lst
9237 @deffnx {C Function} scm_list_to_typed_array (type, shape, lst)
9238 Return an array of the type @var{type}
9239 with elements the same as those of @var{lst}.
9240
9241 The argument @var{shape} determines the number of dimensions
9242 of the array and their shape. It is either an exact integer,
9243 giving the
9244 number of dimensions directly, or a list whose length
9245 specifies the number of dimensions and each element specified
9246 the lower and optionally the upper bound of the corresponding
9247 dimension.
9248 When the element is list of two elements, these elements
9249 give the lower and upper bounds. When it is an exact
9250 integer, it gives only the lower bound.
9251 @end deffn
9252
9253 \flist->array
9254 @c snarfed from unif.c:2390
9255 @deffn {Scheme Procedure} list->array ndim lst
9256 @deffnx {C Function} scm_list_to_array (ndim, lst)
9257 Return an array with elements the same as those of @var{lst}.
9258 @end deffn
9259
9260 \flist->uniform-array
9261 @c snarfed from unif.c:2440
9262 @deffn {Scheme Procedure} list->uniform-array ndim prot lst
9263 @deffnx {C Function} scm_list_to_uniform_array (ndim, prot, lst)
9264 Return a uniform array of the type indicated by prototype
9265 @var{prot} with elements the same as those of @var{lst}.
9266 Elements must be of the appropriate type, no coercions are
9267 done.
9268
9269 The argument @var{ndim} determines the number of dimensions
9270 of the array. It is either an exact integer, giving the
9271 number directly, or a list of exact integers, whose length
9272 specifies the number of dimensions and each element is the
9273 lower index bound of its dimension.
9274 @end deffn
9275
9276 \farray-type
9277 @c snarfed from unif.c:2789
9278 @deffn {Scheme Procedure} array-type ra
9279 @deffnx {C Function} scm_array_type (ra)
9280
9281 @end deffn
9282
9283 \farray-prototype
9284 @c snarfed from unif.c:2809
9285 @deffn {Scheme Procedure} array-prototype ra
9286 @deffnx {C Function} scm_array_prototype (ra)
9287 Return an object that would produce an array of the same type
9288 as @var{array}, if used as the @var{prototype} for
9289 @code{make-uniform-array}.
9290 @end deffn
9291
9292 \fdynamic-link
9293 @c snarfed from dynl.c:149
9294 @deffn {Scheme Procedure} dynamic-link filename
9295 @deffnx {C Function} scm_dynamic_link (filename)
9296 Find the shared object (shared library) denoted by
9297 @var{filename} and link it into the running Guile
9298 application. The returned
9299 scheme object is a ``handle'' for the library which can
9300 be passed to @code{dynamic-func}, @code{dynamic-call} etc.
9301
9302 Searching for object files is system dependent. Normally,
9303 if @var{filename} does have an explicit directory it will
9304 be searched for in locations
9305 such as @file{/usr/lib} and @file{/usr/local/lib}.
9306 @end deffn
9307
9308 \fdynamic-object?
9309 @c snarfed from dynl.c:168
9310 @deffn {Scheme Procedure} dynamic-object? obj
9311 @deffnx {C Function} scm_dynamic_object_p (obj)
9312 Return @code{#t} if @var{obj} is a dynamic object handle,
9313 or @code{#f} otherwise.
9314 @end deffn
9315
9316 \fdynamic-unlink
9317 @c snarfed from dynl.c:182
9318 @deffn {Scheme Procedure} dynamic-unlink dobj
9319 @deffnx {C Function} scm_dynamic_unlink (dobj)
9320 Unlink a dynamic object from the application, if possible. The
9321 object must have been linked by @code{dynamic-link}, with
9322 @var{dobj} the corresponding handle. After this procedure
9323 is called, the handle can no longer be used to access the
9324 object.
9325 @end deffn
9326
9327 \fdynamic-func
9328 @c snarfed from dynl.c:207
9329 @deffn {Scheme Procedure} dynamic-func name dobj
9330 @deffnx {C Function} scm_dynamic_func (name, dobj)
9331 Return a ``handle'' for the function @var{name} in the
9332 shared object referred to by @var{dobj}. The handle
9333 can be passed to @code{dynamic-call} to actually
9334 call the function.
9335
9336 Regardless whether your C compiler prepends an underscore
9337 @samp{_} to the global names in a program, you should
9338 @strong{not} include this underscore in @var{name}
9339 since it will be added automatically when necessary.
9340 @end deffn
9341
9342 \fdynamic-call
9343 @c snarfed from dynl.c:253
9344 @deffn {Scheme Procedure} dynamic-call func dobj
9345 @deffnx {C Function} scm_dynamic_call (func, dobj)
9346 Call a C function in a dynamic object. Two styles of
9347 invocation are supported:
9348
9349 @itemize @bullet
9350 @item @var{func} can be a function handle returned by
9351 @code{dynamic-func}. In this case @var{dobj} is
9352 ignored
9353 @item @var{func} can be a string with the name of the
9354 function to call, with @var{dobj} the handle of the
9355 dynamic object in which to find the function.
9356 This is equivalent to
9357 @smallexample
9358
9359 (dynamic-call (dynamic-func @var{func} @var{dobj}) #f)
9360 @end smallexample
9361 @end itemize
9362
9363 In either case, the function is passed no arguments
9364 and its return value is ignored.
9365 @end deffn
9366
9367 \fdynamic-args-call
9368 @c snarfed from dynl.c:285
9369 @deffn {Scheme Procedure} dynamic-args-call func dobj args
9370 @deffnx {C Function} scm_dynamic_args_call (func, dobj, args)
9371 Call the C function indicated by @var{func} and @var{dobj},
9372 just like @code{dynamic-call}, but pass it some arguments and
9373 return its return value. The C function is expected to take
9374 two arguments and return an @code{int}, just like @code{main}:
9375 @smallexample
9376 int c_func (int argc, char **argv);
9377 @end smallexample
9378
9379 The parameter @var{args} must be a list of strings and is
9380 converted into an array of @code{char *}. The array is passed
9381 in @var{argv} and its size in @var{argc}. The return value is
9382 converted to a Scheme number and returned from the call to
9383 @code{dynamic-args-call}.
9384 @end deffn
9385
9386 \fchown
9387 @c snarfed from filesys.c:224
9388 @deffn {Scheme Procedure} chown object owner group
9389 @deffnx {C Function} scm_chown (object, owner, group)
9390 Change the ownership and group of the file referred to by @var{object} to
9391 the integer values @var{owner} and @var{group}. @var{object} can be
9392 a string containing a file name or, if the platform
9393 supports fchown, a port or integer file descriptor
9394 which is open on the file. The return value
9395 is unspecified.
9396
9397 If @var{object} is a symbolic link, either the
9398 ownership of the link or the ownership of the referenced file will be
9399 changed depending on the operating system (lchown is
9400 unsupported at present). If @var{owner} or @var{group} is specified
9401 as @code{-1}, then that ID is not changed.
9402 @end deffn
9403
9404 \fchmod
9405 @c snarfed from filesys.c:262
9406 @deffn {Scheme Procedure} chmod object mode
9407 @deffnx {C Function} scm_chmod (object, mode)
9408 Changes the permissions of the file referred to by @var{obj}.
9409 @var{obj} can be a string containing a file name or a port or integer file
9410 descriptor which is open on a file (in which case @code{fchmod} is used
9411 as the underlying system call).
9412 @var{mode} specifies
9413 the new permissions as a decimal number, e.g., @code{(chmod "foo" #o755)}.
9414 The return value is unspecified.
9415 @end deffn
9416
9417 \fumask
9418 @c snarfed from filesys.c:294
9419 @deffn {Scheme Procedure} umask [mode]
9420 @deffnx {C Function} scm_umask (mode)
9421 If @var{mode} is omitted, returns a decimal number representing the current
9422 file creation mask. Otherwise the file creation mask is set to
9423 @var{mode} and the previous value is returned.
9424
9425 E.g., @code{(umask #o022)} sets the mask to octal 22, decimal 18.
9426 @end deffn
9427
9428 \fopen-fdes
9429 @c snarfed from filesys.c:316
9430 @deffn {Scheme Procedure} open-fdes path flags [mode]
9431 @deffnx {C Function} scm_open_fdes (path, flags, mode)
9432 Similar to @code{open} but return a file descriptor instead of
9433 a port.
9434 @end deffn
9435
9436 \fopen
9437 @c snarfed from filesys.c:357
9438 @deffn {Scheme Procedure} open path flags [mode]
9439 @deffnx {C Function} scm_open (path, flags, mode)
9440 Open the file named by @var{path} for reading and/or writing.
9441 @var{flags} is an integer specifying how the file should be opened.
9442 @var{mode} is an integer specifying the permission bits of the file, if
9443 it needs to be created, before the umask is applied. The default is 666
9444 (Unix itself has no default).
9445
9446 @var{flags} can be constructed by combining variables using @code{logior}.
9447 Basic flags are:
9448
9449 @defvar O_RDONLY
9450 Open the file read-only.
9451 @end defvar
9452 @defvar O_WRONLY
9453 Open the file write-only.
9454 @end defvar
9455 @defvar O_RDWR
9456 Open the file read/write.
9457 @end defvar
9458 @defvar O_APPEND
9459 Append to the file instead of truncating.
9460 @end defvar
9461 @defvar O_CREAT
9462 Create the file if it does not already exist.
9463 @end defvar
9464
9465 See the Unix documentation of the @code{open} system call
9466 for additional flags.
9467 @end deffn
9468
9469 \fclose
9470 @c snarfed from filesys.c:395
9471 @deffn {Scheme Procedure} close fd_or_port
9472 @deffnx {C Function} scm_close (fd_or_port)
9473 Similar to close-port (@pxref{Closing, close-port}),
9474 but also works on file descriptors. A side
9475 effect of closing a file descriptor is that any ports using that file
9476 descriptor are moved to a different file descriptor and have
9477 their revealed counts set to zero.
9478 @end deffn
9479
9480 \fclose-fdes
9481 @c snarfed from filesys.c:422
9482 @deffn {Scheme Procedure} close-fdes fd
9483 @deffnx {C Function} scm_close_fdes (fd)
9484 A simple wrapper for the @code{close} system call.
9485 Close file descriptor @var{fd}, which must be an integer.
9486 Unlike close (@pxref{Ports and File Descriptors, close}),
9487 the file descriptor will be closed even if a port is using it.
9488 The return value is unspecified.
9489 @end deffn
9490
9491 \fstat
9492 @c snarfed from filesys.c:624
9493 @deffn {Scheme Procedure} stat object
9494 @deffnx {C Function} scm_stat (object)
9495 Return an object containing various information about the file
9496 determined by @var{obj}. @var{obj} can be a string containing
9497 a file name or a port or integer file descriptor which is open
9498 on a file (in which case @code{fstat} is used as the underlying
9499 system call).
9500
9501 The object returned by @code{stat} can be passed as a single
9502 parameter to the following procedures, all of which return
9503 integers:
9504
9505 @table @code
9506 @item stat:dev
9507 The device containing the file.
9508 @item stat:ino
9509 The file serial number, which distinguishes this file from all
9510 other files on the same device.
9511 @item stat:mode
9512 The mode of the file. This includes file type information and
9513 the file permission bits. See @code{stat:type} and
9514 @code{stat:perms} below.
9515 @item stat:nlink
9516 The number of hard links to the file.
9517 @item stat:uid
9518 The user ID of the file's owner.
9519 @item stat:gid
9520 The group ID of the file.
9521 @item stat:rdev
9522 Device ID; this entry is defined only for character or block
9523 special files.
9524 @item stat:size
9525 The size of a regular file in bytes.
9526 @item stat:atime
9527 The last access time for the file.
9528 @item stat:mtime
9529 The last modification time for the file.
9530 @item stat:ctime
9531 The last modification time for the attributes of the file.
9532 @item stat:blksize
9533 The optimal block size for reading or writing the file, in
9534 bytes.
9535 @item stat:blocks
9536 The amount of disk space that the file occupies measured in
9537 units of 512 byte blocks.
9538 @end table
9539
9540 In addition, the following procedures return the information
9541 from stat:mode in a more convenient form:
9542
9543 @table @code
9544 @item stat:type
9545 A symbol representing the type of file. Possible values are
9546 regular, directory, symlink, block-special, char-special, fifo,
9547 socket and unknown
9548 @item stat:perms
9549 An integer representing the access permission bits.
9550 @end table
9551 @end deffn
9552
9553 \flink
9554 @c snarfed from filesys.c:686
9555 @deffn {Scheme Procedure} link oldpath newpath
9556 @deffnx {C Function} scm_link (oldpath, newpath)
9557 Creates a new name @var{newpath} in the file system for the
9558 file named by @var{oldpath}. If @var{oldpath} is a symbolic
9559 link, the link may or may not be followed depending on the
9560 system.
9561 @end deffn
9562
9563 \frename-file
9564 @c snarfed from filesys.c:724
9565 @deffn {Scheme Procedure} rename-file oldname newname
9566 @deffnx {C Function} scm_rename (oldname, newname)
9567 Renames the file specified by @var{oldname} to @var{newname}.
9568 The return value is unspecified.
9569 @end deffn
9570
9571 \fdelete-file
9572 @c snarfed from filesys.c:741
9573 @deffn {Scheme Procedure} delete-file str
9574 @deffnx {C Function} scm_delete_file (str)
9575 Deletes (or "unlinks") the file specified by @var{path}.
9576 @end deffn
9577
9578 \fmkdir
9579 @c snarfed from filesys.c:758
9580 @deffn {Scheme Procedure} mkdir path [mode]
9581 @deffnx {C Function} scm_mkdir (path, mode)
9582 Create a new directory named by @var{path}. If @var{mode} is omitted
9583 then the permissions of the directory file are set using the current
9584 umask. Otherwise they are set to the decimal value specified with
9585 @var{mode}. The return value is unspecified.
9586 @end deffn
9587
9588 \frmdir
9589 @c snarfed from filesys.c:785
9590 @deffn {Scheme Procedure} rmdir path
9591 @deffnx {C Function} scm_rmdir (path)
9592 Remove the existing directory named by @var{path}. The directory must
9593 be empty for this to succeed. The return value is unspecified.
9594 @end deffn
9595
9596 \fdirectory-stream?
9597 @c snarfed from filesys.c:809
9598 @deffn {Scheme Procedure} directory-stream? obj
9599 @deffnx {C Function} scm_directory_stream_p (obj)
9600 Return a boolean indicating whether @var{object} is a directory
9601 stream as returned by @code{opendir}.
9602 @end deffn
9603
9604 \fopendir
9605 @c snarfed from filesys.c:820
9606 @deffn {Scheme Procedure} opendir dirname
9607 @deffnx {C Function} scm_opendir (dirname)
9608 Open the directory specified by @var{path} and return a directory
9609 stream.
9610 @end deffn
9611
9612 \freaddir
9613 @c snarfed from filesys.c:841
9614 @deffn {Scheme Procedure} readdir port
9615 @deffnx {C Function} scm_readdir (port)
9616 Return (as a string) the next directory entry from the directory stream
9617 @var{stream}. If there is no remaining entry to be read then the
9618 end of file object is returned.
9619 @end deffn
9620
9621 \frewinddir
9622 @c snarfed from filesys.c:880
9623 @deffn {Scheme Procedure} rewinddir port
9624 @deffnx {C Function} scm_rewinddir (port)
9625 Reset the directory port @var{stream} so that the next call to
9626 @code{readdir} will return the first directory entry.
9627 @end deffn
9628
9629 \fclosedir
9630 @c snarfed from filesys.c:897
9631 @deffn {Scheme Procedure} closedir port
9632 @deffnx {C Function} scm_closedir (port)
9633 Close the directory stream @var{stream}.
9634 The return value is unspecified.
9635 @end deffn
9636
9637 \fchdir
9638 @c snarfed from filesys.c:947
9639 @deffn {Scheme Procedure} chdir str
9640 @deffnx {C Function} scm_chdir (str)
9641 Change the current working directory to @var{path}.
9642 The return value is unspecified.
9643 @end deffn
9644
9645 \fgetcwd
9646 @c snarfed from filesys.c:962
9647 @deffn {Scheme Procedure} getcwd
9648 @deffnx {C Function} scm_getcwd ()
9649 Return the name of the current working directory.
9650 @end deffn
9651
9652 \fselect
9653 @c snarfed from filesys.c:1164
9654 @deffn {Scheme Procedure} select reads writes excepts [secs [usecs]]
9655 @deffnx {C Function} scm_select (reads, writes, excepts, secs, usecs)
9656 This procedure has a variety of uses: waiting for the ability
9657 to provide input, accept output, or the existence of
9658 exceptional conditions on a collection of ports or file
9659 descriptors, or waiting for a timeout to occur.
9660 It also returns if interrupted by a signal.
9661
9662 @var{reads}, @var{writes} and @var{excepts} can be lists or
9663 vectors, with each member a port or a file descriptor.
9664 The value returned is a list of three corresponding
9665 lists or vectors containing only the members which meet the
9666 specified requirement. The ability of port buffers to
9667 provide input or accept output is taken into account.
9668 Ordering of the input lists or vectors is not preserved.
9669
9670 The optional arguments @var{secs} and @var{usecs} specify the
9671 timeout. Either @var{secs} can be specified alone, as
9672 either an integer or a real number, or both @var{secs} and
9673 @var{usecs} can be specified as integers, in which case
9674 @var{usecs} is an additional timeout expressed in
9675 microseconds. If @var{secs} is omitted or is @code{#f} then
9676 select will wait for as long as it takes for one of the other
9677 conditions to be satisfied.
9678
9679 The scsh version of @code{select} differs as follows:
9680 Only vectors are accepted for the first three arguments.
9681 The @var{usecs} argument is not supported.
9682 Multiple values are returned instead of a list.
9683 Duplicates in the input vectors appear only once in output.
9684 An additional @code{select!} interface is provided.
9685 @end deffn
9686
9687 \ffcntl
9688 @c snarfed from filesys.c:1302
9689 @deffn {Scheme Procedure} fcntl object cmd [value]
9690 @deffnx {C Function} scm_fcntl (object, cmd, value)
9691 Apply @var{command} to the specified file descriptor or the underlying
9692 file descriptor of the specified port. @var{value} is an optional
9693 integer argument.
9694
9695 Values for @var{command} are:
9696
9697 @table @code
9698 @item F_DUPFD
9699 Duplicate a file descriptor
9700 @item F_GETFD
9701 Get flags associated with the file descriptor.
9702 @item F_SETFD
9703 Set flags associated with the file descriptor to @var{value}.
9704 @item F_GETFL
9705 Get flags associated with the open file.
9706 @item F_SETFL
9707 Set flags associated with the open file to @var{value}
9708 @item F_GETOWN
9709 Get the process ID of a socket's owner, for @code{SIGIO} signals.
9710 @item F_SETOWN
9711 Set the process that owns a socket to @var{value}, for @code{SIGIO} signals.
9712 @item FD_CLOEXEC
9713 The value used to indicate the "close on exec" flag with @code{F_GETFL} or
9714 @code{F_SETFL}.
9715 @end table
9716 @end deffn
9717
9718 \ffsync
9719 @c snarfed from filesys.c:1334
9720 @deffn {Scheme Procedure} fsync object
9721 @deffnx {C Function} scm_fsync (object)
9722 Copies any unwritten data for the specified output file descriptor to disk.
9723 If @var{port/fd} is a port, its buffer is flushed before the underlying
9724 file descriptor is fsync'd.
9725 The return value is unspecified.
9726 @end deffn
9727
9728 \fsymlink
9729 @c snarfed from filesys.c:1359
9730 @deffn {Scheme Procedure} symlink oldpath newpath
9731 @deffnx {C Function} scm_symlink (oldpath, newpath)
9732 Create a symbolic link named @var{path-to} with the value (i.e., pointing to)
9733 @var{path-from}. The return value is unspecified.
9734 @end deffn
9735
9736 \freadlink
9737 @c snarfed from filesys.c:1378
9738 @deffn {Scheme Procedure} readlink path
9739 @deffnx {C Function} scm_readlink (path)
9740 Return the value of the symbolic link named by @var{path} (a
9741 string), i.e., the file that the link points to.
9742 @end deffn
9743
9744 \flstat
9745 @c snarfed from filesys.c:1420
9746 @deffn {Scheme Procedure} lstat str
9747 @deffnx {C Function} scm_lstat (str)
9748 Similar to @code{stat}, but does not follow symbolic links, i.e.,
9749 it will return information about a symbolic link itself, not the
9750 file it points to. @var{path} must be a string.
9751 @end deffn
9752
9753 \fcopy-file
9754 @c snarfed from filesys.c:1443
9755 @deffn {Scheme Procedure} copy-file oldfile newfile
9756 @deffnx {C Function} scm_copy_file (oldfile, newfile)
9757 Copy the file specified by @var{path-from} to @var{path-to}.
9758 The return value is unspecified.
9759 @end deffn
9760
9761 \fdirname
9762 @c snarfed from filesys.c:1506
9763 @deffn {Scheme Procedure} dirname filename
9764 @deffnx {C Function} scm_dirname (filename)
9765 Return the directory name component of the file name
9766 @var{filename}. If @var{filename} does not contain a directory
9767 component, @code{.} is returned.
9768 @end deffn
9769
9770 \fbasename
9771 @c snarfed from filesys.c:1549
9772 @deffn {Scheme Procedure} basename filename [suffix]
9773 @deffnx {C Function} scm_basename (filename, suffix)
9774 Return the base name of the file name @var{filename}. The
9775 base name is the file name without any directory components.
9776 If @var{suffix} is provided, and is equal to the end of
9777 @var{basename}, it is removed also.
9778 @end deffn
9779
9780 \fpipe
9781 @c snarfed from posix.c:233
9782 @deffn {Scheme Procedure} pipe
9783 @deffnx {C Function} scm_pipe ()
9784 Return a newly created pipe: a pair of ports which are linked
9785 together on the local machine. The @emph{car} is the input
9786 port and the @emph{cdr} is the output port. Data written (and
9787 flushed) to the output port can be read from the input port.
9788 Pipes are commonly used for communication with a newly forked
9789 child process. The need to flush the output port can be
9790 avoided by making it unbuffered using @code{setvbuf}.
9791
9792 Writes occur atomically provided the size of the data in bytes
9793 is not greater than the value of @code{PIPE_BUF}. Note that
9794 the output port is likely to block if too much data (typically
9795 equal to @code{PIPE_BUF}) has been written but not yet read
9796 from the input port.
9797 @end deffn
9798
9799 \fgetgroups
9800 @c snarfed from posix.c:254
9801 @deffn {Scheme Procedure} getgroups
9802 @deffnx {C Function} scm_getgroups ()
9803 Return a vector of integers representing the current
9804 supplementary group IDs.
9805 @end deffn
9806
9807 \fsetgroups
9808 @c snarfed from posix.c:287
9809 @deffn {Scheme Procedure} setgroups group_vec
9810 @deffnx {C Function} scm_setgroups (group_vec)
9811 Set the current set of supplementary group IDs to the integers
9812 in the given vector @var{vec}. The return value is
9813 unspecified.
9814
9815 Generally only the superuser can set the process group IDs.
9816 @end deffn
9817
9818 \fgetpw
9819 @c snarfed from posix.c:336
9820 @deffn {Scheme Procedure} getpw [user]
9821 @deffnx {C Function} scm_getpwuid (user)
9822 Look up an entry in the user database. @var{obj} can be an integer,
9823 a string, or omitted, giving the behaviour of getpwuid, getpwnam
9824 or getpwent respectively.
9825 @end deffn
9826
9827 \fsetpw
9828 @c snarfed from posix.c:386
9829 @deffn {Scheme Procedure} setpw [arg]
9830 @deffnx {C Function} scm_setpwent (arg)
9831 If called with a true argument, initialize or reset the password data
9832 stream. Otherwise, close the stream. The @code{setpwent} and
9833 @code{endpwent} procedures are implemented on top of this.
9834 @end deffn
9835
9836 \fgetgr
9837 @c snarfed from posix.c:405
9838 @deffn {Scheme Procedure} getgr [name]
9839 @deffnx {C Function} scm_getgrgid (name)
9840 Look up an entry in the group database. @var{obj} can be an integer,
9841 a string, or omitted, giving the behaviour of getgrgid, getgrnam
9842 or getgrent respectively.
9843 @end deffn
9844
9845 \fsetgr
9846 @c snarfed from posix.c:441
9847 @deffn {Scheme Procedure} setgr [arg]
9848 @deffnx {C Function} scm_setgrent (arg)
9849 If called with a true argument, initialize or reset the group data
9850 stream. Otherwise, close the stream. The @code{setgrent} and
9851 @code{endgrent} procedures are implemented on top of this.
9852 @end deffn
9853
9854 \fkill
9855 @c snarfed from posix.c:477
9856 @deffn {Scheme Procedure} kill pid sig
9857 @deffnx {C Function} scm_kill (pid, sig)
9858 Sends a signal to the specified process or group of processes.
9859
9860 @var{pid} specifies the processes to which the signal is sent:
9861
9862 @table @r
9863 @item @var{pid} greater than 0
9864 The process whose identifier is @var{pid}.
9865 @item @var{pid} equal to 0
9866 All processes in the current process group.
9867 @item @var{pid} less than -1
9868 The process group whose identifier is -@var{pid}
9869 @item @var{pid} equal to -1
9870 If the process is privileged, all processes except for some special
9871 system processes. Otherwise, all processes with the current effective
9872 user ID.
9873 @end table
9874
9875 @var{sig} should be specified using a variable corresponding to
9876 the Unix symbolic name, e.g.,
9877
9878 @defvar SIGHUP
9879 Hang-up signal.
9880 @end defvar
9881
9882 @defvar SIGINT
9883 Interrupt signal.
9884 @end defvar
9885 @end deffn
9886
9887 \fwaitpid
9888 @c snarfed from posix.c:528
9889 @deffn {Scheme Procedure} waitpid pid [options]
9890 @deffnx {C Function} scm_waitpid (pid, options)
9891 This procedure collects status information from a child process which
9892 has terminated or (optionally) stopped. Normally it will
9893 suspend the calling process until this can be done. If more than one
9894 child process is eligible then one will be chosen by the operating system.
9895
9896 The value of @var{pid} determines the behaviour:
9897
9898 @table @r
9899 @item @var{pid} greater than 0
9900 Request status information from the specified child process.
9901 @item @var{pid} equal to -1 or WAIT_ANY
9902 Request status information for any child process.
9903 @item @var{pid} equal to 0 or WAIT_MYPGRP
9904 Request status information for any child process in the current process
9905 group.
9906 @item @var{pid} less than -1
9907 Request status information for any child process whose process group ID
9908 is -@var{PID}.
9909 @end table
9910
9911 The @var{options} argument, if supplied, should be the bitwise OR of the
9912 values of zero or more of the following variables:
9913
9914 @defvar WNOHANG
9915 Return immediately even if there are no child processes to be collected.
9916 @end defvar
9917
9918 @defvar WUNTRACED
9919 Report status information for stopped processes as well as terminated
9920 processes.
9921 @end defvar
9922
9923 The return value is a pair containing:
9924
9925 @enumerate
9926 @item
9927 The process ID of the child process, or 0 if @code{WNOHANG} was
9928 specified and no process was collected.
9929 @item
9930 The integer status value.
9931 @end enumerate
9932 @end deffn
9933
9934 \fstatus:exit-val
9935 @c snarfed from posix.c:554
9936 @deffn {Scheme Procedure} status:exit-val status
9937 @deffnx {C Function} scm_status_exit_val (status)
9938 Return the exit status value, as would be set if a process
9939 ended normally through a call to @code{exit} or @code{_exit},
9940 if any, otherwise @code{#f}.
9941 @end deffn
9942
9943 \fstatus:term-sig
9944 @c snarfed from posix.c:572
9945 @deffn {Scheme Procedure} status:term-sig status
9946 @deffnx {C Function} scm_status_term_sig (status)
9947 Return the signal number which terminated the process, if any,
9948 otherwise @code{#f}.
9949 @end deffn
9950
9951 \fstatus:stop-sig
9952 @c snarfed from posix.c:588
9953 @deffn {Scheme Procedure} status:stop-sig status
9954 @deffnx {C Function} scm_status_stop_sig (status)
9955 Return the signal number which stopped the process, if any,
9956 otherwise @code{#f}.
9957 @end deffn
9958
9959 \fgetppid
9960 @c snarfed from posix.c:606
9961 @deffn {Scheme Procedure} getppid
9962 @deffnx {C Function} scm_getppid ()
9963 Return an integer representing the process ID of the parent
9964 process.
9965 @end deffn
9966
9967 \fgetuid
9968 @c snarfed from posix.c:618
9969 @deffn {Scheme Procedure} getuid
9970 @deffnx {C Function} scm_getuid ()
9971 Return an integer representing the current real user ID.
9972 @end deffn
9973
9974 \fgetgid
9975 @c snarfed from posix.c:629
9976 @deffn {Scheme Procedure} getgid
9977 @deffnx {C Function} scm_getgid ()
9978 Return an integer representing the current real group ID.
9979 @end deffn
9980
9981 \fgeteuid
9982 @c snarfed from posix.c:643
9983 @deffn {Scheme Procedure} geteuid
9984 @deffnx {C Function} scm_geteuid ()
9985 Return an integer representing the current effective user ID.
9986 If the system does not support effective IDs, then the real ID
9987 is returned. @code{(provided? 'EIDs)} reports whether the
9988 system supports effective IDs.
9989 @end deffn
9990
9991 \fgetegid
9992 @c snarfed from posix.c:660
9993 @deffn {Scheme Procedure} getegid
9994 @deffnx {C Function} scm_getegid ()
9995 Return an integer representing the current effective group ID.
9996 If the system does not support effective IDs, then the real ID
9997 is returned. @code{(provided? 'EIDs)} reports whether the
9998 system supports effective IDs.
9999 @end deffn
10000
10001 \fsetuid
10002 @c snarfed from posix.c:676
10003 @deffn {Scheme Procedure} setuid id
10004 @deffnx {C Function} scm_setuid (id)
10005 Sets both the real and effective user IDs to the integer @var{id}, provided
10006 the process has appropriate privileges.
10007 The return value is unspecified.
10008 @end deffn
10009
10010 \fsetgid
10011 @c snarfed from posix.c:689
10012 @deffn {Scheme Procedure} setgid id
10013 @deffnx {C Function} scm_setgid (id)
10014 Sets both the real and effective group IDs to the integer @var{id}, provided
10015 the process has appropriate privileges.
10016 The return value is unspecified.
10017 @end deffn
10018
10019 \fseteuid
10020 @c snarfed from posix.c:704
10021 @deffn {Scheme Procedure} seteuid id
10022 @deffnx {C Function} scm_seteuid (id)
10023 Sets the effective user ID to the integer @var{id}, provided the process
10024 has appropriate privileges. If effective IDs are not supported, the
10025 real ID is set instead -- @code{(provided? 'EIDs)} reports whether the
10026 system supports effective IDs.
10027 The return value is unspecified.
10028 @end deffn
10029
10030 \fsetegid
10031 @c snarfed from posix.c:729
10032 @deffn {Scheme Procedure} setegid id
10033 @deffnx {C Function} scm_setegid (id)
10034 Sets the effective group 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 \fgetpgrp
10042 @c snarfed from posix.c:752
10043 @deffn {Scheme Procedure} getpgrp
10044 @deffnx {C Function} scm_getpgrp ()
10045 Return an integer representing the current process group ID.
10046 This is the POSIX definition, not BSD.
10047 @end deffn
10048
10049 \fsetpgid
10050 @c snarfed from posix.c:770
10051 @deffn {Scheme Procedure} setpgid pid pgid
10052 @deffnx {C Function} scm_setpgid (pid, pgid)
10053 Move the process @var{pid} into the process group @var{pgid}. @var{pid} or
10054 @var{pgid} must be integers: they can be zero to indicate the ID of the
10055 current process.
10056 Fails on systems that do not support job control.
10057 The return value is unspecified.
10058 @end deffn
10059
10060 \fsetsid
10061 @c snarfed from posix.c:787
10062 @deffn {Scheme Procedure} setsid
10063 @deffnx {C Function} scm_setsid ()
10064 Creates a new session. The current process becomes the session leader
10065 and is put in a new process group. The process will be detached
10066 from its controlling terminal if it has one.
10067 The return value is an integer representing the new process group ID.
10068 @end deffn
10069
10070 \fttyname
10071 @c snarfed from posix.c:811
10072 @deffn {Scheme Procedure} ttyname port
10073 @deffnx {C Function} scm_ttyname (port)
10074 Return a string with the name of the serial terminal device
10075 underlying @var{port}.
10076 @end deffn
10077
10078 \fctermid
10079 @c snarfed from posix.c:850
10080 @deffn {Scheme Procedure} ctermid
10081 @deffnx {C Function} scm_ctermid ()
10082 Return a string containing the file name of the controlling
10083 terminal for the current process.
10084 @end deffn
10085
10086 \ftcgetpgrp
10087 @c snarfed from posix.c:874
10088 @deffn {Scheme Procedure} tcgetpgrp port
10089 @deffnx {C Function} scm_tcgetpgrp (port)
10090 Return the process group ID of the foreground process group
10091 associated with the terminal open on the file descriptor
10092 underlying @var{port}.
10093
10094 If there is no foreground process group, the return value is a
10095 number greater than 1 that does not match the process group ID
10096 of any existing process group. This can happen if all of the
10097 processes in the job that was formerly the foreground job have
10098 terminated, and no other job has yet been moved into the
10099 foreground.
10100 @end deffn
10101
10102 \ftcsetpgrp
10103 @c snarfed from posix.c:898
10104 @deffn {Scheme Procedure} tcsetpgrp port pgid
10105 @deffnx {C Function} scm_tcsetpgrp (port, pgid)
10106 Set the foreground process group ID for the terminal used by the file
10107 descriptor underlying @var{port} to the integer @var{pgid}.
10108 The calling process
10109 must be a member of the same session as @var{pgid} and must have the same
10110 controlling terminal. The return value is unspecified.
10111 @end deffn
10112
10113 \fexecl
10114 @c snarfed from posix.c:930
10115 @deffn {Scheme Procedure} execl filename . args
10116 @deffnx {C Function} scm_execl (filename, args)
10117 Executes the file named by @var{path} as a new process image.
10118 The remaining arguments are supplied to the process; from a C program
10119 they are accessible as the @code{argv} argument to @code{main}.
10120 Conventionally the first @var{arg} is the same as @var{path}.
10121 All arguments must be strings.
10122
10123 If @var{arg} is missing, @var{path} is executed with a null
10124 argument list, which may have system-dependent side-effects.
10125
10126 This procedure is currently implemented using the @code{execv} system
10127 call, but we call it @code{execl} because of its Scheme calling interface.
10128 @end deffn
10129
10130 \fexeclp
10131 @c snarfed from posix.c:961
10132 @deffn {Scheme Procedure} execlp filename . args
10133 @deffnx {C Function} scm_execlp (filename, args)
10134 Similar to @code{execl}, however if
10135 @var{filename} does not contain a slash
10136 then the file to execute will be located by searching the
10137 directories listed in the @code{PATH} environment variable.
10138
10139 This procedure is currently implemented using the @code{execvp} system
10140 call, but we call it @code{execlp} because of its Scheme calling interface.
10141 @end deffn
10142
10143 \fexecle
10144 @c snarfed from posix.c:995
10145 @deffn {Scheme Procedure} execle filename env . args
10146 @deffnx {C Function} scm_execle (filename, env, args)
10147 Similar to @code{execl}, but the environment of the new process is
10148 specified by @var{env}, which must be a list of strings as returned by the
10149 @code{environ} procedure.
10150
10151 This procedure is currently implemented using the @code{execve} system
10152 call, but we call it @code{execle} because of its Scheme calling interface.
10153 @end deffn
10154
10155 \fprimitive-fork
10156 @c snarfed from posix.c:1031
10157 @deffn {Scheme Procedure} primitive-fork
10158 @deffnx {C Function} scm_fork ()
10159 Creates a new "child" process by duplicating the current "parent" process.
10160 In the child the return value is 0. In the parent the return value is
10161 the integer process ID of the child.
10162
10163 This procedure has been renamed from @code{fork} to avoid a naming conflict
10164 with the scsh fork.
10165 @end deffn
10166
10167 \funame
10168 @c snarfed from posix.c:1051
10169 @deffn {Scheme Procedure} uname
10170 @deffnx {C Function} scm_uname ()
10171 Return an object with some information about the computer
10172 system the program is running on.
10173 @end deffn
10174
10175 \fenviron
10176 @c snarfed from posix.c:1080
10177 @deffn {Scheme Procedure} environ [env]
10178 @deffnx {C Function} scm_environ (env)
10179 If @var{env} is omitted, return the current environment (in the
10180 Unix sense) as a list of strings. Otherwise set the current
10181 environment, which is also the default environment for child
10182 processes, to the supplied list of strings. Each member of
10183 @var{env} should be of the form @code{NAME=VALUE} and values of
10184 @code{NAME} should not be duplicated. If @var{env} is supplied
10185 then the return value is unspecified.
10186 @end deffn
10187
10188 \ftmpnam
10189 @c snarfed from posix.c:1113
10190 @deffn {Scheme Procedure} tmpnam
10191 @deffnx {C Function} scm_tmpnam ()
10192 Return a name in the file system that does not match any
10193 existing file. However there is no guarantee that another
10194 process will not create the file after @code{tmpnam} is called.
10195 Care should be taken if opening the file, e.g., use the
10196 @code{O_EXCL} open flag or use @code{mkstemp!} instead.
10197 @end deffn
10198
10199 \fmkstemp!
10200 @c snarfed from posix.c:1144
10201 @deffn {Scheme Procedure} mkstemp! tmpl
10202 @deffnx {C Function} scm_mkstemp (tmpl)
10203 Create a new unique file in the file system and returns a new
10204 buffered port open for reading and writing to the file.
10205
10206 @var{tmpl} is a string specifying where the file should be
10207 created: it must end with @samp{XXXXXX} and will be changed in
10208 place to return the name of the temporary file.
10209
10210 The file is created with mode @code{0600}, which means read and
10211 write for the owner only. @code{chmod} can be used to change
10212 this.
10213 @end deffn
10214
10215 \futime
10216 @c snarfed from posix.c:1179
10217 @deffn {Scheme Procedure} utime pathname [actime [modtime]]
10218 @deffnx {C Function} scm_utime (pathname, actime, modtime)
10219 @code{utime} sets the access and modification times for the
10220 file named by @var{path}. If @var{actime} or @var{modtime} is
10221 not supplied, then the current time is used. @var{actime} and
10222 @var{modtime} must be integer time values as returned by the
10223 @code{current-time} procedure.
10224 @lisp
10225 (utime "foo" (- (current-time) 3600))
10226 @end lisp
10227 will set the access time to one hour in the past and the
10228 modification time to the current time.
10229 @end deffn
10230
10231 \faccess?
10232 @c snarfed from posix.c:1244
10233 @deffn {Scheme Procedure} access? path how
10234 @deffnx {C Function} scm_access (path, how)
10235 Test accessibility of a file under the real UID and GID of the
10236 calling process. The return is @code{#t} if @var{path} exists
10237 and the permissions requested by @var{how} are all allowed, or
10238 @code{#f} if not.
10239
10240 @var{how} is an integer which is one of the following values,
10241 or a bitwise-OR (@code{logior}) of multiple values.
10242
10243 @defvar R_OK
10244 Test for read permission.
10245 @end defvar
10246 @defvar W_OK
10247 Test for write permission.
10248 @end defvar
10249 @defvar X_OK
10250 Test for execute permission.
10251 @end defvar
10252 @defvar F_OK
10253 Test for existence of the file. This is implied by each of the
10254 other tests, so there's no need to combine it with them.
10255 @end defvar
10256
10257 It's important to note that @code{access?} does not simply
10258 indicate what will happen on attempting to read or write a
10259 file. In normal circumstances it does, but in a set-UID or
10260 set-GID program it doesn't because @code{access?} tests the
10261 real ID, whereas an open or execute attempt uses the effective
10262 ID.
10263
10264 A program which will never run set-UID/GID can ignore the
10265 difference between real and effective IDs, but for maximum
10266 generality, especially in library functions, it's best not to
10267 use @code{access?} to predict the result of an open or execute,
10268 instead simply attempt that and catch any exception.
10269
10270 The main use for @code{access?} is to let a set-UID/GID program
10271 determine what the invoking user would have been allowed to do,
10272 without the greater (or perhaps lesser) privileges afforded by
10273 the effective ID. For more on this, see ``Testing File
10274 Access'' in The GNU C Library Reference Manual.
10275 @end deffn
10276
10277 \fgetpid
10278 @c snarfed from posix.c:1257
10279 @deffn {Scheme Procedure} getpid
10280 @deffnx {C Function} scm_getpid ()
10281 Return an integer representing the current process ID.
10282 @end deffn
10283
10284 \fputenv
10285 @c snarfed from posix.c:1274
10286 @deffn {Scheme Procedure} putenv str
10287 @deffnx {C Function} scm_putenv (str)
10288 Modifies the environment of the current process, which is
10289 also the default environment inherited by child processes.
10290
10291 If @var{string} is of the form @code{NAME=VALUE} then it will be written
10292 directly into the environment, replacing any existing environment string
10293 with
10294 name matching @code{NAME}. If @var{string} does not contain an equal
10295 sign, then any existing string with name matching @var{string} will
10296 be removed.
10297
10298 The return value is unspecified.
10299 @end deffn
10300
10301 \fsetlocale
10302 @c snarfed from posix.c:1358
10303 @deffn {Scheme Procedure} setlocale category [locale]
10304 @deffnx {C Function} scm_setlocale (category, locale)
10305 If @var{locale} is omitted, return the current value of the
10306 specified locale category as a system-dependent string.
10307 @var{category} should be specified using the values
10308 @code{LC_COLLATE}, @code{LC_ALL} etc.
10309
10310 Otherwise the specified locale category is set to the string
10311 @var{locale} and the new value is returned as a
10312 system-dependent string. If @var{locale} is an empty string,
10313 the locale will be set using environment variables.
10314 @end deffn
10315
10316 \fmknod
10317 @c snarfed from posix.c:1407
10318 @deffn {Scheme Procedure} mknod path type perms dev
10319 @deffnx {C Function} scm_mknod (path, type, perms, dev)
10320 Creates a new special file, such as a file corresponding to a device.
10321 @var{path} specifies the name of the file. @var{type} should
10322 be one of the following symbols:
10323 regular, directory, symlink, block-special, char-special,
10324 fifo, or socket. @var{perms} (an integer) specifies the file permissions.
10325 @var{dev} (an integer) specifies which device the special file refers
10326 to. Its exact interpretation depends on the kind of special file
10327 being created.
10328
10329 E.g.,
10330 @lisp
10331 (mknod "/dev/fd0" 'block-special #o660 (+ (* 2 256) 2))
10332 @end lisp
10333
10334 The return value is unspecified.
10335 @end deffn
10336
10337 \fnice
10338 @c snarfed from posix.c:1453
10339 @deffn {Scheme Procedure} nice incr
10340 @deffnx {C Function} scm_nice (incr)
10341 Increment the priority of the current process by @var{incr}. A higher
10342 priority value means that the process runs less often.
10343 The return value is unspecified.
10344 @end deffn
10345
10346 \fsync
10347 @c snarfed from posix.c:1471
10348 @deffn {Scheme Procedure} sync
10349 @deffnx {C Function} scm_sync ()
10350 Flush the operating system disk buffers.
10351 The return value is unspecified.
10352 @end deffn
10353
10354 \fcrypt
10355 @c snarfed from posix.c:1502
10356 @deffn {Scheme Procedure} crypt key salt
10357 @deffnx {C Function} scm_crypt (key, salt)
10358 Encrypt @var{key} using @var{salt} as the salt value to the
10359 crypt(3) library call.
10360 @end deffn
10361
10362 \fchroot
10363 @c snarfed from posix.c:1531
10364 @deffn {Scheme Procedure} chroot path
10365 @deffnx {C Function} scm_chroot (path)
10366 Change the root directory to that specified in @var{path}.
10367 This directory will be used for path names beginning with
10368 @file{/}. The root directory is inherited by all children
10369 of the current process. Only the superuser may change the
10370 root directory.
10371 @end deffn
10372
10373 \fgetlogin
10374 @c snarfed from posix.c:1565
10375 @deffn {Scheme Procedure} getlogin
10376 @deffnx {C Function} scm_getlogin ()
10377 Return a string containing the name of the user logged in on
10378 the controlling terminal of the process, or @code{#f} if this
10379 information cannot be obtained.
10380 @end deffn
10381
10382 \fcuserid
10383 @c snarfed from posix.c:1583
10384 @deffn {Scheme Procedure} cuserid
10385 @deffnx {C Function} scm_cuserid ()
10386 Return a string containing a user name associated with the
10387 effective user id of the process. Return @code{#f} if this
10388 information cannot be obtained.
10389 @end deffn
10390
10391 \fgetpriority
10392 @c snarfed from posix.c:1609
10393 @deffn {Scheme Procedure} getpriority which who
10394 @deffnx {C Function} scm_getpriority (which, who)
10395 Return the scheduling priority of the process, process group
10396 or user, as indicated by @var{which} and @var{who}. @var{which}
10397 is one of the variables @code{PRIO_PROCESS}, @code{PRIO_PGRP}
10398 or @code{PRIO_USER}, and @var{who} is interpreted relative to
10399 @var{which} (a process identifier for @code{PRIO_PROCESS},
10400 process group identifier for @code{PRIO_PGRP}, and a user
10401 identifier for @code{PRIO_USER}. A zero value of @var{who}
10402 denotes the current process, process group, or user. Return
10403 the highest priority (lowest numerical value) of any of the
10404 specified processes.
10405 @end deffn
10406
10407 \fsetpriority
10408 @c snarfed from posix.c:1643
10409 @deffn {Scheme Procedure} setpriority which who prio
10410 @deffnx {C Function} scm_setpriority (which, who, prio)
10411 Set the scheduling priority of the process, process group
10412 or user, as indicated by @var{which} and @var{who}. @var{which}
10413 is one of the variables @code{PRIO_PROCESS}, @code{PRIO_PGRP}
10414 or @code{PRIO_USER}, and @var{who} is interpreted relative to
10415 @var{which} (a process identifier for @code{PRIO_PROCESS},
10416 process group identifier for @code{PRIO_PGRP}, and a user
10417 identifier for @code{PRIO_USER}. A zero value of @var{who}
10418 denotes the current process, process group, or user.
10419 @var{prio} is a value in the range -20 and 20, the default
10420 priority is 0; lower priorities cause more favorable
10421 scheduling. Sets the priority of all of the specified
10422 processes. Only the super-user may lower priorities.
10423 The return value is not specified.
10424 @end deffn
10425
10426 \fgetpass
10427 @c snarfed from posix.c:1668
10428 @deffn {Scheme Procedure} getpass prompt
10429 @deffnx {C Function} scm_getpass (prompt)
10430 Display @var{prompt} to the standard error output and read
10431 a password from @file{/dev/tty}. If this file is not
10432 accessible, it reads from standard input. The password may be
10433 up to 127 characters in length. Additional characters and the
10434 terminating newline character are discarded. While reading
10435 the password, echoing and the generation of signals by special
10436 characters is disabled.
10437 @end deffn
10438
10439 \fflock
10440 @c snarfed from posix.c:1780
10441 @deffn {Scheme Procedure} flock file operation
10442 @deffnx {C Function} scm_flock (file, operation)
10443 Apply or remove an advisory lock on an open file.
10444 @var{operation} specifies the action to be done:
10445
10446 @defvar LOCK_SH
10447 Shared lock. More than one process may hold a shared lock
10448 for a given file at a given time.
10449 @end defvar
10450 @defvar LOCK_EX
10451 Exclusive lock. Only one process may hold an exclusive lock
10452 for a given file at a given time.
10453 @end defvar
10454 @defvar LOCK_UN
10455 Unlock the file.
10456 @end defvar
10457 @defvar LOCK_NB
10458 Don't block when locking. This is combined with one of the
10459 other operations using @code{logior}. If @code{flock} would
10460 block an @code{EWOULDBLOCK} error is thrown.
10461 @end defvar
10462
10463 The return value is not specified. @var{file} may be an open
10464 file descriptor or an open file descriptor port.
10465
10466 Note that @code{flock} does not lock files across NFS.
10467 @end deffn
10468
10469 \fsethostname
10470 @c snarfed from posix.c:1805
10471 @deffn {Scheme Procedure} sethostname name
10472 @deffnx {C Function} scm_sethostname (name)
10473 Set the host name of the current processor to @var{name}. May
10474 only be used by the superuser. The return value is not
10475 specified.
10476 @end deffn
10477
10478 \fgethostname
10479 @c snarfed from posix.c:1823
10480 @deffn {Scheme Procedure} gethostname
10481 @deffnx {C Function} scm_gethostname ()
10482 Return the host name of the current processor.
10483 @end deffn
10484
10485 \fgethost
10486 @c snarfed from net_db.c:134
10487 @deffn {Scheme Procedure} gethost [host]
10488 @deffnx {Scheme Procedure} gethostbyname hostname
10489 @deffnx {Scheme Procedure} gethostbyaddr address
10490 @deffnx {C Function} scm_gethost (host)
10491 Look up a host by name or address, returning a host object. The
10492 @code{gethost} procedure will accept either a string name or an integer
10493 address; if given no arguments, it behaves like @code{gethostent} (see
10494 below). If a name or address is supplied but the address can not be
10495 found, an error will be thrown to one of the keys:
10496 @code{host-not-found}, @code{try-again}, @code{no-recovery} or
10497 @code{no-data}, corresponding to the equivalent @code{h_error} values.
10498 Unusual conditions may result in errors thrown to the
10499 @code{system-error} or @code{misc_error} keys.
10500 @end deffn
10501
10502 \fgetnet
10503 @c snarfed from net_db.c:216
10504 @deffn {Scheme Procedure} getnet [net]
10505 @deffnx {Scheme Procedure} getnetbyname net-name
10506 @deffnx {Scheme Procedure} getnetbyaddr net-number
10507 @deffnx {C Function} scm_getnet (net)
10508 Look up a network by name or net number in the network database. The
10509 @var{net-name} argument must be a string, and the @var{net-number}
10510 argument must be an integer. @code{getnet} will accept either type of
10511 argument, behaving like @code{getnetent} (see below) if no arguments are
10512 given.
10513 @end deffn
10514
10515 \fgetproto
10516 @c snarfed from net_db.c:268
10517 @deffn {Scheme Procedure} getproto [protocol]
10518 @deffnx {Scheme Procedure} getprotobyname name
10519 @deffnx {Scheme Procedure} getprotobynumber number
10520 @deffnx {C Function} scm_getproto (protocol)
10521 Look up a network protocol by name or by number. @code{getprotobyname}
10522 takes a string argument, and @code{getprotobynumber} takes an integer
10523 argument. @code{getproto} will accept either type, behaving like
10524 @code{getprotoent} (see below) if no arguments are supplied.
10525 @end deffn
10526
10527 \fgetserv
10528 @c snarfed from net_db.c:334
10529 @deffn {Scheme Procedure} getserv [name [protocol]]
10530 @deffnx {Scheme Procedure} getservbyname name protocol
10531 @deffnx {Scheme Procedure} getservbyport port protocol
10532 @deffnx {C Function} scm_getserv (name, protocol)
10533 Look up a network service by name or by service number, and return a
10534 network service object. The @var{protocol} argument specifies the name
10535 of the desired protocol; if the protocol found in the network service
10536 database does not match this name, a system error is signalled.
10537
10538 The @code{getserv} procedure will take either a service name or number
10539 as its first argument; if given no arguments, it behaves like
10540 @code{getservent} (see below).
10541 @end deffn
10542
10543 \fsethost
10544 @c snarfed from net_db.c:385
10545 @deffn {Scheme Procedure} sethost [stayopen]
10546 @deffnx {C Function} scm_sethost (stayopen)
10547 If @var{stayopen} is omitted, this is equivalent to @code{endhostent}.
10548 Otherwise it is equivalent to @code{sethostent stayopen}.
10549 @end deffn
10550
10551 \fsetnet
10552 @c snarfed from net_db.c:401
10553 @deffn {Scheme Procedure} setnet [stayopen]
10554 @deffnx {C Function} scm_setnet (stayopen)
10555 If @var{stayopen} is omitted, this is equivalent to @code{endnetent}.
10556 Otherwise it is equivalent to @code{setnetent stayopen}.
10557 @end deffn
10558
10559 \fsetproto
10560 @c snarfed from net_db.c:417
10561 @deffn {Scheme Procedure} setproto [stayopen]
10562 @deffnx {C Function} scm_setproto (stayopen)
10563 If @var{stayopen} is omitted, this is equivalent to @code{endprotoent}.
10564 Otherwise it is equivalent to @code{setprotoent stayopen}.
10565 @end deffn
10566
10567 \fsetserv
10568 @c snarfed from net_db.c:433
10569 @deffn {Scheme Procedure} setserv [stayopen]
10570 @deffnx {C Function} scm_setserv (stayopen)
10571 If @var{stayopen} is omitted, this is equivalent to @code{endservent}.
10572 Otherwise it is equivalent to @code{setservent stayopen}.
10573 @end deffn
10574
10575 \fhtons
10576 @c snarfed from socket.c:80
10577 @deffn {Scheme Procedure} htons value
10578 @deffnx {C Function} scm_htons (value)
10579 Convert a 16 bit quantity from host to network byte ordering.
10580 @var{value} is packed into 2 bytes, which are then converted
10581 and returned as a new integer.
10582 @end deffn
10583
10584 \fntohs
10585 @c snarfed from socket.c:91
10586 @deffn {Scheme Procedure} ntohs value
10587 @deffnx {C Function} scm_ntohs (value)
10588 Convert a 16 bit quantity from network to host byte ordering.
10589 @var{value} is packed into 2 bytes, which are then converted
10590 and returned as a new integer.
10591 @end deffn
10592
10593 \fhtonl
10594 @c snarfed from socket.c:102
10595 @deffn {Scheme Procedure} htonl value
10596 @deffnx {C Function} scm_htonl (value)
10597 Convert a 32 bit quantity from host to network byte ordering.
10598 @var{value} is packed into 4 bytes, which are then converted
10599 and returned as a new integer.
10600 @end deffn
10601
10602 \fntohl
10603 @c snarfed from socket.c:115
10604 @deffn {Scheme Procedure} ntohl value
10605 @deffnx {C Function} scm_ntohl (value)
10606 Convert a 32 bit quantity from network to host byte ordering.
10607 @var{value} is packed into 4 bytes, which are then converted
10608 and returned as a new integer.
10609 @end deffn
10610
10611 \finet-aton
10612 @c snarfed from socket.c:135
10613 @deffn {Scheme Procedure} inet-aton address
10614 @deffnx {C Function} scm_inet_aton (address)
10615 Convert an IPv4 Internet address from printable string
10616 (dotted decimal notation) to an integer. E.g.,
10617
10618 @lisp
10619 (inet-aton "127.0.0.1") @result{} 2130706433
10620 @end lisp
10621 @end deffn
10622
10623 \finet-ntoa
10624 @c snarfed from socket.c:158
10625 @deffn {Scheme Procedure} inet-ntoa inetid
10626 @deffnx {C Function} scm_inet_ntoa (inetid)
10627 Convert an IPv4 Internet address to a printable
10628 (dotted decimal notation) string. E.g.,
10629
10630 @lisp
10631 (inet-ntoa 2130706433) @result{} "127.0.0.1"
10632 @end lisp
10633 @end deffn
10634
10635 \finet-netof
10636 @c snarfed from socket.c:178
10637 @deffn {Scheme Procedure} inet-netof address
10638 @deffnx {C Function} scm_inet_netof (address)
10639 Return the network number part of the given IPv4
10640 Internet address. E.g.,
10641
10642 @lisp
10643 (inet-netof 2130706433) @result{} 127
10644 @end lisp
10645 @end deffn
10646
10647 \finet-lnaof
10648 @c snarfed from socket.c:196
10649 @deffn {Scheme Procedure} inet-lnaof address
10650 @deffnx {C Function} scm_lnaof (address)
10651 Return the local-address-with-network part of the given
10652 IPv4 Internet address, using the obsolete class A/B/C system.
10653 E.g.,
10654
10655 @lisp
10656 (inet-lnaof 2130706433) @result{} 1
10657 @end lisp
10658 @end deffn
10659
10660 \finet-makeaddr
10661 @c snarfed from socket.c:214
10662 @deffn {Scheme Procedure} inet-makeaddr net lna
10663 @deffnx {C Function} scm_inet_makeaddr (net, lna)
10664 Make an IPv4 Internet address by combining the network number
10665 @var{net} with the local-address-within-network number
10666 @var{lna}. E.g.,
10667
10668 @lisp
10669 (inet-makeaddr 127 1) @result{} 2130706433
10670 @end lisp
10671 @end deffn
10672
10673 \finet-pton
10674 @c snarfed from socket.c:350
10675 @deffn {Scheme Procedure} inet-pton family address
10676 @deffnx {C Function} scm_inet_pton (family, address)
10677 Convert a string containing a printable network address to
10678 an integer address. Note that unlike the C version of this
10679 function,
10680 the result is an integer with normal host byte ordering.
10681 @var{family} can be @code{AF_INET} or @code{AF_INET6}. E.g.,
10682
10683 @lisp
10684 (inet-pton AF_INET "127.0.0.1") @result{} 2130706433
10685 (inet-pton AF_INET6 "::1") @result{} 1
10686 @end lisp
10687 @end deffn
10688
10689 \finet-ntop
10690 @c snarfed from socket.c:388
10691 @deffn {Scheme Procedure} inet-ntop family address
10692 @deffnx {C Function} scm_inet_ntop (family, address)
10693 Convert a network address into a printable string.
10694 Note that unlike the C version of this function,
10695 the input is an integer with normal host byte ordering.
10696 @var{family} can be @code{AF_INET} or @code{AF_INET6}. E.g.,
10697
10698 @lisp
10699 (inet-ntop AF_INET 2130706433) @result{} "127.0.0.1"
10700 (inet-ntop AF_INET6 (- (expt 2 128) 1))
10701 @result{} "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"
10702 @end lisp
10703 @end deffn
10704
10705 \fsocket
10706 @c snarfed from socket.c:430
10707 @deffn {Scheme Procedure} socket family style proto
10708 @deffnx {C Function} scm_socket (family, style, proto)
10709 Return a new socket port of the type specified by @var{family},
10710 @var{style} and @var{proto}. All three parameters are
10711 integers. Supported values for @var{family} are
10712 @code{AF_UNIX}, @code{AF_INET} and @code{AF_INET6}.
10713 Typical values for @var{style} are @code{SOCK_STREAM},
10714 @code{SOCK_DGRAM} and @code{SOCK_RAW}.
10715
10716 @var{proto} can be obtained from a protocol name using
10717 @code{getprotobyname}. A value of zero specifies the default
10718 protocol, which is usually right.
10719
10720 A single socket port cannot by used for communication until it
10721 has been connected to another socket.
10722 @end deffn
10723
10724 \fsocketpair
10725 @c snarfed from socket.c:451
10726 @deffn {Scheme Procedure} socketpair family style proto
10727 @deffnx {C Function} scm_socketpair (family, style, proto)
10728 Return a pair of connected (but unnamed) socket ports of the
10729 type specified by @var{family}, @var{style} and @var{proto}.
10730 Many systems support only socket pairs of the @code{AF_UNIX}
10731 family. Zero is likely to be the only meaningful value for
10732 @var{proto}.
10733 @end deffn
10734
10735 \fgetsockopt
10736 @c snarfed from socket.c:476
10737 @deffn {Scheme Procedure} getsockopt sock level optname
10738 @deffnx {C Function} scm_getsockopt (sock, level, optname)
10739 Return the value of a particular socket option for the socket
10740 port @var{sock}. @var{level} is an integer code for type of
10741 option being requested, e.g., @code{SOL_SOCKET} for
10742 socket-level options. @var{optname} is an integer code for the
10743 option required and should be specified using one of the
10744 symbols @code{SO_DEBUG}, @code{SO_REUSEADDR} etc.
10745
10746 The returned value is typically an integer but @code{SO_LINGER}
10747 returns a pair of integers.
10748 @end deffn
10749
10750 \fsetsockopt
10751 @c snarfed from socket.c:544
10752 @deffn {Scheme Procedure} setsockopt sock level optname value
10753 @deffnx {C Function} scm_setsockopt (sock, level, optname, value)
10754 Set the value of a particular socket option for the socket
10755 port @var{sock}. @var{level} is an integer code for type of option
10756 being set, e.g., @code{SOL_SOCKET} for socket-level options.
10757 @var{optname} is an
10758 integer code for the option to set and should be specified using one of
10759 the symbols @code{SO_DEBUG}, @code{SO_REUSEADDR} etc.
10760 @var{value} is the value to which the option should be set. For
10761 most options this must be an integer, but for @code{SO_LINGER} it must
10762 be a pair.
10763
10764 The return value is unspecified.
10765 @end deffn
10766
10767 \fshutdown
10768 @c snarfed from socket.c:646
10769 @deffn {Scheme Procedure} shutdown sock how
10770 @deffnx {C Function} scm_shutdown (sock, how)
10771 Sockets can be closed simply by using @code{close-port}. The
10772 @code{shutdown} procedure allows reception or transmission on a
10773 connection to be shut down individually, according to the parameter
10774 @var{how}:
10775
10776 @table @asis
10777 @item 0
10778 Stop receiving data for this socket. If further data arrives, reject it.
10779 @item 1
10780 Stop trying to transmit data from this socket. Discard any
10781 data waiting to be sent. Stop looking for acknowledgement of
10782 data already sent; don't retransmit it if it is lost.
10783 @item 2
10784 Stop both reception and transmission.
10785 @end table
10786
10787 The return value is unspecified.
10788 @end deffn
10789
10790 \fconnect
10791 @c snarfed from socket.c:789
10792 @deffn {Scheme Procedure} connect sock fam address . args
10793 @deffnx {C Function} scm_connect (sock, fam, address, args)
10794 Initiate a connection from a socket using a specified address
10795 family to the address
10796 specified by @var{address} and possibly @var{args}.
10797 The format required for @var{address}
10798 and @var{args} depends on the family of the socket.
10799
10800 For a socket of family @code{AF_UNIX},
10801 only @var{address} is specified and must be a string with the
10802 filename where the socket is to be created.
10803
10804 For a socket of family @code{AF_INET},
10805 @var{address} must be an integer IPv4 host address and
10806 @var{args} must be a single integer port number.
10807
10808 For a socket of family @code{AF_INET6},
10809 @var{address} must be an integer IPv6 host address and
10810 @var{args} may be up to three integers:
10811 port [flowinfo] [scope_id],
10812 where flowinfo and scope_id default to zero.
10813
10814 The return value is unspecified.
10815 @end deffn
10816
10817 \fbind
10818 @c snarfed from socket.c:848
10819 @deffn {Scheme Procedure} bind sock fam address . args
10820 @deffnx {C Function} scm_bind (sock, fam, address, args)
10821 Assign an address to the socket port @var{sock}.
10822 Generally this only needs to be done for server sockets,
10823 so they know where to look for incoming connections. A socket
10824 without an address will be assigned one automatically when it
10825 starts communicating.
10826
10827 The format of @var{address} and @var{args} depends
10828 on the family of the socket.
10829
10830 For a socket of family @code{AF_UNIX}, only @var{address}
10831 is specified and must be a string with the filename where
10832 the socket is to be created.
10833
10834 For a socket of family @code{AF_INET}, @var{address}
10835 must be an integer IPv4 address and @var{args}
10836 must be a single integer port number.
10837
10838 The values of the following variables can also be used for
10839 @var{address}:
10840
10841 @defvar INADDR_ANY
10842 Allow connections from any address.
10843 @end defvar
10844
10845 @defvar INADDR_LOOPBACK
10846 The address of the local host using the loopback device.
10847 @end defvar
10848
10849 @defvar INADDR_BROADCAST
10850 The broadcast address on the local network.
10851 @end defvar
10852
10853 @defvar INADDR_NONE
10854 No address.
10855 @end defvar
10856
10857 For a socket of family @code{AF_INET6}, @var{address}
10858 must be an integer IPv6 address and @var{args}
10859 may be up to three integers:
10860 port [flowinfo] [scope_id],
10861 where flowinfo and scope_id default to zero.
10862
10863 The return value is unspecified.
10864 @end deffn
10865
10866 \flisten
10867 @c snarfed from socket.c:881
10868 @deffn {Scheme Procedure} listen sock backlog
10869 @deffnx {C Function} scm_listen (sock, backlog)
10870 Enable @var{sock} to accept connection
10871 requests. @var{backlog} is an integer specifying
10872 the maximum length of the queue for pending connections.
10873 If the queue fills, new clients will fail to connect until
10874 the server calls @code{accept} to accept a connection from
10875 the queue.
10876
10877 The return value is unspecified.
10878 @end deffn
10879
10880 \faccept
10881 @c snarfed from socket.c:993
10882 @deffn {Scheme Procedure} accept sock
10883 @deffnx {C Function} scm_accept (sock)
10884 Accept a connection on a bound, listening socket.
10885 If there
10886 are no pending connections in the queue, wait until
10887 one is available unless the non-blocking option has been
10888 set on the socket.
10889
10890 The return value is a
10891 pair in which the @emph{car} is a new socket port for the
10892 connection and
10893 the @emph{cdr} is an object with address information about the
10894 client which initiated the connection.
10895
10896 @var{sock} does not become part of the
10897 connection and will continue to accept new requests.
10898 @end deffn
10899
10900 \fgetsockname
10901 @c snarfed from socket.c:1020
10902 @deffn {Scheme Procedure} getsockname sock
10903 @deffnx {C Function} scm_getsockname (sock)
10904 Return the address of @var{sock}, in the same form as the
10905 object returned by @code{accept}. On many systems the address
10906 of a socket in the @code{AF_FILE} namespace cannot be read.
10907 @end deffn
10908
10909 \fgetpeername
10910 @c snarfed from socket.c:1042
10911 @deffn {Scheme Procedure} getpeername sock
10912 @deffnx {C Function} scm_getpeername (sock)
10913 Return the address that @var{sock}
10914 is connected to, in the same form as the object returned by
10915 @code{accept}. On many systems the address of a socket in the
10916 @code{AF_FILE} namespace cannot be read.
10917 @end deffn
10918
10919 \frecv!
10920 @c snarfed from socket.c:1077
10921 @deffn {Scheme Procedure} recv! sock buf [flags]
10922 @deffnx {C Function} scm_recv (sock, buf, flags)
10923 Receive data from a socket port.
10924 @var{sock} must already
10925 be bound to the address from which data is to be received.
10926 @var{buf} is a string into which
10927 the data will be written. The size of @var{buf} limits
10928 the amount of
10929 data which can be received: in the case of packet
10930 protocols, if a packet larger than this limit is encountered
10931 then some data
10932 will be irrevocably lost.
10933
10934 The optional @var{flags} argument is a value or
10935 bitwise OR of MSG_OOB, MSG_PEEK, MSG_DONTROUTE etc.
10936
10937 The value returned is the number of bytes read from the
10938 socket.
10939
10940 Note that the data is read directly from the socket file
10941 descriptor:
10942 any unread buffered port data is ignored.
10943 @end deffn
10944
10945 \fsend
10946 @c snarfed from socket.c:1120
10947 @deffn {Scheme Procedure} send sock message [flags]
10948 @deffnx {C Function} scm_send (sock, message, flags)
10949 Transmit the string @var{message} on a socket port @var{sock}.
10950 @var{sock} must already be bound to a destination address. The
10951 value returned is the number of bytes transmitted --
10952 it's possible for
10953 this to be less than the length of @var{message}
10954 if the socket is
10955 set to be non-blocking. The optional @var{flags} argument
10956 is a value or
10957 bitwise OR of MSG_OOB, MSG_PEEK, MSG_DONTROUTE etc.
10958
10959 Note that the data is written directly to the socket
10960 file descriptor:
10961 any unflushed buffered port data is ignored.
10962 @end deffn
10963
10964 \frecvfrom!
10965 @c snarfed from socket.c:1171
10966 @deffn {Scheme Procedure} recvfrom! sock str [flags [start [end]]]
10967 @deffnx {C Function} scm_recvfrom (sock, str, flags, start, end)
10968 Return data from the socket port @var{sock} and also
10969 information about where the data was received from.
10970 @var{sock} must already be bound to the address from which
10971 data is to be received. @code{str}, is a string into which the
10972 data will be written. The size of @var{str} limits the amount
10973 of data which can be received: in the case of packet protocols,
10974 if a packet larger than this limit is encountered then some
10975 data will be irrevocably lost.
10976
10977 The optional @var{flags} argument is a value or bitwise OR of
10978 @code{MSG_OOB}, @code{MSG_PEEK}, @code{MSG_DONTROUTE} etc.
10979
10980 The value returned is a pair: the @emph{car} is the number of
10981 bytes read from the socket and the @emph{cdr} an address object
10982 in the same form as returned by @code{accept}. The address
10983 will given as @code{#f} if not available, as is usually the
10984 case for stream sockets.
10985
10986 The @var{start} and @var{end} arguments specify a substring of
10987 @var{str} to which the data should be written.
10988
10989 Note that the data is read directly from the socket file
10990 descriptor: any unread buffered port data is ignored.
10991 @end deffn
10992
10993 \fsendto
10994 @c snarfed from socket.c:1236
10995 @deffn {Scheme Procedure} sendto sock message fam address . args_and_flags
10996 @deffnx {C Function} scm_sendto (sock, message, fam, address, args_and_flags)
10997 Transmit the string @var{message} on the socket port
10998 @var{sock}. The
10999 destination address is specified using the @var{fam},
11000 @var{address} and
11001 @var{args_and_flags} arguments, in a similar way to the
11002 @code{connect} procedure. @var{args_and_flags} contains
11003 the usual connection arguments optionally followed by
11004 a flags argument, which is a value or
11005 bitwise OR of MSG_OOB, MSG_PEEK, MSG_DONTROUTE etc.
11006
11007 The value returned is the number of bytes transmitted --
11008 it's possible for
11009 this to be less than the length of @var{message} if the
11010 socket is
11011 set to be non-blocking.
11012 Note that the data is written directly to the socket
11013 file descriptor:
11014 any unflushed buffered port data is ignored.
11015 @end deffn
11016
11017 \fregexp?
11018 @c snarfed from regex-posix.c:106
11019 @deffn {Scheme Procedure} regexp? obj
11020 @deffnx {C Function} scm_regexp_p (obj)
11021 Return @code{#t} if @var{obj} is a compiled regular expression,
11022 or @code{#f} otherwise.
11023 @end deffn
11024
11025 \fmake-regexp
11026 @c snarfed from regex-posix.c:151
11027 @deffn {Scheme Procedure} make-regexp pat . flags
11028 @deffnx {C Function} scm_make_regexp (pat, flags)
11029 Compile the regular expression described by @var{pat}, and
11030 return the compiled regexp structure. If @var{pat} does not
11031 describe a legal regular expression, @code{make-regexp} throws
11032 a @code{regular-expression-syntax} error.
11033
11034 The @var{flags} arguments change the behavior of the compiled
11035 regular expression. The following flags may be supplied:
11036
11037 @table @code
11038 @item regexp/icase
11039 Consider uppercase and lowercase letters to be the same when
11040 matching.
11041 @item regexp/newline
11042 If a newline appears in the target string, then permit the
11043 @samp{^} and @samp{$} operators to match immediately after or
11044 immediately before the newline, respectively. Also, the
11045 @samp{.} and @samp{[^...]} operators will never match a newline
11046 character. The intent of this flag is to treat the target
11047 string as a buffer containing many lines of text, and the
11048 regular expression as a pattern that may match a single one of
11049 those lines.
11050 @item regexp/basic
11051 Compile a basic (``obsolete'') regexp instead of the extended
11052 (``modern'') regexps that are the default. Basic regexps do
11053 not consider @samp{|}, @samp{+} or @samp{?} to be special
11054 characters, and require the @samp{@{...@}} and @samp{(...)}
11055 metacharacters to be backslash-escaped (@pxref{Backslash
11056 Escapes}). There are several other differences between basic
11057 and extended regular expressions, but these are the most
11058 significant.
11059 @item regexp/extended
11060 Compile an extended regular expression rather than a basic
11061 regexp. This is the default behavior; this flag will not
11062 usually be needed. If a call to @code{make-regexp} includes
11063 both @code{regexp/basic} and @code{regexp/extended} flags, the
11064 one which comes last will override the earlier one.
11065 @end table
11066 @end deffn
11067
11068 \fregexp-exec
11069 @c snarfed from regex-posix.c:217
11070 @deffn {Scheme Procedure} regexp-exec rx str [start [flags]]
11071 @deffnx {C Function} scm_regexp_exec (rx, str, start, flags)
11072 Match the compiled regular expression @var{rx} against
11073 @code{str}. If the optional integer @var{start} argument is
11074 provided, begin matching from that position in the string.
11075 Return a match structure describing the results of the match,
11076 or @code{#f} if no match could be found.
11077
11078 The @var{flags} arguments change the matching behavior.
11079 The following flags may be supplied:
11080
11081 @table @code
11082 @item regexp/notbol
11083 Operator @samp{^} always fails (unless @code{regexp/newline}
11084 is used). Use this when the beginning of the string should
11085 not be considered the beginning of a line.
11086 @item regexp/noteol
11087 Operator @samp{$} always fails (unless @code{regexp/newline}
11088 is used). Use this when the end of the string should not be
11089 considered the end of a line.
11090 @end table
11091 @end deffn