home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / share / guile / 1.6 / guile-procedures.txt
Encoding:
Text File  |  2006-06-19  |  236.7 KB  |  7,418 lines

  1.  
  2. acons
  3. @c snarfed from alist.c:58
  4. @deffn {Scheme Procedure} acons key value alist
  5. Add a new key-value pair to @var{alist}.  A new pair is
  6. created whose car is @var{key} and whose cdr is @var{value}, and the
  7. pair is consed onto @var{alist}, and the new list is returned.  This
  8. function is @emph{not} destructive; @var{alist} is not modified.
  9. @end deffn
  10.  
  11. sloppy-assq
  12. @c snarfed from alist.c:81
  13. @deffn {Scheme Procedure} sloppy-assq key alist
  14. Behaves like @code{assq} but does not do any error checking.
  15. Recommended only for use in Guile internals.
  16. @end deffn
  17.  
  18. sloppy-assv
  19. @c snarfed from alist.c:99
  20. @deffn {Scheme Procedure} sloppy-assv key alist
  21. Behaves like @code{assv} but does not do any error checking.
  22. Recommended only for use in Guile internals.
  23. @end deffn
  24.  
  25. sloppy-assoc
  26. @c snarfed from alist.c:117
  27. @deffn {Scheme Procedure} sloppy-assoc key alist
  28. Behaves like @code{assoc} but does not do any error checking.
  29. Recommended only for use in Guile internals.
  30. @end deffn
  31.  
  32. assq
  33. @c snarfed from alist.c:144
  34. @deffn {Scheme Procedure} assq key alist
  35. @deffnx {Scheme Procedure} assv key alist
  36. @deffnx {Scheme Procedure} assoc key alist
  37. Fetch the entry in @var{alist} that is associated with @var{key}.  To
  38. decide whether the argument @var{key} matches a particular entry in
  39. @var{alist}, @code{assq} compares keys with @code{eq?}, @code{assv}
  40. uses @code{eqv?} and @code{assoc} uses @code{equal?}.  If @var{key}
  41. cannot be found in @var{alist} (according to whichever equality
  42. predicate is in use), then return @code{#f}.  These functions
  43. return the entire alist entry found (i.e. both the key and the value).
  44. @end deffn
  45.  
  46. assv
  47. @c snarfed from alist.c:165
  48. @deffn {Scheme Procedure} assv key alist
  49. Behaves like @code{assq} but uses @code{eqv?} for key comparison.
  50. @end deffn
  51.  
  52. assoc
  53. @c snarfed from alist.c:186
  54. @deffn {Scheme Procedure} assoc key alist
  55. Behaves like @code{assq} but uses @code{equal?} for key comparison.
  56. @end deffn
  57.  
  58. assq-ref
  59. @c snarfed from alist.c:230
  60. @deffn {Scheme Procedure} assq-ref alist key
  61. @deffnx {Scheme Procedure} assv-ref alist key
  62. @deffnx {Scheme Procedure} assoc-ref alist key
  63. Like @code{assq}, @code{assv} and @code{assoc}, except that only the
  64. value associated with @var{key} in @var{alist} is returned.  These
  65. functions are equivalent to
  66.  
  67. @lisp
  68. (let ((ent (@var{associator} @var{key} @var{alist})))
  69.   (and ent (cdr ent)))
  70. @end lisp
  71.  
  72. where @var{associator} is one of @code{assq}, @code{assv} or @code{assoc}.
  73. @end deffn
  74.  
  75. assv-ref
  76. @c snarfed from alist.c:247
  77. @deffn {Scheme Procedure} assv-ref alist key
  78. Behaves like @code{assq-ref} but uses @code{eqv?} for key comparison.
  79. @end deffn
  80.  
  81. assoc-ref
  82. @c snarfed from alist.c:264
  83. @deffn {Scheme Procedure} assoc-ref alist key
  84. Behaves like @code{assq-ref} but uses @code{equal?} for key comparison.
  85. @end deffn
  86.  
  87. assq-set!
  88. @c snarfed from alist.c:293
  89. @deffn {Scheme Procedure} assq-set! alist key val
  90. @deffnx {Scheme Procedure} assv-set! alist key value
  91. @deffnx {Scheme Procedure} assoc-set! alist key value
  92. Reassociate @var{key} in @var{alist} with @var{value}: find any existing
  93. @var{alist} entry for @var{key} and associate it with the new
  94. @var{value}.  If @var{alist} does not contain an entry for @var{key},
  95. add a new one.  Return the (possibly new) alist.
  96.  
  97. These functions do not attempt to verify the structure of @var{alist},
  98. and so may cause unusual results if passed an object that is not an
  99. association list.
  100. @end deffn
  101.  
  102. assv-set!
  103. @c snarfed from alist.c:311
  104. @deffn {Scheme Procedure} assv-set! alist key val
  105. Behaves like @code{assq-set!} but uses @code{eqv?} for key comparison.
  106. @end deffn
  107.  
  108. assoc-set!
  109. @c snarfed from alist.c:329
  110. @deffn {Scheme Procedure} assoc-set! alist key val
  111. Behaves like @code{assq-set!} but uses @code{equal?} for key comparison.
  112. @end deffn
  113.  
  114. assq-remove!
  115. @c snarfed from alist.c:353
  116. @deffn {Scheme Procedure} assq-remove! alist key
  117. @deffnx {Scheme Procedure} assv-remove! alist key
  118. @deffnx {Scheme Procedure} assoc-remove! alist key
  119. Delete the first entry in @var{alist} associated with @var{key}, and return
  120. the resulting alist.
  121. @end deffn
  122.  
  123. assv-remove!
  124. @c snarfed from alist.c:369
  125. @deffn {Scheme Procedure} assv-remove! alist key
  126. Behaves like @code{assq-remove!} but uses @code{eqv?} for key comparison.
  127. @end deffn
  128.  
  129. assoc-remove!
  130. @c snarfed from alist.c:385
  131. @deffn {Scheme Procedure} assoc-remove! alist key
  132. Behaves like @code{assq-remove!} but uses @code{equal?} for key comparison.
  133. @end deffn
  134.  
  135. make-arbiter
  136. @c snarfed from arbiters.c:82
  137. @deffn {Scheme Procedure} make-arbiter name
  138. Return an object of type arbiter and name @var{name}. Its
  139. state is initially unlocked.  Arbiters are a way to achieve
  140. process synchronization.
  141. @end deffn
  142.  
  143. try-arbiter
  144. @c snarfed from arbiters.c:92
  145. @deffn {Scheme Procedure} try-arbiter arb
  146. Return @code{#t} and lock the arbiter @var{arb} if the arbiter
  147. was unlocked. Otherwise, return @code{#f}.
  148. @end deffn
  149.  
  150. release-arbiter
  151. @c snarfed from arbiters.c:113
  152. @deffn {Scheme Procedure} release-arbiter arb
  153. Return @code{#t} and unlock the arbiter @var{arb} if the
  154. arbiter was locked. Otherwise, return @code{#f}.
  155. @end deffn
  156.  
  157. async
  158. @c snarfed from async.c:288
  159. @deffn {Scheme Procedure} async thunk
  160. Create a new async for the procedure @var{thunk}.
  161. @end deffn
  162.  
  163. system-async
  164. @c snarfed from async.c:298
  165. @deffn {Scheme Procedure} system-async thunk
  166. Create a new async for the procedure @var{thunk}.  Also
  167. add it to the system's list of active async objects.
  168. @end deffn
  169.  
  170. async-mark
  171. @c snarfed from async.c:309
  172. @deffn {Scheme Procedure} async-mark a
  173. Mark the async @var{a} for future execution.
  174. @end deffn
  175.  
  176. system-async-mark
  177. @c snarfed from async.c:325
  178. @deffn {Scheme Procedure} system-async-mark a
  179. Mark the async @var{a} for future execution.
  180. @end deffn
  181.  
  182. run-asyncs
  183. @c snarfed from async.c:345
  184. @deffn {Scheme Procedure} run-asyncs list_of_a
  185. Execute all thunks from the asyncs of the list @var{list_of_a}.
  186. @end deffn
  187.  
  188. noop
  189. @c snarfed from async.c:379
  190. @deffn {Scheme Procedure} noop . args
  191. Do nothing.  When called without arguments, return @code{#f},
  192. otherwise return the first argument.
  193. @end deffn
  194.  
  195. unmask-signals
  196. @c snarfed from async.c:431
  197. @deffn {Scheme Procedure} unmask-signals
  198. Unmask signals. The returned value is not specified.
  199. @end deffn
  200.  
  201. mask-signals
  202. @c snarfed from async.c:442
  203. @deffn {Scheme Procedure} mask-signals
  204. Mask signals. The returned value is not specified.
  205. @end deffn
  206.  
  207. display-error
  208. @c snarfed from backtrace.c:265
  209. @deffn {Scheme Procedure} display-error stack port subr message args rest
  210. Display an error message to the output port @var{port}.
  211. @var{stack} is the saved stack for the error, @var{subr} is
  212. the name of the procedure in which the error occurred and
  213. @var{message} is the actual error message, which may contain
  214. formatting instructions. These will format the arguments in
  215. the list @var{args} accordingly.  @var{rest} is currently
  216. ignored.
  217. @end deffn
  218.  
  219. display-application
  220. @c snarfed from backtrace.c:402
  221. @deffn {Scheme Procedure} display-application frame [port [indent]]
  222. Display a procedure application @var{frame} to the output port
  223. @var{port}. @var{indent} specifies the indentation of the
  224. output.
  225. @end deffn
  226.  
  227. display-backtrace
  228. @c snarfed from backtrace.c:713
  229. @deffn {Scheme Procedure} display-backtrace stack port [first [depth]]
  230. Display a backtrace to the output port @var{port}. @var{stack}
  231. is the stack to take the backtrace from, @var{first} specifies
  232. where in the stack to start and @var{depth} how much frames
  233. to display. Both @var{first} and @var{depth} can be @code{#f},
  234. which means that default values will be used.
  235. @end deffn
  236.  
  237. backtrace
  238. @c snarfed from backtrace.c:736
  239. @deffn {Scheme Procedure} backtrace
  240. Display a backtrace of the stack saved by the last error
  241. to the current output port.
  242. @end deffn
  243.  
  244. not
  245. @c snarfed from boolean.c:54
  246. @deffn {Scheme Procedure} not x
  247. Return @code{#t} iff @var{x} is @code{#f}, else return @code{#f}.
  248. @end deffn
  249.  
  250. boolean?
  251. @c snarfed from boolean.c:64
  252. @deffn {Scheme Procedure} boolean? obj
  253. Return @code{#t} iff @var{obj} is either @code{#t} or @code{#f}.
  254. @end deffn
  255.  
  256. char?
  257. @c snarfed from chars.c:55
  258. @deffn {Scheme Procedure} char? x
  259. Return @code{#t} iff @var{x} is a character, else @code{#f}.
  260. @end deffn
  261.  
  262. char=?
  263. @c snarfed from chars.c:64
  264. @deffn {Scheme Procedure} char=? x y
  265. Return @code{#t} iff @var{x} is the same character as @var{y}, else @code{#f}.
  266. @end deffn
  267.  
  268. char<?
  269. @c snarfed from chars.c:77
  270. @deffn {Scheme Procedure} char<? x y
  271. Return @code{#t} iff @var{x} is less than @var{y} in the ASCII sequence,
  272. else @code{#f}.
  273. @end deffn
  274.  
  275. char<=?
  276. @c snarfed from chars.c:89
  277. @deffn {Scheme Procedure} char<=? x y
  278. Return @code{#t} iff @var{x} is less than or equal to @var{y} in the
  279. ASCII sequence, else @code{#f}.
  280. @end deffn
  281.  
  282. char>?
  283. @c snarfed from chars.c:101
  284. @deffn {Scheme Procedure} char>? x y
  285. Return @code{#t} iff @var{x} is greater than @var{y} in the ASCII
  286. sequence, else @code{#f}.
  287. @end deffn
  288.  
  289. char>=?
  290. @c snarfed from chars.c:113
  291. @deffn {Scheme Procedure} char>=? x y
  292. Return @code{#t} iff @var{x} is greater than or equal to @var{y} in the
  293. ASCII sequence, else @code{#f}.
  294. @end deffn
  295.  
  296. char-ci=?
  297. @c snarfed from chars.c:125
  298. @deffn {Scheme Procedure} char-ci=? x y
  299. Return @code{#t} iff @var{x} is the same character as @var{y} ignoring
  300. case, else @code{#f}.
  301. @end deffn
  302.  
  303. char-ci<?
  304. @c snarfed from chars.c:137
  305. @deffn {Scheme Procedure} char-ci<? x y
  306. Return @code{#t} iff @var{x} is less than @var{y} in the ASCII sequence
  307. ignoring case, else @code{#f}.
  308. @end deffn
  309.  
  310. char-ci<=?
  311. @c snarfed from chars.c:149
  312. @deffn {Scheme Procedure} char-ci<=? x y
  313. Return @code{#t} iff @var{x} is less than or equal to @var{y} in the
  314. ASCII sequence ignoring case, else @code{#f}.
  315. @end deffn
  316.  
  317. char-ci>?
  318. @c snarfed from chars.c:161
  319. @deffn {Scheme Procedure} char-ci>? x y
  320. Return @code{#t} iff @var{x} is greater than @var{y} in the ASCII
  321. sequence ignoring case, else @code{#f}.
  322. @end deffn
  323.  
  324. char-ci>=?
  325. @c snarfed from chars.c:173
  326. @deffn {Scheme Procedure} char-ci>=? x y
  327. Return @code{#t} iff @var{x} is greater than or equal to @var{y} in the
  328. ASCII sequence ignoring case, else @code{#f}.
  329. @end deffn
  330.  
  331. char-alphabetic?
  332. @c snarfed from chars.c:186
  333. @deffn {Scheme Procedure} char-alphabetic? chr
  334. Return @code{#t} iff @var{chr} is alphabetic, else @code{#f}.
  335. Alphabetic means the same thing as the isalpha C library function.
  336. @end deffn
  337.  
  338. char-numeric?
  339. @c snarfed from chars.c:197
  340. @deffn {Scheme Procedure} char-numeric? chr
  341. Return @code{#t} iff @var{chr} is numeric, else @code{#f}.
  342. Numeric means the same thing as the isdigit C library function.
  343. @end deffn
  344.  
  345. char-whitespace?
  346. @c snarfed from chars.c:208
  347. @deffn {Scheme Procedure} char-whitespace? chr
  348. Return @code{#t} iff @var{chr} is whitespace, else @code{#f}.
  349. Whitespace means the same thing as the isspace C library function.
  350. @end deffn
  351.  
  352. char-upper-case?
  353. @c snarfed from chars.c:221
  354. @deffn {Scheme Procedure} char-upper-case? chr
  355. Return @code{#t} iff @var{chr} is uppercase, else @code{#f}.
  356. Uppercase means the same thing as the isupper C library function.
  357. @end deffn
  358.  
  359. char-lower-case?
  360. @c snarfed from chars.c:233
  361. @deffn {Scheme Procedure} char-lower-case? chr
  362. Return @code{#t} iff @var{chr} is lowercase, else @code{#f}.
  363. Lowercase means the same thing as the islower C library function.
  364. @end deffn
  365.  
  366. char-is-both?
  367. @c snarfed from chars.c:247
  368. @deffn {Scheme Procedure} char-is-both? chr
  369. Return @code{#t} iff @var{chr} is either uppercase or lowercase, else @code{#f}.
  370. Uppercase and lowercase are as defined by the isupper and islower
  371. C library functions.
  372. @end deffn
  373.  
  374. char->integer
  375. @c snarfed from chars.c:261
  376. @deffn {Scheme Procedure} char->integer chr
  377. Return the number corresponding to ordinal position of @var{chr} in the
  378. ASCII sequence.
  379. @end deffn
  380.  
  381. integer->char
  382. @c snarfed from chars.c:273
  383. @deffn {Scheme Procedure} integer->char n
  384. Return the character at position @var{n} in the ASCII sequence.
  385. @end deffn
  386.  
  387. char-upcase
  388. @c snarfed from chars.c:284
  389. @deffn {Scheme Procedure} char-upcase chr
  390. Return the uppercase character version of @var{chr}.
  391. @end deffn
  392.  
  393. char-downcase
  394. @c snarfed from chars.c:295
  395. @deffn {Scheme Procedure} char-downcase chr
  396. Return the lowercase character version of @var{chr}.
  397. @end deffn
  398.  
  399. debug-options-interface
  400. @c snarfed from debug.c:79
  401. @deffn {Scheme Procedure} debug-options-interface [setting]
  402. Option interface for the debug options. Instead of using
  403. this procedure directly, use the procedures @code{debug-enable},
  404. @code{debug-disable}, @code{debug-set!} and @code{debug-options}.
  405. @end deffn
  406.  
  407. with-traps
  408. @c snarfed from debug.c:127
  409. @deffn {Scheme Procedure} with-traps thunk
  410. Call @var{thunk} with traps enabled.
  411. @end deffn
  412.  
  413. memoized?
  414. @c snarfed from debug.c:169
  415. @deffn {Scheme Procedure} memoized? obj
  416. Return @code{#t} if @var{obj} is memoized.
  417. @end deffn
  418.  
  419. unmemoize
  420. @c snarfed from debug.c:371
  421. @deffn {Scheme Procedure} unmemoize m
  422. Unmemoize the memoized expression @var{m},
  423. @end deffn
  424.  
  425. memoized-environment
  426. @c snarfed from debug.c:381
  427. @deffn {Scheme Procedure} memoized-environment m
  428. Return the environment of the memoized expression @var{m}.
  429. @end deffn
  430.  
  431. procedure-name
  432. @c snarfed from debug.c:391
  433. @deffn {Scheme Procedure} procedure-name proc
  434. Return the name of the procedure @var{proc}
  435. @end deffn
  436.  
  437. procedure-source
  438. @c snarfed from debug.c:419
  439. @deffn {Scheme Procedure} procedure-source proc
  440. Return the source of the procedure @var{proc}.
  441. @end deffn
  442.  
  443. procedure-environment
  444. @c snarfed from debug.c:470
  445. @deffn {Scheme Procedure} procedure-environment proc
  446. Return the environment of the procedure @var{proc}.
  447. @end deffn
  448.  
  449. local-eval
  450. @c snarfed from debug.c:502
  451. @deffn {Scheme Procedure} local-eval exp [env]
  452. Evaluate @var{exp} in its environment.  If @var{env} is supplied,
  453. it is the environment in which to evaluate @var{exp}.  Otherwise,
  454. @var{exp} must be a memoized code object (in which case, its environment
  455. is implicit).
  456. @end deffn
  457.  
  458. debug-object?
  459. @c snarfed from debug.c:589
  460. @deffn {Scheme Procedure} debug-object? obj
  461. Return @code{#t} if @var{obj} is a debug object.
  462. @end deffn
  463.  
  464. c-registered-modules
  465. @c snarfed from dynl.c:187
  466. @deffn {Scheme Procedure} c-registered-modules
  467. Return a list of the object code modules that have been imported into
  468. the current Guile process.  Each element of the list is a pair whose
  469. car is the name of the module, and whose cdr is the function handle
  470. for that module's initializer function.  The name is the string that
  471. has been passed to scm_register_module_xxx.
  472. @end deffn
  473.  
  474. c-clear-registered-modules
  475. @c snarfed from dynl.c:208
  476. @deffn {Scheme Procedure} c-clear-registered-modules
  477. Destroy the list of modules registered with the current Guile process.
  478. The return value is unspecified.  @strong{Warning:} this function does
  479. not actually unlink or deallocate these modules, but only destroys the
  480. records of which modules have been loaded.  It should therefore be used
  481. only by module bookkeeping operations.
  482. @end deffn
  483.  
  484. dynamic-link
  485. @c snarfed from dynl.c:363
  486. @deffn {Scheme Procedure} dynamic-link filename
  487. Open the dynamic library called @var{filename}.  A library
  488. handle representing the opened library is returned; this handle
  489. should be used as the @var{dobj} argument to the following
  490. functions.
  491. @end deffn
  492.  
  493. dynamic-object?
  494. @c snarfed from dynl.c:379
  495. @deffn {Scheme Procedure} dynamic-object? obj
  496. Return @code{#t} if @var{obj} is a dynamic library handle, or @code{#f}
  497. otherwise.
  498. @end deffn
  499.  
  500. dynamic-unlink
  501. @c snarfed from dynl.c:392
  502. @deffn {Scheme Procedure} dynamic-unlink dobj
  503. Unlink the indicated object file from the application.  The
  504. argument @var{dobj} must have been obtained by a call to
  505. @code{dynamic-link}.  After @code{dynamic-unlink} has been
  506. called on @var{dobj}, its content is no longer accessible.
  507. @end deffn
  508.  
  509. dynamic-func
  510. @c snarfed from dynl.c:419
  511. @deffn {Scheme Procedure} dynamic-func name dobj
  512. Search the dynamic object @var{dobj} for the C function
  513. indicated by the string @var{name} and return some Scheme
  514. handle that can later be used with @code{dynamic-call} to
  515. actually call the function.
  516.  
  517. Regardless whether your C compiler prepends an underscore @samp{_} to
  518. the global names in a program, you should @strong{not} include this
  519. underscore in @var{function}.  Guile knows whether the underscore is
  520. needed or not and will add it when necessary.
  521. @end deffn
  522.  
  523. dynamic-call
  524. @c snarfed from dynl.c:459
  525. @deffn {Scheme Procedure} dynamic-call func dobj
  526. Call the C function indicated by @var{func} and @var{dobj}.
  527. The function is passed no arguments and its return value is
  528. ignored.  When @var{function} is something returned by
  529. @code{dynamic-func}, call that function and ignore @var{dobj}.
  530. When @var{func} is a string , look it up in @var{dynobj}; this
  531. is equivalent to
  532. @smallexample
  533. (dynamic-call (dynamic-func @var{func} @var{dobj} #f))
  534. @end smallexample
  535.  
  536. Interrupts are deferred while the C function is executing (with
  537. @code{SCM_DEFER_INTS}/@code{SCM_ALLOW_INTS}).
  538. @end deffn
  539.  
  540. dynamic-args-call
  541. @c snarfed from dynl.c:487
  542. @deffn {Scheme Procedure} dynamic-args-call func dobj args
  543. Call the C function indicated by @var{func} and @var{dobj},
  544. just like @code{dynamic-call}, but pass it some arguments and
  545. return its return value.  The C function is expected to take
  546. two arguments and return an @code{int}, just like @code{main}:
  547. @smallexample
  548. int c_func (int argc, char **argv);
  549. @end smallexample
  550.  
  551. The parameter @var{args} must be a list of strings and is
  552. converted into an array of @code{char *}.  The array is passed
  553. in @var{argv} and its size in @var{argc}.  The return value is
  554. converted to a Scheme number and returned from the call to
  555. @code{dynamic-args-call}.
  556. @end deffn
  557.  
  558. dynamic-wind
  559. @c snarfed from dynwind.c:119
  560. @deffn {Scheme Procedure} dynamic-wind in_guard thunk out_guard
  561. All three arguments must be 0-argument procedures.
  562. @var{in_guard} is called, then @var{thunk}, then
  563. @var{out_guard}.
  564.  
  565. If, any time during the execution of @var{thunk}, the
  566. continuation of the @code{dynamic_wind} expression is escaped
  567. non-locally, @var{out_guard} is called.  If the continuation of
  568. the dynamic-wind is re-entered, @var{in_guard} is called.  Thus
  569. @var{in_guard} and @var{out_guard} may be called any number of
  570. times.
  571. @lisp
  572. (define x 'normal-binding)
  573. @result{} x
  574. (define a-cont  (call-with-current-continuation
  575.           (lambda (escape)
  576.              (let ((old-x x))
  577.                (dynamic-wind
  578.               ;; in-guard:
  579.               ;;
  580.               (lambda () (set! x 'special-binding))
  581.  
  582.               ;; thunk
  583.               ;;
  584.                (lambda () (display x) (newline)
  585.                      (call-with-current-continuation escape)
  586.                      (display x) (newline)
  587.                      x)
  588.  
  589.               ;; out-guard:
  590.               ;;
  591.               (lambda () (set! x old-x)))))))
  592.  
  593. ;; Prints:
  594. special-binding
  595. ;; Evaluates to:
  596. @result{} a-cont
  597. x
  598. @result{} normal-binding
  599. (a-cont #f)
  600. ;; Prints:
  601. special-binding
  602. ;; Evaluates to:
  603. @result{} a-cont  ;; the value of the (define a-cont...)
  604. x
  605. @result{} normal-binding
  606. a-cont
  607. @result{} special-binding
  608. @end lisp
  609. @end deffn
  610.  
  611. environment?
  612. @c snarfed from environments.c:135
  613. @deffn {Scheme Procedure} environment? obj
  614. Return @code{#t} if @var{obj} is an environment, or @code{#f}
  615. otherwise.
  616. @end deffn
  617.  
  618. environment-bound?
  619. @c snarfed from environments.c:146
  620. @deffn {Scheme Procedure} environment-bound? env sym
  621. Return @code{#t} if @var{sym} is bound in @var{env}, or
  622. @code{#f} otherwise.
  623. @end deffn
  624.  
  625. environment-ref
  626. @c snarfed from environments.c:161
  627. @deffn {Scheme Procedure} environment-ref env sym
  628. Return the value of the location bound to @var{sym} in
  629. @var{env}. If @var{sym} is unbound in @var{env}, signal an
  630. @code{environment:unbound} error.
  631. @end deffn
  632.  
  633. environment-fold
  634. @c snarfed from environments.c:231
  635. @deffn {Scheme Procedure} environment-fold env proc init
  636. Iterate over all the bindings in @var{env}, accumulating some
  637. value.
  638. For each binding in @var{env}, apply @var{proc} to the symbol
  639. bound, its value, and the result from the previous application
  640. of @var{proc}.
  641. Use @var{init} as @var{proc}'s third argument the first time
  642. @var{proc} is applied.
  643. If @var{env} contains no bindings, this function simply returns
  644. @var{init}.
  645. If @var{env} binds the symbol sym1 to the value val1, sym2 to
  646. val2, and so on, then this procedure computes:
  647. @lisp
  648.   (proc sym1 val1
  649.         (proc sym2 val2
  650.               ...
  651.               (proc symn valn
  652.                     init)))
  653. @end lisp
  654. Each binding in @var{env} will be processed exactly once.
  655. @code{environment-fold} makes no guarantees about the order in
  656. which the bindings are processed.
  657. Here is a function which, given an environment, constructs an
  658. association list representing that environment's bindings,
  659. using environment-fold:
  660. @lisp
  661.   (define (environment->alist env)
  662.     (environment-fold env
  663.                       (lambda (sym val tail)
  664.                         (cons (cons sym val) tail))
  665.                       '()))
  666. @end lisp
  667. @end deffn
  668.  
  669. environment-define
  670. @c snarfed from environments.c:266
  671. @deffn {Scheme Procedure} environment-define env sym val
  672. Bind @var{sym} to a new location containing @var{val} in
  673. @var{env}. If @var{sym} is already bound to another location
  674. in @var{env} and the binding is mutable, that binding is
  675. replaced.  The new binding and location are both mutable. The
  676. return value is unspecified.
  677. If @var{sym} is already bound in @var{env}, and the binding is
  678. immutable, signal an @code{environment:immutable-binding} error.
  679. @end deffn
  680.  
  681. environment-undefine
  682. @c snarfed from environments.c:292
  683. @deffn {Scheme Procedure} environment-undefine env sym
  684. Remove any binding for @var{sym} from @var{env}. If @var{sym}
  685. is unbound in @var{env}, do nothing.  The return value is
  686. unspecified.
  687. If @var{sym} is already bound in @var{env}, and the binding is
  688. immutable, signal an @code{environment:immutable-binding} error.
  689. @end deffn
  690.  
  691. environment-set!
  692. @c snarfed from environments.c:320
  693. @deffn {Scheme Procedure} environment-set! env sym val
  694. If @var{env} binds @var{sym} to some location, change that
  695. location's value to @var{val}.  The return value is
  696. unspecified.
  697. If @var{sym} is not bound in @var{env}, signal an
  698. @code{environment:unbound} error.  If @var{env} binds @var{sym}
  699. to an immutable location, signal an
  700. @code{environment:immutable-location} error.
  701. @end deffn
  702.  
  703. environment-cell
  704. @c snarfed from environments.c:355
  705. @deffn {Scheme Procedure} environment-cell env sym for_write
  706. Return the value cell which @var{env} binds to @var{sym}, or
  707. @code{#f} if the binding does not live in a value cell.
  708. The argument @var{for-write} indicates whether the caller
  709. intends to modify the variable's value by mutating the value
  710. cell.  If the variable is immutable, then
  711. @code{environment-cell} signals an
  712. @code{environment:immutable-location} error.
  713. If @var{sym} is unbound in @var{env}, signal an
  714. @code{environment:unbound} error.
  715. If you use this function, you should consider using
  716. @code{environment-observe}, to be notified when @var{sym} gets
  717. re-bound to a new value cell, or becomes undefined.
  718. @end deffn
  719.  
  720. environment-observe
  721. @c snarfed from environments.c:407
  722. @deffn {Scheme Procedure} environment-observe env proc
  723. Whenever @var{env}'s bindings change, apply @var{proc} to
  724. @var{env}.
  725. This function returns an object, token, which you can pass to
  726. @code{environment-unobserve} to remove @var{proc} from the set
  727. of procedures observing @var{env}.  The type and value of
  728. token is unspecified.
  729. @end deffn
  730.  
  731. environment-observe-weak
  732. @c snarfed from environments.c:424
  733. @deffn {Scheme Procedure} environment-observe-weak env proc
  734. This function is the same as environment-observe, except that
  735. the reference @var{env} retains to @var{proc} is a weak
  736. reference. This means that, if there are no other live,
  737. non-weak references to @var{proc}, it will be
  738. garbage-collected, and dropped from @var{env}'s
  739. list of observing procedures.
  740. @end deffn
  741.  
  742. environment-unobserve
  743. @c snarfed from environments.c:460
  744. @deffn {Scheme Procedure} environment-unobserve token
  745. Cancel the observation request which returned the value
  746. @var{token}.  The return value is unspecified.
  747. If a call @code{(environment-observe env proc)} returns
  748. @var{token}, then the call @code{(environment-unobserve token)}
  749. will cause @var{proc} to no longer be called when @var{env}'s
  750. bindings change.
  751. @end deffn
  752.  
  753. make-leaf-environment
  754. @c snarfed from environments.c:1040
  755. @deffn {Scheme Procedure} make-leaf-environment
  756. Create a new leaf environment, containing no bindings.
  757. All bindings and locations created in the new environment
  758. will be mutable.
  759. @end deffn
  760.  
  761. leaf-environment?
  762. @c snarfed from environments.c:1063
  763. @deffn {Scheme Procedure} leaf-environment? object
  764. Return @code{#t} if object is a leaf environment, or @code{#f}
  765. otherwise.
  766. @end deffn
  767.  
  768. make-eval-environment
  769. @c snarfed from environments.c:1429
  770. @deffn {Scheme Procedure} make-eval-environment local imported
  771. Return a new environment object eval whose bindings are the
  772. union of the bindings in the environments @var{local} and
  773. @var{imported}, with bindings from @var{local} taking
  774. precedence. Definitions made in eval are placed in @var{local}.
  775. Applying @code{environment-define} or
  776. @code{environment-undefine} to eval has the same effect as
  777. applying the procedure to @var{local}.
  778. Note that eval incorporates @var{local} and @var{imported} by
  779. reference:
  780. If, after creating eval, the program changes the bindings of
  781. @var{local} or @var{imported}, those changes will be visible
  782. in eval.
  783. Since most Scheme evaluation takes place in eval environments,
  784. they transparently cache the bindings received from @var{local}
  785. and @var{imported}. Thus, the first time the program looks up
  786. a symbol in eval, eval may make calls to @var{local} or
  787. @var{imported} to find their bindings, but subsequent
  788. references to that symbol will be as fast as references to
  789. bindings in finite environments.
  790. In typical use, @var{local} will be a finite environment, and
  791. @var{imported} will be an import environment
  792. @end deffn
  793.  
  794. eval-environment?
  795. @c snarfed from environments.c:1466
  796. @deffn {Scheme Procedure} eval-environment? object
  797. Return @code{#t} if object is an eval environment, or @code{#f}
  798. otherwise.
  799. @end deffn
  800.  
  801. eval-environment-local
  802. @c snarfed from environments.c:1476
  803. @deffn {Scheme Procedure} eval-environment-local env
  804. Return the local environment of eval environment @var{env}.
  805. @end deffn
  806.  
  807. eval-environment-set-local!
  808. @c snarfed from environments.c:1488
  809. @deffn {Scheme Procedure} eval-environment-set-local! env local
  810. Change @var{env}'s local environment to @var{local}.
  811. @end deffn
  812.  
  813. eval-environment-imported
  814. @c snarfed from environments.c:1514
  815. @deffn {Scheme Procedure} eval-environment-imported env
  816. Return the imported environment of eval environment @var{env}.
  817. @end deffn
  818.  
  819. eval-environment-set-imported!
  820. @c snarfed from environments.c:1526
  821. @deffn {Scheme Procedure} eval-environment-set-imported! env imported
  822. Change @var{env}'s imported environment to @var{imported}.
  823. @end deffn
  824.  
  825. make-import-environment
  826. @c snarfed from environments.c:1850
  827. @deffn {Scheme Procedure} make-import-environment imports conflict_proc
  828. Return a new environment @var{imp} whose bindings are the union
  829. of the bindings from the environments in @var{imports};
  830. @var{imports} must be a list of environments. That is,
  831. @var{imp} binds a symbol to a location when some element of
  832. @var{imports} does.
  833. If two different elements of @var{imports} have a binding for
  834. the same symbol, the @var{conflict-proc} is called with the
  835. following parameters:  the import environment, the symbol and
  836. the list of the imported environments that bind the symbol.
  837. If the @var{conflict-proc} returns an environment @var{env},
  838. the conflict is considered as resolved and the binding from
  839. @var{env} is used.  If the @var{conflict-proc} returns some
  840. non-environment object, the conflict is considered unresolved
  841. and the symbol is treated as unspecified in the import
  842. environment.
  843. The checking for conflicts may be performed lazily, i. e. at
  844. the moment when a value or binding for a certain symbol is
  845. requested instead of the moment when the environment is
  846. created or the bindings of the imports change.
  847. All bindings in @var{imp} are immutable. If you apply
  848. @code{environment-define} or @code{environment-undefine} to
  849. @var{imp}, Guile will signal an
  850.  @code{environment:immutable-binding} error. However,
  851. notice that the set of bindings in @var{imp} may still change,
  852. if one of its imported environments changes.
  853. @end deffn
  854.  
  855. import-environment?
  856. @c snarfed from environments.c:1879
  857. @deffn {Scheme Procedure} import-environment? object
  858. Return @code{#t} if object is an import environment, or
  859. @code{#f} otherwise.
  860. @end deffn
  861.  
  862. import-environment-imports
  863. @c snarfed from environments.c:1890
  864. @deffn {Scheme Procedure} import-environment-imports env
  865. Return the list of environments imported by the import
  866. environment @var{env}.
  867. @end deffn
  868.  
  869. import-environment-set-imports!
  870. @c snarfed from environments.c:1903
  871. @deffn {Scheme Procedure} import-environment-set-imports! env imports
  872. Change @var{env}'s list of imported environments to
  873. @var{imports}, and check for conflicts.
  874. @end deffn
  875.  
  876. make-export-environment
  877. @c snarfed from environments.c:2171
  878. @deffn {Scheme Procedure} make-export-environment private signature
  879. Return a new environment @var{exp} containing only those
  880. bindings in private whose symbols are present in
  881. @var{signature}. The @var{private} argument must be an
  882. environment.
  883.  
  884. The environment @var{exp} binds symbol to location when
  885. @var{env} does, and symbol is exported by @var{signature}.
  886.  
  887. @var{signature} is a list specifying which of the bindings in
  888. @var{private} should be visible in @var{exp}. Each element of
  889. @var{signature} should be a list of the form:
  890.   (symbol attribute ...)
  891. where each attribute is one of the following:
  892. @table @asis
  893. @item the symbol @code{mutable-location}
  894.   @var{exp} should treat the
  895.   location bound to symbol as mutable. That is, @var{exp}
  896.   will pass calls to @code{environment-set!} or
  897.   @code{environment-cell} directly through to private.
  898. @item the symbol @code{immutable-location}
  899.   @var{exp} should treat
  900.   the location bound to symbol as immutable. If the program
  901.   applies @code{environment-set!} to @var{exp} and symbol, or
  902.   calls @code{environment-cell} to obtain a writable value
  903.   cell, @code{environment-set!} will signal an
  904.   @code{environment:immutable-location} error. Note that, even
  905.   if an export environment treats a location as immutable, the
  906.   underlying environment may treat it as mutable, so its
  907.   value may change.
  908. @end table
  909. It is an error for an element of signature to specify both
  910. @code{mutable-location} and @code{immutable-location}. If
  911. neither is specified, @code{immutable-location} is assumed.
  912.  
  913. As a special case, if an element of signature is a lone
  914. symbol @var{sym}, it is equivalent to an element of the form
  915. @code{(sym)}.
  916.  
  917. All bindings in @var{exp} are immutable. If you apply
  918. @code{environment-define} or @code{environment-undefine} to
  919. @var{exp}, Guile will signal an
  920. @code{environment:immutable-binding} error. However,
  921. notice that the set of bindings in @var{exp} may still change,
  922. if the bindings in private change.
  923. @end deffn
  924.  
  925. export-environment?
  926. @c snarfed from environments.c:2206
  927. @deffn {Scheme Procedure} export-environment? object
  928. Return @code{#t} if object is an export environment, or
  929. @code{#f} otherwise.
  930. @end deffn
  931.  
  932. export-environment-private
  933. @c snarfed from environments.c:2216
  934. @deffn {Scheme Procedure} export-environment-private env
  935. Return the private environment of export environment @var{env}.
  936. @end deffn
  937.  
  938. export-environment-set-private!
  939. @c snarfed from environments.c:2228
  940. @deffn {Scheme Procedure} export-environment-set-private! env private
  941. Change the private environment of export environment @var{env}.
  942. @end deffn
  943.  
  944. export-environment-signature
  945. @c snarfed from environments.c:2250
  946. @deffn {Scheme Procedure} export-environment-signature env
  947. Return the signature of export environment @var{env}.
  948. @end deffn
  949.  
  950. export-environment-set-signature!
  951. @c snarfed from environments.c:2324
  952. @deffn {Scheme Procedure} export-environment-set-signature! env signature
  953. Change the signature of export environment @var{env}.
  954. @end deffn
  955.  
  956. eq?
  957. @c snarfed from eq.c:62
  958. @deffn {Scheme Procedure} eq? x y
  959. Return @code{#t} iff @var{x} references the same object as @var{y}.
  960. @code{eq?} is similar to @code{eqv?} except that in some cases it is
  961. capable of discerning distinctions finer than those detectable by
  962. @code{eqv?}.
  963. @end deffn
  964.  
  965. eqv?
  966. @c snarfed from eq.c:76
  967. @deffn {Scheme Procedure} eqv? x y
  968. The @code{eqv?} procedure defines a useful equivalence relation on objects.
  969. Briefly, it returns @code{#t} if @var{x} and @var{y} should normally be
  970. regarded as the same object.  This relation is left slightly open to
  971. interpretation, but works for comparing immediate integers, characters,
  972. and inexact numbers.
  973. @end deffn
  974.  
  975. equal?
  976. @c snarfed from eq.c:128
  977. @deffn {Scheme Procedure} equal? x y
  978. Return @code{#t} iff @var{x} and @var{y} are recursively @code{eqv?} equivalent.
  979. @code{equal?} recursively compares the contents of pairs,
  980. vectors, and strings, applying @code{eqv?} on other objects such as
  981. numbers and symbols.  A rule of thumb is that objects are generally
  982. @code{equal?}  if they print the same.  @code{equal?} may fail to
  983. terminate if its arguments are circular data structures.
  984. @end deffn
  985.  
  986. scm-error
  987. @c snarfed from error.c:117
  988. @deffn {Scheme Procedure} scm-error key subr message args data
  989. Raise an error with key @var{key}.  @var{subr} can be a string
  990. naming the procedure associated with the error, or @code{#f}.
  991. @var{message} is the error message string, possibly containing
  992. @code{~S} and @code{~A} escapes.  When an error is reported,
  993. these are replaced by formatting the corresponding members of
  994. @var{args}: @code{~A} (was @code{%s} in older versions of
  995. Guile) formats using @code{display} and @code{~S} (was
  996. @code{%S}) formats using @code{write}.  @var{data} is a list or
  997. @code{#f} depending on @var{key}: if @var{key} is
  998. @code{system-error} then it should be a list containing the
  999. Unix @code{errno} value; If @var{key} is @code{signal} then it
  1000. should be a list containing the Unix signal number; otherwise
  1001. it will usually be @code{#f}.
  1002. @end deffn
  1003.  
  1004. strerror
  1005. @c snarfed from error.c:159
  1006. @deffn {Scheme Procedure} strerror err
  1007. Return the Unix error message corresponding to @var{err}, which
  1008. must be an integer value.
  1009. @end deffn
  1010.  
  1011. apply:nconc2last
  1012. @c snarfed from eval.c:3392
  1013. @deffn {Scheme Procedure} apply:nconc2last lst
  1014. Given a list (@var{arg1} @dots{} @var{args}), this function
  1015. conses the @var{arg1} @dots{} arguments onto the front of
  1016. @var{args}, and returns the resulting list. Note that
  1017. @var{args} is a list; thus, the argument to this function is
  1018. a list whose last element is a list.
  1019. Note: Rather than do new consing, @code{apply:nconc2last}
  1020. destroys its argument, so use with care.
  1021. @end deffn
  1022.  
  1023. force
  1024. @c snarfed from eval.c:3934
  1025. @deffn {Scheme Procedure} force x
  1026. If the promise @var{x} has not been computed yet, compute and
  1027. return @var{x}, otherwise just return the previously computed
  1028. value.
  1029. @end deffn
  1030.  
  1031. promise?
  1032. @c snarfed from eval.c:3957
  1033. @deffn {Scheme Procedure} promise? obj
  1034. Return true if @var{obj} is a promise, i.e. a delayed computation
  1035. (@pxref{Delayed evaluation,,,r5rs.info,The Revised^5 Report on Scheme}).
  1036. @end deffn
  1037.  
  1038. cons-source
  1039. @c snarfed from eval.c:3969
  1040. @deffn {Scheme Procedure} cons-source xorig x y
  1041. Create and return a new pair whose car and cdr are @var{x} and @var{y}.
  1042. Any source properties associated with @var{xorig} are also associated
  1043. with the new pair.
  1044. @end deffn
  1045.  
  1046. copy-tree
  1047. @c snarfed from eval.c:3991
  1048. @deffn {Scheme Procedure} copy-tree obj
  1049. Recursively copy the data tree that is bound to @var{obj}, and return a
  1050. pointer to the new data structure.  @code{copy-tree} recurses down the
  1051. contents of both pairs and vectors (since both cons cells and vector
  1052. cells may point to arbitrary objects), and stops recursing when it hits
  1053. any other object.
  1054. @end deffn
  1055.  
  1056. primitive-eval
  1057. @c snarfed from eval.c:4086
  1058. @deffn {Scheme Procedure} primitive-eval exp
  1059. Evaluate @var{exp} in the top-level environment specified by
  1060. the current module.
  1061. @end deffn
  1062.  
  1063. eval
  1064. @c snarfed from eval.c:4156
  1065. @deffn {Scheme Procedure} eval exp module
  1066. Evaluate @var{exp}, a list representing a Scheme expression,
  1067. in the top-level environment specified by @var{module}.
  1068. While @var{exp} is evaluated (using @code{primitive-eval}),
  1069. @var{module} is made the current module.  The current module
  1070. is reset to its previous value when @var{eval} returns.
  1071. Example: (eval '(+ 1 2) (interaction-environment))
  1072. @end deffn
  1073.  
  1074. eval2
  1075. @c snarfed from eval.c:4200
  1076. @deffn {Scheme Procedure} eval2 obj env_thunk
  1077. Evaluate @var{exp}, a Scheme expression, in the environment
  1078. designated by @var{lookup}, a symbol-lookup function.
  1079. Do not use this version of eval, it does not play well
  1080. with the module system.  Use @code{eval} or
  1081. @code{primitive-eval} instead.
  1082. @end deffn
  1083.  
  1084. eval-options-interface
  1085. @c snarfed from eval.c:1726
  1086. @deffn {Scheme Procedure} eval-options-interface [setting]
  1087. Option interface for the evaluation options. Instead of using
  1088. this procedure directly, use the procedures @code{eval-enable},
  1089. @code{eval-disable}, @code{eval-set!} and @code{eval-options}.
  1090. @end deffn
  1091.  
  1092. evaluator-traps-interface
  1093. @c snarfed from eval.c:1743
  1094. @deffn {Scheme Procedure} evaluator-traps-interface [setting]
  1095. Option interface for the evaluator trap options.
  1096. @end deffn
  1097.  
  1098. defined?
  1099. @c snarfed from evalext.c:75
  1100. @deffn {Scheme Procedure} defined? sym [env]
  1101. 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.
  1102. @end deffn
  1103.  
  1104. map-in-order
  1105. @c snarfed from evalext.c:144
  1106. @deffn {Scheme Procedure} map-in-order
  1107. implemented by the C function "scm_map"
  1108. @end deffn
  1109.  
  1110. self-evaluating?
  1111. @c snarfed from evalext.c:150
  1112. @deffn {Scheme Procedure} self-evaluating? obj
  1113. Return #t for objects which Guile considers self-evaluating
  1114. @end deffn
  1115.  
  1116. load-extension
  1117. @c snarfed from extensions.c:153
  1118. @deffn {Scheme Procedure} load-extension lib init
  1119. Load and initialize the extension designated by LIB and INIT.
  1120. When there is no pre-registered function for LIB/INIT, this is
  1121. equivalent to
  1122.  
  1123. @lisp
  1124. (dynamic-call INIT (dynamic-link LIB))
  1125. @end lisp
  1126.  
  1127. When there is a pre-registered function, that function is called
  1128. instead.
  1129.  
  1130. Normally, there is no pre-registered function.  This option exists
  1131. only for situations where dynamic linking is unavailable or unwanted.
  1132. In that case, you would statically link your program with the desired
  1133. library, and register its init function right after Guile has been
  1134. initialized.
  1135.  
  1136. LIB should be a string denoting a shared library without any file type
  1137. suffix such as ".so".  The suffix is provided automatically.  It
  1138. should also not contain any directory components.  Libraries that
  1139. implement Guile Extensions should be put into the normal locations for
  1140. shared libraries.  We recommend to use the naming convention
  1141. libguile-bla-blum for a extension related to a module `(bla blum)'.
  1142.  
  1143. The normal way for a extension to be used is to write a small Scheme
  1144. file that defines a module, and to load the extension into this
  1145. module.  When the module is auto-loaded, the extension is loaded as
  1146. well.  For example,
  1147.  
  1148. @lisp
  1149. (define-module (bla blum))
  1150.  
  1151. (load-extension "libguile-bla-blum" "bla_init_blum")
  1152. @end lisp
  1153. @end deffn
  1154.  
  1155. program-arguments
  1156. @c snarfed from feature.c:77
  1157. @deffn {Scheme Procedure} program-arguments
  1158. @deffnx {Scheme Procedure} command-line
  1159. Return the list of command line arguments passed to Guile, as a list of
  1160. strings.  The list includes the invoked program name, which is usually
  1161. @code{"guile"}, but excludes switches and parameters for command line
  1162. options like @code{-e} and @code{-l}.
  1163. @end deffn
  1164.  
  1165. make-fluid
  1166. @c snarfed from fluids.c:123
  1167. @deffn {Scheme Procedure} make-fluid
  1168. Return a newly created fluid.
  1169. Fluids are objects of a certain type (a smob) that can hold one SCM
  1170. value per dynamic root.  That is, modifications to this value are
  1171. only visible to code that executes within the same dynamic root as
  1172. the modifying code.  When a new dynamic root is constructed, it
  1173. inherits the values from its parent.  Because each thread executes
  1174. in its own dynamic root, you can use fluids for thread local storage.
  1175. @end deffn
  1176.  
  1177. fluid?
  1178. @c snarfed from fluids.c:136
  1179. @deffn {Scheme Procedure} fluid? obj
  1180. Return @code{#t} iff @var{obj} is a fluid; otherwise, return
  1181. @code{#f}.
  1182. @end deffn
  1183.  
  1184. fluid-ref
  1185. @c snarfed from fluids.c:147
  1186. @deffn {Scheme Procedure} fluid-ref fluid
  1187. Return the value associated with @var{fluid} in the current
  1188. dynamic root.  If @var{fluid} has not been set, then return
  1189. @code{#f}.
  1190. @end deffn
  1191.  
  1192. fluid-set!
  1193. @c snarfed from fluids.c:163
  1194. @deffn {Scheme Procedure} fluid-set! fluid value
  1195. Set the value associated with @var{fluid} in the current dynamic root.
  1196. @end deffn
  1197.  
  1198. with-fluids*
  1199. @c snarfed from fluids.c:222
  1200. @deffn {Scheme Procedure} with-fluids* fluids values thunk
  1201. Set @var{fluids} to @var{values} temporary, and call @var{thunk}.
  1202. @var{fluids} must be a list of fluids and @var{values} must be the same
  1203. number of their values to be applied.  Each substitution is done
  1204. one after another.  @var{thunk} must be a procedure with no argument.
  1205. @end deffn
  1206.  
  1207. setvbuf
  1208. @c snarfed from fports.c:152
  1209. @deffn {Scheme Procedure} setvbuf port mode [size]
  1210. Set the buffering mode for @var{port}.  @var{mode} can be:
  1211. @table @code
  1212. @item _IONBF
  1213. non-buffered
  1214. @item _IOLBF
  1215. line buffered
  1216. @item _IOFBF
  1217. block buffered, using a newly allocated buffer of @var{size} bytes.
  1218. If @var{size} is omitted, a default size will be used.
  1219. @end table
  1220. @end deffn
  1221.  
  1222. file-port?
  1223. @c snarfed from fports.c:234
  1224. @deffn {Scheme Procedure} file-port? obj
  1225. Determine whether @var{obj} is a port that is related to a file.
  1226. @end deffn
  1227.  
  1228. open-file
  1229. @c snarfed from fports.c:288
  1230. @deffn {Scheme Procedure} open-file filename mode
  1231. Open the file whose name is @var{filename}, and return a port
  1232. representing that file.  The attributes of the port are
  1233. determined by the @var{mode} string.  The way in which this is
  1234. interpreted is similar to C stdio.  The first character must be
  1235. one of the following:
  1236. @table @samp
  1237. @item r
  1238. Open an existing file for input.
  1239. @item w
  1240. Open a file for output, creating it if it doesn't already exist
  1241. or removing its contents if it does.
  1242. @item a
  1243. Open a file for output, creating it if it doesn't already
  1244. exist.  All writes to the port will go to the end of the file.
  1245. The "append mode" can be turned off while the port is in use
  1246. @pxref{Ports and File Descriptors, fcntl}
  1247. @end table
  1248. The following additional characters can be appended:
  1249. @table @samp
  1250. @item +
  1251. Open the port for both input and output.  E.g., @code{r+}: open
  1252. an existing file for both input and output.
  1253. @item 0
  1254. Create an "unbuffered" port.  In this case input and output
  1255. operations are passed directly to the underlying port
  1256. implementation without additional buffering.  This is likely to
  1257. slow down I/O operations.  The buffering mode can be changed
  1258. while a port is in use @pxref{Ports and File Descriptors,
  1259. setvbuf}
  1260. @item l
  1261. Add line-buffering to the port.  The port output buffer will be
  1262. automatically flushed whenever a newline character is written.
  1263. @end table
  1264. In theory we could create read/write ports which were buffered
  1265. in one direction only.  However this isn't included in the
  1266. current interfaces.  If a file cannot be opened with the access
  1267. requested, @code{open-file} throws an exception.
  1268. @end deffn
  1269.  
  1270. gc-stats
  1271. @c snarfed from gc.c:795
  1272. @deffn {Scheme Procedure} gc-stats
  1273. Return an association list of statistics about Guile's current
  1274. use of storage.
  1275. @end deffn
  1276.  
  1277. object-address
  1278. @c snarfed from gc.c:892
  1279. @deffn {Scheme Procedure} object-address obj
  1280. Return an integer that for the lifetime of @var{obj} is uniquely
  1281. returned by this function for @var{obj}
  1282. @end deffn
  1283.  
  1284. gc
  1285. @c snarfed from gc.c:903
  1286. @deffn {Scheme Procedure} gc
  1287. Scans all of SCM objects and reclaims for further use those that are
  1288. no longer accessible.
  1289. @end deffn
  1290.  
  1291. %compute-slots
  1292. @c snarfed from goops.c:292
  1293. @deffn {Scheme Procedure} %compute-slots class
  1294. Return a list consisting of the names of all slots belonging to
  1295. class @var{class}, i. e. the slots of @var{class} and of all of
  1296. its superclasses.
  1297. @end deffn
  1298.  
  1299. get-keyword
  1300. @c snarfed from goops.c:377
  1301. @deffn {Scheme Procedure} get-keyword key l default_value
  1302. Determine an associated value for the keyword @var{key} from
  1303. the list @var{l}.  The list @var{l} has to consist of an even
  1304. number of elements, where, starting with the first, every
  1305. second element is a keyword, followed by its associated value.
  1306. If @var{l} does not hold a value for @var{key}, the value
  1307. @var{default_value} is returned.
  1308. @end deffn
  1309.  
  1310. %initialize-object
  1311. @c snarfed from goops.c:400
  1312. @deffn {Scheme Procedure} %initialize-object obj initargs
  1313. Initialize the object @var{obj} with the given arguments
  1314. @var{initargs}.
  1315. @end deffn
  1316.  
  1317. %prep-layout!
  1318. @c snarfed from goops.c:499
  1319. @deffn {Scheme Procedure} %prep-layout! class
  1320.  
  1321. @end deffn
  1322.  
  1323. %inherit-magic!
  1324. @c snarfed from goops.c:605
  1325. @deffn {Scheme Procedure} %inherit-magic! class dsupers
  1326.  
  1327. @end deffn
  1328.  
  1329. instance?
  1330. @c snarfed from goops.c:846
  1331. @deffn {Scheme Procedure} instance? obj
  1332. Return @code{#t} if @var{obj} is an instance.
  1333. @end deffn
  1334.  
  1335. class-name
  1336. @c snarfed from goops.c:861
  1337. @deffn {Scheme Procedure} class-name obj
  1338. Return the class name of @var{obj}.
  1339. @end deffn
  1340.  
  1341. class-direct-supers
  1342. @c snarfed from goops.c:871
  1343. @deffn {Scheme Procedure} class-direct-supers obj
  1344. Return the direct superclasses of the class @var{obj}.
  1345. @end deffn
  1346.  
  1347. class-direct-slots
  1348. @c snarfed from goops.c:881
  1349. @deffn {Scheme Procedure} class-direct-slots obj
  1350. Return the direct slots of the class @var{obj}.
  1351. @end deffn
  1352.  
  1353. class-direct-subclasses
  1354. @c snarfed from goops.c:891
  1355. @deffn {Scheme Procedure} class-direct-subclasses obj
  1356. Return the direct subclasses of the class @var{obj}.
  1357. @end deffn
  1358.  
  1359. class-direct-methods
  1360. @c snarfed from goops.c:901
  1361. @deffn {Scheme Procedure} class-direct-methods obj
  1362. Return the direct methods of the class @var{obj}
  1363. @end deffn
  1364.  
  1365. class-precedence-list
  1366. @c snarfed from goops.c:911
  1367. @deffn {Scheme Procedure} class-precedence-list obj
  1368. Return the class precedence list of the class @var{obj}.
  1369. @end deffn
  1370.  
  1371. class-slots
  1372. @c snarfed from goops.c:921
  1373. @deffn {Scheme Procedure} class-slots obj
  1374. Return the slot list of the class @var{obj}.
  1375. @end deffn
  1376.  
  1377. class-environment
  1378. @c snarfed from goops.c:931
  1379. @deffn {Scheme Procedure} class-environment obj
  1380. Return the environment of the class @var{obj}.
  1381. @end deffn
  1382.  
  1383. generic-function-name
  1384. @c snarfed from goops.c:942
  1385. @deffn {Scheme Procedure} generic-function-name obj
  1386. Return the name of the generic function @var{obj}.
  1387. @end deffn
  1388.  
  1389. generic-function-methods
  1390. @c snarfed from goops.c:952
  1391. @deffn {Scheme Procedure} generic-function-methods obj
  1392. Return the methods of the generic function @var{obj}.
  1393. @end deffn
  1394.  
  1395. method-generic-function
  1396. @c snarfed from goops.c:963
  1397. @deffn {Scheme Procedure} method-generic-function obj
  1398. Return the generic function for the method @var{obj}.
  1399. @end deffn
  1400.  
  1401. method-specializers
  1402. @c snarfed from goops.c:973
  1403. @deffn {Scheme Procedure} method-specializers obj
  1404. Return specializers of the method @var{obj}.
  1405. @end deffn
  1406.  
  1407. method-procedure
  1408. @c snarfed from goops.c:983
  1409. @deffn {Scheme Procedure} method-procedure obj
  1410. Return the procedure of the method @var{obj}.
  1411. @end deffn
  1412.  
  1413. accessor-method-slot-definition
  1414. @c snarfed from goops.c:993
  1415. @deffn {Scheme Procedure} accessor-method-slot-definition obj
  1416. Return the slot definition of the accessor @var{obj}.
  1417. @end deffn
  1418.  
  1419. %tag-body
  1420. @c snarfed from goops.c:1003
  1421. @deffn {Scheme Procedure} %tag-body body
  1422. Internal GOOPS magic---don't use this function!
  1423. @end deffn
  1424.  
  1425. make-unbound
  1426. @c snarfed from goops.c:1018
  1427. @deffn {Scheme Procedure} make-unbound
  1428. Return the unbound value.
  1429. @end deffn
  1430.  
  1431. unbound?
  1432. @c snarfed from goops.c:1027
  1433. @deffn {Scheme Procedure} unbound? obj
  1434. Return @code{#t} if @var{obj} is unbound.
  1435. @end deffn
  1436.  
  1437. assert-bound
  1438. @c snarfed from goops.c:1037
  1439. @deffn {Scheme Procedure} assert-bound value obj
  1440. Return @var{value} if it is bound, and invoke the
  1441. @var{slot-unbound} method of @var{obj} if it is not.
  1442. @end deffn
  1443.  
  1444. @@assert-bound-ref
  1445. @c snarfed from goops.c:1049
  1446. @deffn {Scheme Procedure} @@assert-bound-ref obj index
  1447. Like @code{assert-bound}, but use @var{index} for accessing
  1448. the value from @var{obj}.
  1449. @end deffn
  1450.  
  1451. %fast-slot-ref
  1452. @c snarfed from goops.c:1061
  1453. @deffn {Scheme Procedure} %fast-slot-ref obj index
  1454. Return the slot value with index @var{index} from @var{obj}.
  1455. @end deffn
  1456.  
  1457. %fast-slot-set!
  1458. @c snarfed from goops.c:1078
  1459. @deffn {Scheme Procedure} %fast-slot-set! obj index value
  1460. Set the slot with index @var{index} in @var{obj} to
  1461. @var{value}.
  1462. @end deffn
  1463.  
  1464. slot-ref-using-class
  1465. @c snarfed from goops.c:1206
  1466. @deffn {Scheme Procedure} slot-ref-using-class class obj slot_name
  1467.  
  1468. @end deffn
  1469.  
  1470. slot-set-using-class!
  1471. @c snarfed from goops.c:1225
  1472. @deffn {Scheme Procedure} slot-set-using-class! class obj slot_name value
  1473.  
  1474. @end deffn
  1475.  
  1476. slot-bound-using-class?
  1477. @c snarfed from goops.c:1239
  1478. @deffn {Scheme Procedure} slot-bound-using-class? class obj slot_name
  1479.  
  1480. @end deffn
  1481.  
  1482. slot-exists-using-class?
  1483. @c snarfed from goops.c:1254
  1484. @deffn {Scheme Procedure} slot-exists-using-class? class obj slot_name
  1485.  
  1486. @end deffn
  1487.  
  1488. slot-ref
  1489. @c snarfed from goops.c:1270
  1490. @deffn {Scheme Procedure} slot-ref obj slot_name
  1491. Return the value from @var{obj}'s slot with the name
  1492. @var{slot_name}.
  1493. @end deffn
  1494.  
  1495. slot-set!
  1496. @c snarfed from goops.c:1287
  1497. @deffn {Scheme Procedure} slot-set! obj slot_name value
  1498. Set the slot named @var{slot_name} of @var{obj} to @var{value}.
  1499. @end deffn
  1500.  
  1501. slot-bound?
  1502. @c snarfed from goops.c:1304
  1503. @deffn {Scheme Procedure} slot-bound? obj slot_name
  1504. Return @code{#t} if the slot named @var{slot_name} of @var{obj}
  1505. is bound.
  1506. @end deffn
  1507.  
  1508. slot-exists?
  1509. @c snarfed from goops.c:1322
  1510. @deffn {Scheme Procedure} slot-exists? obj slot_name
  1511. Return @code{#t} if @var{obj} has a slot named @var{slot_name}.
  1512. @end deffn
  1513.  
  1514. %allocate-instance
  1515. @c snarfed from goops.c:1366
  1516. @deffn {Scheme Procedure} %allocate-instance class initargs
  1517. Create a new instance of class @var{class} and initialize it
  1518. from the arguments @var{initargs}.
  1519. @end deffn
  1520.  
  1521. %set-object-setter!
  1522. @c snarfed from goops.c:1439
  1523. @deffn {Scheme Procedure} %set-object-setter! obj setter
  1524.  
  1525. @end deffn
  1526.  
  1527. %modify-instance
  1528. @c snarfed from goops.c:1464
  1529. @deffn {Scheme Procedure} %modify-instance old new
  1530.  
  1531. @end deffn
  1532.  
  1533. %modify-class
  1534. @c snarfed from goops.c:1490
  1535. @deffn {Scheme Procedure} %modify-class old new
  1536.  
  1537. @end deffn
  1538.  
  1539. %invalidate-class
  1540. @c snarfed from goops.c:1514
  1541. @deffn {Scheme Procedure} %invalidate-class class
  1542.  
  1543. @end deffn
  1544.  
  1545. %invalidate-method-cache!
  1546. @c snarfed from goops.c:1637
  1547. @deffn {Scheme Procedure} %invalidate-method-cache! gf
  1548.  
  1549. @end deffn
  1550.  
  1551. generic-capability?
  1552. @c snarfed from goops.c:1663
  1553. @deffn {Scheme Procedure} generic-capability? proc
  1554.  
  1555. @end deffn
  1556.  
  1557. enable-primitive-generic!
  1558. @c snarfed from goops.c:1676
  1559. @deffn {Scheme Procedure} enable-primitive-generic! . subrs
  1560.  
  1561. @end deffn
  1562.  
  1563. primitive-generic-generic
  1564. @c snarfed from goops.c:1696
  1565. @deffn {Scheme Procedure} primitive-generic-generic subr
  1566.  
  1567. @end deffn
  1568.  
  1569. make
  1570. @c snarfed from goops.c:2056
  1571. @deffn {Scheme Procedure} make . args
  1572. Make a new object.  @var{args} must contain the class and
  1573. all necessary initialization information.
  1574. @end deffn
  1575.  
  1576. find-method
  1577. @c snarfed from goops.c:2149
  1578. @deffn {Scheme Procedure} find-method . l
  1579.  
  1580. @end deffn
  1581.  
  1582. %method-more-specific?
  1583. @c snarfed from goops.c:2169
  1584. @deffn {Scheme Procedure} %method-more-specific? m1 m2 targs
  1585.  
  1586. @end deffn
  1587.  
  1588. %goops-loaded
  1589. @c snarfed from goops.c:2696
  1590. @deffn {Scheme Procedure} %goops-loaded
  1591. Announce that GOOPS is loaded and perform initialization
  1592. on the C level which depends on the loaded GOOPS modules.
  1593. @end deffn
  1594.  
  1595. make-guardian
  1596. @c snarfed from guardians.c:334
  1597. @deffn {Scheme Procedure} make-guardian [greedy_p]
  1598. Create a new guardian.
  1599. A guardian protects a set of objects from garbage collection,
  1600. allowing a program to apply cleanup or other actions.
  1601.  
  1602. @code{make-guardian} returns a procedure representing the guardian.
  1603. Calling the guardian procedure with an argument adds the
  1604. argument to the guardian's set of protected objects.
  1605. Calling the guardian procedure without an argument returns
  1606. one of the protected objects which are ready for garbage
  1607. collection, or @code{#f} if no such object is available.
  1608. Objects which are returned in this way are removed from
  1609. the guardian.
  1610.  
  1611. @code{make-guardian} takes one optional argument that says whether the
  1612. new guardian should be greedy or sharing.  If there is any chance
  1613. that any object protected by the guardian may be resurrected,
  1614. then you should make the guardian greedy (this is the default).
  1615.  
  1616. See R. Kent Dybvig, Carl Bruggeman, and David Eby (1993)
  1617. "Guardians in a Generation-Based Garbage Collector".
  1618. ACM SIGPLAN Conference on Programming Language Design
  1619. and Implementation, June 1993.
  1620.  
  1621. (the semantics are slightly different at this point, but the
  1622. paper still (mostly) accurately describes the interface).
  1623. @end deffn
  1624.  
  1625. guardian-destroyed?
  1626. @c snarfed from guardians.c:362
  1627. @deffn {Scheme Procedure} guardian-destroyed? guardian
  1628. Return @code{#t} if @var{guardian} has been destroyed, otherwise @code{#f}.
  1629. @end deffn
  1630.  
  1631. guardian-greedy?
  1632. @c snarfed from guardians.c:380
  1633. @deffn {Scheme Procedure} guardian-greedy? guardian
  1634. Return @code{#t} if @var{guardian} is a greedy guardian, otherwise @code{#f}.
  1635. @end deffn
  1636.  
  1637. destroy-guardian!
  1638. @c snarfed from guardians.c:391
  1639. @deffn {Scheme Procedure} destroy-guardian! guardian
  1640. Destroys @var{guardian}, by making it impossible to put any more
  1641. objects in it or get any objects from it.  It also unguards any
  1642. objects guarded by @var{guardian}.
  1643. @end deffn
  1644.  
  1645. hashq
  1646. @c snarfed from hash.c:201
  1647. @deffn {Scheme Procedure} hashq key size
  1648. Determine a hash value for @var{key} that is suitable for
  1649. lookups in a hashtable of size @var{size}, where @code{eq?} is
  1650. used as the equality predicate.  The function returns an
  1651. integer in the range 0 to @var{size} - 1.  Note that
  1652. @code{hashq} may use internal addresses.  Thus two calls to
  1653. hashq where the keys are @code{eq?} are not guaranteed to
  1654. deliver the same value if the key object gets garbage collected
  1655. in between.  This can happen, for example with symbols:
  1656. @code{(hashq 'foo n) (gc) (hashq 'foo n)} may produce two
  1657. different values, since @code{foo} will be garbage collected.
  1658. @end deffn
  1659.  
  1660. hashv
  1661. @c snarfed from hash.c:237
  1662. @deffn {Scheme Procedure} hashv key size
  1663. Determine a hash value for @var{key} that is suitable for
  1664. lookups in a hashtable of size @var{size}, where @code{eqv?} is
  1665. used as the equality predicate.  The function returns an
  1666. integer in the range 0 to @var{size} - 1.  Note that
  1667. @code{(hashv key)} may use internal addresses.  Thus two calls
  1668. to hashv where the keys are @code{eqv?} are not guaranteed to
  1669. deliver the same value if the key object gets garbage collected
  1670. in between.  This can happen, for example with symbols:
  1671. @code{(hashv 'foo n) (gc) (hashv 'foo n)} may produce two
  1672. different values, since @code{foo} will be garbage collected.
  1673. @end deffn
  1674.  
  1675. hash
  1676. @c snarfed from hash.c:260
  1677. @deffn {Scheme Procedure} hash key size
  1678. Determine a hash value for @var{key} that is suitable for
  1679. lookups in a hashtable of size @var{size}, where @code{equal?}
  1680. is used as the equality predicate.  The function returns an
  1681. integer in the range 0 to @var{size} - 1.
  1682. @end deffn
  1683.  
  1684. hashq-get-handle
  1685. @c snarfed from hashtab.c:172
  1686. @deffn {Scheme Procedure} hashq-get-handle table key
  1687. This procedure returns the @code{(key . value)} pair from the
  1688. hash table @var{table}.  If @var{table} does not hold an
  1689. associated value for @var{key}, @code{#f} is returned.
  1690. Uses @code{eq?} for equality testing.
  1691. @end deffn
  1692.  
  1693. hashq-create-handle!
  1694. @c snarfed from hashtab.c:184
  1695. @deffn {Scheme Procedure} hashq-create-handle! table key init
  1696. This function looks up @var{key} in @var{table} and returns its handle.
  1697. If @var{key} is not already present, a new handle is created which
  1698. associates @var{key} with @var{init}.
  1699. @end deffn
  1700.  
  1701. hashq-ref
  1702. @c snarfed from hashtab.c:197
  1703. @deffn {Scheme Procedure} hashq-ref table key [dflt]
  1704. Look up @var{key} in the hash table @var{table}, and return the
  1705. value (if any) associated with it.  If @var{key} is not found,
  1706. return @var{default} (or @code{#f} if no @var{default} argument
  1707. is supplied).  Uses @code{eq?} for equality testing.
  1708. @end deffn
  1709.  
  1710. hashq-set!
  1711. @c snarfed from hashtab.c:211
  1712. @deffn {Scheme Procedure} hashq-set! table key val
  1713. Find the entry in @var{table} associated with @var{key}, and
  1714. store @var{value} there. Uses @code{eq?} for equality testing.
  1715. @end deffn
  1716.  
  1717. hashq-remove!
  1718. @c snarfed from hashtab.c:223
  1719. @deffn {Scheme Procedure} hashq-remove! table key
  1720. Remove @var{key} (and any value associated with it) from
  1721. @var{table}.  Uses @code{eq?} for equality tests.
  1722. @end deffn
  1723.  
  1724. hashv-get-handle
  1725. @c snarfed from hashtab.c:239
  1726. @deffn {Scheme Procedure} hashv-get-handle table key
  1727. This procedure returns the @code{(key . value)} pair from the
  1728. hash table @var{table}.  If @var{table} does not hold an
  1729. associated value for @var{key}, @code{#f} is returned.
  1730. Uses @code{eqv?} for equality testing.
  1731. @end deffn
  1732.  
  1733. hashv-create-handle!
  1734. @c snarfed from hashtab.c:251
  1735. @deffn {Scheme Procedure} hashv-create-handle! table key init
  1736. This function looks up @var{key} in @var{table} and returns its handle.
  1737. If @var{key} is not already present, a new handle is created which
  1738. associates @var{key} with @var{init}.
  1739. @end deffn
  1740.  
  1741. hashv-ref
  1742. @c snarfed from hashtab.c:265
  1743. @deffn {Scheme Procedure} hashv-ref table key [dflt]
  1744. Look up @var{key} in the hash table @var{table}, and return the
  1745. value (if any) associated with it.  If @var{key} is not found,
  1746. return @var{default} (or @code{#f} if no @var{default} argument
  1747. is supplied).  Uses @code{eqv?} for equality testing.
  1748. @end deffn
  1749.  
  1750. hashv-set!
  1751. @c snarfed from hashtab.c:279
  1752. @deffn {Scheme Procedure} hashv-set! table key val
  1753. Find the entry in @var{table} associated with @var{key}, and
  1754. store @var{value} there. Uses @code{eqv?} for equality testing.
  1755. @end deffn
  1756.  
  1757. hashv-remove!
  1758. @c snarfed from hashtab.c:290
  1759. @deffn {Scheme Procedure} hashv-remove! table key
  1760. Remove @var{key} (and any value associated with it) from
  1761. @var{table}.  Uses @code{eqv?} for equality tests.
  1762. @end deffn
  1763.  
  1764. hash-get-handle
  1765. @c snarfed from hashtab.c:305
  1766. @deffn {Scheme Procedure} hash-get-handle table key
  1767. This procedure returns the @code{(key . value)} pair from the
  1768. hash table @var{table}.  If @var{table} does not hold an
  1769. associated value for @var{key}, @code{#f} is returned.
  1770. Uses @code{equal?} for equality testing.
  1771. @end deffn
  1772.  
  1773. hash-create-handle!
  1774. @c snarfed from hashtab.c:317
  1775. @deffn {Scheme Procedure} hash-create-handle! table key init
  1776. This function looks up @var{key} in @var{table} and returns its handle.
  1777. If @var{key} is not already present, a new handle is created which
  1778. associates @var{key} with @var{init}.
  1779. @end deffn
  1780.  
  1781. hash-ref
  1782. @c snarfed from hashtab.c:330
  1783. @deffn {Scheme Procedure} hash-ref table key [dflt]
  1784. Look up @var{key} in the hash table @var{table}, and return the
  1785. value (if any) associated with it.  If @var{key} is not found,
  1786. return @var{default} (or @code{#f} if no @var{default} argument
  1787. is supplied).  Uses @code{equal?} for equality testing.
  1788. @end deffn
  1789.  
  1790. hash-set!
  1791. @c snarfed from hashtab.c:345
  1792. @deffn {Scheme Procedure} hash-set! table key val
  1793. Find the entry in @var{table} associated with @var{key}, and
  1794. store @var{value} there. Uses @code{equal?} for equality
  1795. testing.
  1796. @end deffn
  1797.  
  1798. hash-remove!
  1799. @c snarfed from hashtab.c:357
  1800. @deffn {Scheme Procedure} hash-remove! table key
  1801. Remove @var{key} (and any value associated with it) from
  1802. @var{table}.  Uses @code{equal?} for equality tests.
  1803. @end deffn
  1804.  
  1805. hashx-get-handle
  1806. @c snarfed from hashtab.c:421
  1807. @deffn {Scheme Procedure} hashx-get-handle hash assoc table key
  1808. This behaves the same way as the corresponding
  1809. @code{-get-handle} function, but uses @var{hash} as a hash
  1810. function and @var{assoc} to compare keys.  @code{hash} must be
  1811. a function that takes two arguments, a key to be hashed and a
  1812. table size.  @code{assoc} must be an associator function, like
  1813. @code{assoc}, @code{assq} or @code{assv}.
  1814. @end deffn
  1815.  
  1816. hashx-create-handle!
  1817. @c snarfed from hashtab.c:440
  1818. @deffn {Scheme Procedure} hashx-create-handle! hash assoc table key init
  1819. This behaves the same way as the corresponding
  1820. @code{-create-handle} function, but uses @var{hash} as a hash
  1821. function and @var{assoc} to compare keys.  @code{hash} must be
  1822. a function that takes two arguments, a key to be hashed and a
  1823. table size.  @code{assoc} must be an associator function, like
  1824. @code{assoc}, @code{assq} or @code{assv}.
  1825. @end deffn
  1826.  
  1827. hashx-ref
  1828. @c snarfed from hashtab.c:463
  1829. @deffn {Scheme Procedure} hashx-ref hash assoc table key [dflt]
  1830. This behaves the same way as the corresponding @code{ref}
  1831. function, but uses @var{hash} as a hash function and
  1832. @var{assoc} to compare keys.  @code{hash} must be a function
  1833. that takes two arguments, a key to be hashed and a table size.
  1834. @code{assoc} must be an associator function, like @code{assoc},
  1835. @code{assq} or @code{assv}.
  1836.  
  1837. By way of illustration, @code{hashq-ref table key} is
  1838. equivalent to @code{hashx-ref hashq assq table key}.
  1839. @end deffn
  1840.  
  1841. hashx-set!
  1842. @c snarfed from hashtab.c:489
  1843. @deffn {Scheme Procedure} hashx-set! hash assoc table key val
  1844. This behaves the same way as the corresponding @code{set!}
  1845. function, but uses @var{hash} as a hash function and
  1846. @var{assoc} to compare keys.  @code{hash} must be a function
  1847. that takes two arguments, a key to be hashed and a table size.
  1848. @code{assoc} must be an associator function, like @code{assoc},
  1849. @code{assq} or @code{assv}.
  1850.  
  1851.  By way of illustration, @code{hashq-set! table key} is
  1852. equivalent to @code{hashx-set!  hashq assq table key}.
  1853. @end deffn
  1854.  
  1855. hash-fold
  1856. @c snarfed from hashtab.c:527
  1857. @deffn {Scheme Procedure} hash-fold proc init table
  1858. An iterator over hash-table elements.
  1859. Accumulates and returns a result by applying PROC successively.
  1860. The arguments to PROC are "(key value prior-result)" where key
  1861. and value are successive pairs from the hash table TABLE, and
  1862. prior-result is either INIT (for the first application of PROC)
  1863. or the return value of the previous application of PROC.
  1864. For example, @code{(hash-fold acons '() tab)} will convert a hash
  1865. table into an a-list of key-value pairs.
  1866. @end deffn
  1867.  
  1868. make-hook
  1869. @c snarfed from hooks.c:190
  1870. @deffn {Scheme Procedure} make-hook [n_args]
  1871. Create a hook for storing procedure of arity @var{n_args}.
  1872. @var{n_args} defaults to zero.  The returned value is a hook
  1873. object to be used with the other hook procedures.
  1874. @end deffn
  1875.  
  1876. hook?
  1877. @c snarfed from hooks.c:213
  1878. @deffn {Scheme Procedure} hook? x
  1879. Return @code{#t} if @var{x} is a hook, @code{#f} otherwise.
  1880. @end deffn
  1881.  
  1882. hook-empty?
  1883. @c snarfed from hooks.c:224
  1884. @deffn {Scheme Procedure} hook-empty? hook
  1885. Return @code{#t} if @var{hook} is an empty hook, @code{#f}
  1886. otherwise.
  1887. @end deffn
  1888.  
  1889. add-hook!
  1890. @c snarfed from hooks.c:238
  1891. @deffn {Scheme Procedure} add-hook! hook proc [append_p]
  1892. Add the procedure @var{proc} to the hook @var{hook}. The
  1893. procedure is added to the end if @var{append_p} is true,
  1894. otherwise it is added to the front.  The return value of this
  1895. procedure is not specified.
  1896. @end deffn
  1897.  
  1898. remove-hook!
  1899. @c snarfed from hooks.c:265
  1900. @deffn {Scheme Procedure} remove-hook! hook proc
  1901. Remove the procedure @var{proc} from the hook @var{hook}.  The
  1902. return value of this procedure is not specified.
  1903. @end deffn
  1904.  
  1905. reset-hook!
  1906. @c snarfed from hooks.c:279
  1907. @deffn {Scheme Procedure} reset-hook! hook
  1908. Remove all procedures from the hook @var{hook}.  The return
  1909. value of this procedure is not specified.
  1910. @end deffn
  1911.  
  1912. run-hook
  1913. @c snarfed from hooks.c:293
  1914. @deffn {Scheme Procedure} run-hook hook . args
  1915. Apply all procedures from the hook @var{hook} to the arguments
  1916. @var{args}.  The order of the procedure application is first to
  1917. last.  The return value of this procedure is not specified.
  1918. @end deffn
  1919.  
  1920. hook->list
  1921. @c snarfed from hooks.c:320
  1922. @deffn {Scheme Procedure} hook->list hook
  1923. Convert the procedure list of @var{hook} to a list.
  1924. @end deffn
  1925.  
  1926. ftell
  1927. @c snarfed from ioext.c:70
  1928. @deffn {Scheme Procedure} ftell fd_port
  1929. Return an integer representing the current position of
  1930. @var{fd/port}, measured from the beginning.  Equivalent to:
  1931.  
  1932. @lisp
  1933. (seek port 0 SEEK_CUR)
  1934. @end lisp
  1935. @end deffn
  1936.  
  1937. redirect-port
  1938. @c snarfed from ioext.c:88
  1939. @deffn {Scheme Procedure} redirect-port old new
  1940. This procedure takes two ports and duplicates the underlying file
  1941. descriptor from @var{old-port} into @var{new-port}.  The
  1942. current file descriptor in @var{new-port} will be closed.
  1943. After the redirection the two ports will share a file position
  1944. and file status flags.
  1945.  
  1946. The return value is unspecified.
  1947.  
  1948. Unexpected behaviour can result if both ports are subsequently used
  1949. and the original and/or duplicate ports are buffered.
  1950.  
  1951. This procedure does not have any side effects on other ports or
  1952. revealed counts.
  1953. @end deffn
  1954.  
  1955. dup->fdes
  1956. @c snarfed from ioext.c:127
  1957. @deffn {Scheme Procedure} dup->fdes fd_or_port [fd]
  1958. Return a new integer file descriptor referring to the open file
  1959. designated by @var{fd_or_port}, which must be either an open
  1960. file port or a file descriptor.
  1961. @end deffn
  1962.  
  1963. dup2
  1964. @c snarfed from ioext.c:174
  1965. @deffn {Scheme Procedure} dup2 oldfd newfd
  1966. A simple wrapper for the @code{dup2} system call.
  1967. Copies the file descriptor @var{oldfd} to descriptor
  1968. number @var{newfd}, replacing the previous meaning
  1969. of @var{newfd}.  Both @var{oldfd} and @var{newfd} must
  1970. be integers.
  1971. Unlike for dup->fdes or primitive-move->fdes, no attempt
  1972. is made to move away ports which are using @var{newfd}.
  1973. The return value is unspecified.
  1974. @end deffn
  1975.  
  1976. fileno
  1977. @c snarfed from ioext.c:193
  1978. @deffn {Scheme Procedure} fileno port
  1979. Return the integer file descriptor underlying @var{port}.  Does
  1980. not change its revealed count.
  1981. @end deffn
  1982.  
  1983. isatty?
  1984. @c snarfed from ioext.c:213
  1985. @deffn {Scheme Procedure} isatty? port
  1986. Return @code{#t} if @var{port} is using a serial non--file
  1987. device, otherwise @code{#f}.
  1988. @end deffn
  1989.  
  1990. fdopen
  1991. @c snarfed from ioext.c:235
  1992. @deffn {Scheme Procedure} fdopen fdes modes
  1993. Return a new port based on the file descriptor @var{fdes}.
  1994. Modes are given by the string @var{modes}.  The revealed count
  1995. of the port is initialized to zero.  The modes string is the
  1996. same as that accepted by @ref{File Ports, open-file}.
  1997. @end deffn
  1998.  
  1999. primitive-move->fdes
  2000. @c snarfed from ioext.c:260
  2001. @deffn {Scheme Procedure} primitive-move->fdes port fd
  2002. Moves the underlying file descriptor for @var{port} to the integer
  2003. value @var{fdes} without changing the revealed count of @var{port}.
  2004. Any other ports already using this descriptor will be automatically
  2005. shifted to new descriptors and their revealed counts reset to zero.
  2006. The return value is @code{#f} if the file descriptor already had the
  2007. required value or @code{#t} if it was moved.
  2008. @end deffn
  2009.  
  2010. fdes->ports
  2011. @c snarfed from ioext.c:294
  2012. @deffn {Scheme Procedure} fdes->ports fd
  2013. Return a list of existing ports which have @var{fdes} as an
  2014. underlying file descriptor, without changing their revealed
  2015. counts.
  2016. @end deffn
  2017.  
  2018. make-keyword-from-dash-symbol
  2019. @c snarfed from keywords.c:74
  2020. @deffn {Scheme Procedure} make-keyword-from-dash-symbol symbol
  2021. Make a keyword object from a @var{symbol} that starts with a dash.
  2022. @end deffn
  2023.  
  2024. keyword?
  2025. @c snarfed from keywords.c:113
  2026. @deffn {Scheme Procedure} keyword? obj
  2027. Return @code{#t} if the argument @var{obj} is a keyword, else
  2028. @code{#f}.
  2029. @end deffn
  2030.  
  2031. keyword-dash-symbol
  2032. @c snarfed from keywords.c:124
  2033. @deffn {Scheme Procedure} keyword-dash-symbol keyword
  2034. Return the dash symbol for @var{keyword}.
  2035. This is the inverse of @code{make-keyword-from-dash-symbol}.
  2036. @end deffn
  2037.  
  2038. nil-cons
  2039. @c snarfed from lang.c:69
  2040. @deffn {Scheme Procedure} nil-cons x y
  2041. Create a new cons cell with @var{x} as the car and @var{y} as
  2042. the cdr, but convert @var{y} to Scheme's end-of-list if it is
  2043. a LISP nil.
  2044. @end deffn
  2045.  
  2046. nil-car
  2047. @c snarfed from lang.c:84
  2048. @deffn {Scheme Procedure} nil-car x
  2049. Return the car of @var{x}, but convert it to LISP nil if it
  2050. is Scheme's end-of-list.
  2051. @end deffn
  2052.  
  2053. nil-cdr
  2054. @c snarfed from lang.c:97
  2055. @deffn {Scheme Procedure} nil-cdr x
  2056. Return the cdr of @var{x}, but convert it to LISP nil if it
  2057. is Scheme's end-of-list.
  2058. @end deffn
  2059.  
  2060. null
  2061. @c snarfed from lang.c:112
  2062. @deffn {Scheme Procedure} null x
  2063. Return LISP's @code{t} if @var{x} is nil in the LISP sense,
  2064. return LISP's nil otherwise.
  2065. @end deffn
  2066.  
  2067. nil-eq
  2068. @c snarfed from lang.c:141
  2069. @deffn {Scheme Procedure} nil-eq x y
  2070. Compare @var{x} and @var{y} and return LISP's t if they are
  2071. @code{eq?}, return LISP's nil otherwise.
  2072. @end deffn
  2073.  
  2074. list*
  2075. @c snarfed from list.c:122
  2076. @deffn {Scheme Procedure} list*
  2077. implemented by the C function "scm_cons_star"
  2078. @end deffn
  2079.  
  2080. cons*
  2081. @c snarfed from list.c:133
  2082. @deffn {Scheme Procedure} cons* arg . rest
  2083. Like @code{list}, but the last arg provides the tail of the
  2084. constructed list, returning @code{(cons @var{arg1} (cons
  2085. @var{arg2} (cons @dots{} @var{argn})))}.  Requires at least one
  2086. argument.  If given one argument, that argument is returned as
  2087. result.  This function is called @code{list*} in some other
  2088. Schemes and in Common LISP.
  2089. @end deffn
  2090.  
  2091. null?
  2092. @c snarfed from list.c:159
  2093. @deffn {Scheme Procedure} null? x
  2094. Return @code{#t} iff @var{x} is the empty list, else @code{#f}.
  2095. @end deffn
  2096.  
  2097. list?
  2098. @c snarfed from list.c:169
  2099. @deffn {Scheme Procedure} list? x
  2100. Return @code{#t} iff @var{x} is a proper list, else @code{#f}.
  2101. @end deffn
  2102.  
  2103. length
  2104. @c snarfed from list.c:210
  2105. @deffn {Scheme Procedure} length lst
  2106. Return the number of elements in list @var{lst}.
  2107. @end deffn
  2108.  
  2109. append
  2110. @c snarfed from list.c:239
  2111. @deffn {Scheme Procedure} append . args
  2112. Return a list consisting of the elements the lists passed as
  2113. arguments.
  2114. @lisp
  2115. (append '(x) '(y))          @result{}  (x y)
  2116. (append '(a) '(b c d))      @result{}  (a b c d)
  2117. (append '(a (b)) '((c)))    @result{}  (a (b) (c))
  2118. @end lisp
  2119. The resulting list is always newly allocated, except that it
  2120. shares structure with the last list argument.  The last
  2121. argument may actually be any object; an improper list results
  2122. if the last argument is not a proper list.
  2123. @lisp
  2124. (append '(a b) '(c . d))    @result{}  (a b c . d)
  2125. (append '() 'a)             @result{}  a
  2126. @end lisp
  2127. @end deffn
  2128.  
  2129. append!
  2130. @c snarfed from list.c:275
  2131. @deffn {Scheme Procedure} append! . lists
  2132. A destructive version of @code{append} (@pxref{Pairs and
  2133. Lists,,,r5rs, The Revised^5 Report on Scheme}).  The cdr field
  2134. of each list's final pair is changed to point to the head of
  2135. the next list, so no consing is performed.  Return a pointer to
  2136. the mutated list.
  2137. @end deffn
  2138.  
  2139. last-pair
  2140. @c snarfed from list.c:301
  2141. @deffn {Scheme Procedure} last-pair lst
  2142. Return a pointer to the last pair in @var{lst}, signalling an error if
  2143. @var{lst} is circular.
  2144. @end deffn
  2145.  
  2146. reverse
  2147. @c snarfed from list.c:331
  2148. @deffn {Scheme Procedure} reverse lst
  2149. Return a new list that contains the elements of @var{lst} but
  2150. in reverse order.
  2151. @end deffn
  2152.  
  2153. reverse!
  2154. @c snarfed from list.c:365
  2155. @deffn {Scheme Procedure} reverse! lst [new_tail]
  2156. A destructive version of @code{reverse} (@pxref{Pairs and Lists,,,r5rs,
  2157. The Revised^5 Report on Scheme}).  The cdr of each cell in @var{lst} is
  2158. modified to point to the previous list element.  Return a pointer to the
  2159. head of the reversed list.
  2160.  
  2161. Caveat: because the list is modified in place, the tail of the original
  2162. list now becomes its head, and the head of the original list now becomes
  2163. the tail.  Therefore, the @var{lst} symbol to which the head of the
  2164. original list was bound now points to the tail.  To ensure that the head
  2165. of the modified list is not lost, it is wise to save the return value of
  2166. @code{reverse!}
  2167. @end deffn
  2168.  
  2169. list-ref
  2170. @c snarfed from list.c:391
  2171. @deffn {Scheme Procedure} list-ref list k
  2172. Return the @var{k}th element from @var{list}.
  2173. @end deffn
  2174.  
  2175. list-set!
  2176. @c snarfed from list.c:415
  2177. @deffn {Scheme Procedure} list-set! list k val
  2178. Set the @var{k}th element of @var{list} to @var{val}.
  2179. @end deffn
  2180.  
  2181. list-cdr-ref
  2182. @c snarfed from list.c:438
  2183. @deffn {Scheme Procedure} list-cdr-ref
  2184. implemented by the C function "scm_list_tail"
  2185. @end deffn
  2186.  
  2187. list-tail
  2188. @c snarfed from list.c:447
  2189. @deffn {Scheme Procedure} list-tail lst k
  2190. @deffnx {Scheme Procedure} list-cdr-ref lst k
  2191. Return the "tail" of @var{lst} beginning with its @var{k}th element.
  2192. The first element of the list is considered to be element 0.
  2193.  
  2194. @code{list-tail} and @code{list-cdr-ref} are identical.  It may help to
  2195. think of @code{list-cdr-ref} as accessing the @var{k}th cdr of the list,
  2196. or returning the results of cdring @var{k} times down @var{lst}.
  2197. @end deffn
  2198.  
  2199. list-cdr-set!
  2200. @c snarfed from list.c:463
  2201. @deffn {Scheme Procedure} list-cdr-set! list k val
  2202. Set the @var{k}th cdr of @var{list} to @var{val}.
  2203. @end deffn
  2204.  
  2205. list-head
  2206. @c snarfed from list.c:492
  2207. @deffn {Scheme Procedure} list-head lst k
  2208. Copy the first @var{k} elements from @var{lst} into a new list, and
  2209. return it.
  2210. @end deffn
  2211.  
  2212. list-copy
  2213. @c snarfed from list.c:516
  2214. @deffn {Scheme Procedure} list-copy lst
  2215. Return a (newly-created) copy of @var{lst}.
  2216. @end deffn
  2217.  
  2218. list
  2219. @c snarfed from list.c:545
  2220. @deffn {Scheme Procedure} list
  2221. Return a list containing @var{objs}, the arguments to
  2222. @code{list}.
  2223. @end deffn
  2224.  
  2225. sloppy-memq
  2226. @c snarfed from list.c:567
  2227. @deffn {Scheme Procedure} sloppy-memq x lst
  2228. This procedure behaves like @code{memq}, but does no type or error checking.
  2229. Its use is recommended only in writing Guile internals,
  2230. not for high-level Scheme programs.
  2231. @end deffn
  2232.  
  2233. sloppy-memv
  2234. @c snarfed from list.c:584
  2235. @deffn {Scheme Procedure} sloppy-memv x lst
  2236. This procedure behaves like @code{memv}, but does no type or error checking.
  2237. Its use is recommended only in writing Guile internals,
  2238. not for high-level Scheme programs.
  2239. @end deffn
  2240.  
  2241. sloppy-member
  2242. @c snarfed from list.c:601
  2243. @deffn {Scheme Procedure} sloppy-member x lst
  2244. This procedure behaves like @code{member}, but does no type or error checking.
  2245. Its use is recommended only in writing Guile internals,
  2246. not for high-level Scheme programs.
  2247. @end deffn
  2248.  
  2249. memq
  2250. @c snarfed from list.c:641
  2251. @deffn {Scheme Procedure} memq x lst
  2252. Return the first sublist of @var{lst} whose car is @code{eq?}
  2253. to @var{x} where the sublists of @var{lst} are the non-empty
  2254. lists returned by @code{(list-tail @var{lst} @var{k})} for
  2255. @var{k} less than the length of @var{lst}.  If @var{x} does not
  2256. occur in @var{lst}, then @code{#f} (not the empty list) is
  2257. returned.
  2258. @end deffn
  2259.  
  2260. memv
  2261. @c snarfed from list.c:658
  2262. @deffn {Scheme Procedure} memv x lst
  2263. Return the first sublist of @var{lst} whose car is @code{eqv?}
  2264. to @var{x} where the sublists of @var{lst} are the non-empty
  2265. lists returned by @code{(list-tail @var{lst} @var{k})} for
  2266. @var{k} less than the length of @var{lst}.  If @var{x} does not
  2267. occur in @var{lst}, then @code{#f} (not the empty list) is
  2268. returned.
  2269. @end deffn
  2270.  
  2271. member
  2272. @c snarfed from list.c:679
  2273. @deffn {Scheme Procedure} member x lst
  2274. Return the first sublist of @var{lst} whose car is
  2275. @code{equal?} to @var{x} where the sublists of @var{lst} are
  2276. the non-empty lists returned by @code{(list-tail @var{lst}
  2277. @var{k})} for @var{k} less than the length of @var{lst}.  If
  2278. @var{x} does not occur in @var{lst}, then @code{#f} (not the
  2279. empty list) is returned.
  2280. @end deffn
  2281.  
  2282. delq!
  2283. @c snarfed from list.c:705
  2284. @deffn {Scheme Procedure} delq! item lst
  2285. @deffnx {Scheme Procedure} delv! item lst
  2286. @deffnx {Scheme Procedure} delete! item lst
  2287. These procedures are destructive versions of @code{delq}, @code{delv}
  2288. and @code{delete}: they modify the pointers in the existing @var{lst}
  2289. rather than creating a new list.  Caveat evaluator: Like other
  2290. destructive list functions, these functions cannot modify the binding of
  2291. @var{lst}, and so cannot be used to delete the first element of
  2292. @var{lst} destructively.
  2293. @end deffn
  2294.  
  2295. delv!
  2296. @c snarfed from list.c:729
  2297. @deffn {Scheme Procedure} delv! item lst
  2298. Destructively remove all elements from @var{lst} that are
  2299. @code{eqv?} to @var{item}.
  2300. @end deffn
  2301.  
  2302. delete!
  2303. @c snarfed from list.c:754
  2304. @deffn {Scheme Procedure} delete! item lst
  2305. Destructively remove all elements from @var{lst} that are
  2306. @code{equal?} to @var{item}.
  2307. @end deffn
  2308.  
  2309. delq
  2310. @c snarfed from list.c:783
  2311. @deffn {Scheme Procedure} delq item lst
  2312. Return a newly-created copy of @var{lst} with elements
  2313. @code{eq?} to @var{item} removed.  This procedure mirrors
  2314. @code{memq}: @code{delq} compares elements of @var{lst} against
  2315. @var{item} with @code{eq?}.
  2316. @end deffn
  2317.  
  2318. delv
  2319. @c snarfed from list.c:796
  2320. @deffn {Scheme Procedure} delv item lst
  2321. Return a newly-created copy of @var{lst} with elements
  2322. @code{eqv?}  to @var{item} removed.  This procedure mirrors
  2323. @code{memv}: @code{delv} compares elements of @var{lst} against
  2324. @var{item} with @code{eqv?}.
  2325. @end deffn
  2326.  
  2327. delete
  2328. @c snarfed from list.c:809
  2329. @deffn {Scheme Procedure} delete item lst
  2330. Return a newly-created copy of @var{lst} with elements
  2331. @code{equal?}  to @var{item} removed.  This procedure mirrors
  2332. @code{member}: @code{delete} compares elements of @var{lst}
  2333. against @var{item} with @code{equal?}.
  2334. @end deffn
  2335.  
  2336. delq1!
  2337. @c snarfed from list.c:822
  2338. @deffn {Scheme Procedure} delq1! item lst
  2339. Like @code{delq!}, but only deletes the first occurrence of
  2340. @var{item} from @var{lst}.  Tests for equality using
  2341. @code{eq?}.  See also @code{delv1!} and @code{delete1!}.
  2342. @end deffn
  2343.  
  2344. delv1!
  2345. @c snarfed from list.c:850
  2346. @deffn {Scheme Procedure} delv1! item lst
  2347. Like @code{delv!}, but only deletes the first occurrence of
  2348. @var{item} from @var{lst}.  Tests for equality using
  2349. @code{eqv?}.  See also @code{delq1!} and @code{delete1!}.
  2350. @end deffn
  2351.  
  2352. delete1!
  2353. @c snarfed from list.c:878
  2354. @deffn {Scheme Procedure} delete1! item lst
  2355. Like @code{delete!}, but only deletes the first occurrence of
  2356. @var{item} from @var{lst}.  Tests for equality using
  2357. @code{equal?}.  See also @code{delq1!} and @code{delv1!}.
  2358. @end deffn
  2359.  
  2360. primitive-load
  2361. @c snarfed from load.c:110
  2362. @deffn {Scheme Procedure} primitive-load filename
  2363. Load the file named @var{filename} and evaluate its contents in
  2364. the top-level environment. The load paths are not searched;
  2365. @var{filename} must either be a full pathname or be a pathname
  2366. relative to the current directory.  If the  variable
  2367. @code{%load-hook} is defined, it should be bound to a procedure
  2368. that will be called before any code is loaded.  See the
  2369. documentation for @code{%load-hook} later in this section.
  2370. @end deffn
  2371.  
  2372. %package-data-dir
  2373. @c snarfed from load.c:150
  2374. @deffn {Scheme Procedure} %package-data-dir
  2375. Return the name of the directory where Scheme packages, modules and
  2376. libraries are kept.  On most Unix systems, this will be
  2377. @samp{/usr/local/share/guile}.
  2378. @end deffn
  2379.  
  2380. %library-dir
  2381. @c snarfed from load.c:162
  2382. @deffn {Scheme Procedure} %library-dir
  2383. Return the directory where the Guile Scheme library files are installed.
  2384. E.g., may return "/usr/share/guile/1.3.5".
  2385. @end deffn
  2386.  
  2387. %site-dir
  2388. @c snarfed from load.c:174
  2389. @deffn {Scheme Procedure} %site-dir
  2390. Return the directory where the Guile site files are installed.
  2391. E.g., may return "/usr/share/guile/site".
  2392. @end deffn
  2393.  
  2394. parse-path
  2395. @c snarfed from load.c:226
  2396. @deffn {Scheme Procedure} parse-path path [tail]
  2397. Parse @var{path}, which is expected to be a colon-separated
  2398. string, into a list and return the resulting list with
  2399. @var{tail} appended. If @var{path} is @code{#f}, @var{tail}
  2400. is returned.
  2401. @end deffn
  2402.  
  2403. search-path
  2404. @c snarfed from load.c:276
  2405. @deffn {Scheme Procedure} search-path path filename [extensions]
  2406. Search @var{path} for a directory containing a file named
  2407. @var{filename}. The file must be readable, and not a directory.
  2408. If we find one, return its full filename; otherwise, return
  2409. @code{#f}.  If @var{filename} is absolute, return it unchanged.
  2410. If given, @var{extensions} is a list of strings; for each
  2411. directory in @var{path}, we search for @var{filename}
  2412. concatenated with each @var{extension}.
  2413. @end deffn
  2414.  
  2415. %search-load-path
  2416. @c snarfed from load.c:423
  2417. @deffn {Scheme Procedure} %search-load-path filename
  2418. Search @var{%load-path} for the file named @var{filename},
  2419. which must be readable by the current user.  If @var{filename}
  2420. is found in the list of paths to search or is an absolute
  2421. pathname, return its full pathname.  Otherwise, return
  2422. @code{#f}.  Filenames may have any of the optional extensions
  2423. in the @code{%load-extensions} list; @code{%search-load-path}
  2424. will try each extension automatically.
  2425. @end deffn
  2426.  
  2427. primitive-load-path
  2428. @c snarfed from load.c:444
  2429. @deffn {Scheme Procedure} primitive-load-path filename
  2430. Search @var{%load-path} for the file named @var{filename} and
  2431. load it into the top-level environment.  If @var{filename} is a
  2432. relative pathname and is not found in the list of search paths,
  2433. an error is signalled.
  2434. @end deffn
  2435.  
  2436. read-and-eval!
  2437. @c snarfed from load.c:485
  2438. @deffn {Scheme Procedure} read-and-eval! [port]
  2439. Read a form from @var{port} (standard input by default), and evaluate it
  2440. (memoizing it in the process) in the top-level environment.  If no data
  2441. is left to be read from @var{port}, an @code{end-of-file} error is
  2442. signalled.
  2443. @end deffn
  2444.  
  2445. procedure->syntax
  2446. @c snarfed from macros.c:104
  2447. @deffn {Scheme Procedure} procedure->syntax code
  2448. Return a @dfn{macro} which, when a symbol defined to this value
  2449. appears as the first symbol in an expression, returns the
  2450. result of applying @var{code} to the expression and the
  2451. environment.
  2452. @end deffn
  2453.  
  2454. procedure->macro
  2455. @c snarfed from macros.c:125
  2456. @deffn {Scheme Procedure} procedure->macro code
  2457. Return a @dfn{macro} which, when a symbol defined to this value
  2458. appears as the first symbol in an expression, evaluates the
  2459. result of applying @var{code} to the expression and the
  2460. environment.  For example:
  2461.  
  2462. @lisp
  2463. (define trace
  2464.   (procedure->macro
  2465.    (lambda (x env) `(set! ,(cadr x) (tracef ,(cadr x) ',(cadr x))))))
  2466.  
  2467. (trace @i{foo}) @equiv{} (set! @i{foo} (tracef @i{foo} '@i{foo})).
  2468. @end lisp
  2469. @end deffn
  2470.  
  2471. procedure->memoizing-macro
  2472. @c snarfed from macros.c:143
  2473. @deffn {Scheme Procedure} procedure->memoizing-macro code
  2474. Return a @dfn{macro} which, when a symbol defined to this value
  2475. appears as the first symbol in an expression, evaluates the
  2476. result of applying @var{code} to the expression and the
  2477. environment.
  2478.  
  2479. @code{procedure->memoizing-macro} is the same as
  2480. @code{procedure->macro}, except that the expression returned by
  2481. @var{code} replaces the original macro expression in the memoized
  2482. form of the containing code.
  2483. @end deffn
  2484.  
  2485. macro?
  2486. @c snarfed from macros.c:155
  2487. @deffn {Scheme Procedure} macro? obj
  2488. Return @code{#t} if @var{obj} is a regular macro, a memoizing macro or a
  2489. syntax transformer.
  2490. @end deffn
  2491.  
  2492. macro-type
  2493. @c snarfed from macros.c:173
  2494. @deffn {Scheme Procedure} macro-type m
  2495. Return one of the symbols @code{syntax}, @code{macro} or
  2496. @code{macro!}, depending on whether @var{m} is a syntax
  2497. transformer, a regular macro, or a memoizing macro,
  2498. respectively.  If @var{m} is not a macro, @code{#f} is
  2499. returned.
  2500. @end deffn
  2501.  
  2502. macro-name
  2503. @c snarfed from macros.c:191
  2504. @deffn {Scheme Procedure} macro-name m
  2505. Return the name of the macro @var{m}.
  2506. @end deffn
  2507.  
  2508. macro-transformer
  2509. @c snarfed from macros.c:202
  2510. @deffn {Scheme Procedure} macro-transformer m
  2511. Return the transformer of the macro @var{m}.
  2512. @end deffn
  2513.  
  2514. current-module
  2515. @c snarfed from modules.c:69
  2516. @deffn {Scheme Procedure} current-module
  2517. Return the current module.
  2518. @end deffn
  2519.  
  2520. set-current-module
  2521. @c snarfed from modules.c:81
  2522. @deffn {Scheme Procedure} set-current-module module
  2523. Set the current module to @var{module} and return
  2524. the previous current module.
  2525. @end deffn
  2526.  
  2527. interaction-environment
  2528. @c snarfed from modules.c:111
  2529. @deffn {Scheme Procedure} interaction-environment
  2530. Return a specifier for the environment that contains
  2531. implementation--defined bindings, typically a superset of those
  2532. listed in the report.  The intent is that this procedure will
  2533. return the environment in which the implementation would
  2534. evaluate expressions dynamically typed by the user.
  2535. @end deffn
  2536.  
  2537. env-module
  2538. @c snarfed from modules.c:264
  2539. @deffn {Scheme Procedure} env-module env
  2540. Return the module of @var{ENV}, a lexical environment.
  2541. @end deffn
  2542.  
  2543. standard-eval-closure
  2544. @c snarfed from modules.c:336
  2545. @deffn {Scheme Procedure} standard-eval-closure module
  2546. Return an eval closure for the module @var{module}.
  2547. @end deffn
  2548.  
  2549. standard-interface-eval-closure
  2550. @c snarfed from modules.c:347
  2551. @deffn {Scheme Procedure} standard-interface-eval-closure module
  2552. Return a interface eval closure for the module @var{module}. Such a closure does not allow new bindings to be added.
  2553. @end deffn
  2554.  
  2555. %get-pre-modules-obarray
  2556. @c snarfed from modules.c:573
  2557. @deffn {Scheme Procedure} %get-pre-modules-obarray
  2558. 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.
  2559. @end deffn
  2560.  
  2561. exact?
  2562. @c snarfed from numbers.c:106
  2563. @deffn {Scheme Procedure} exact? x
  2564. Return @code{#t} if @var{x} is an exact number, @code{#f}
  2565. otherwise.
  2566. @end deffn
  2567.  
  2568. odd?
  2569. @c snarfed from numbers.c:123
  2570. @deffn {Scheme Procedure} odd? n
  2571. Return @code{#t} if @var{n} is an odd number, @code{#f}
  2572. otherwise.
  2573. @end deffn
  2574.  
  2575. even?
  2576. @c snarfed from numbers.c:140
  2577. @deffn {Scheme Procedure} even? n
  2578. Return @code{#t} if @var{n} is an even number, @code{#f}
  2579. otherwise.
  2580. @end deffn
  2581.  
  2582. logand
  2583. @c snarfed from numbers.c:753
  2584. @deffn {Scheme Procedure} logand n1 n2
  2585. Return the bitwise AND of the integer arguments.
  2586.  
  2587. @lisp
  2588. (logand) @result{} -1
  2589. (logand 7) @result{} 7
  2590. (logand #b111 #b011 #b001) @result{} 1
  2591. @end lisp
  2592. @end deffn
  2593.  
  2594. logior
  2595. @c snarfed from numbers.c:839
  2596. @deffn {Scheme Procedure} logior n1 n2
  2597. Return the bitwise OR of the integer arguments.
  2598.  
  2599. @lisp
  2600. (logior) @result{} 0
  2601. (logior 7) @result{} 7
  2602. (logior #b000 #b001 #b011) @result{} 3
  2603. @end lisp
  2604. @end deffn
  2605.  
  2606. logxor
  2607. @c snarfed from numbers.c:926
  2608. @deffn {Scheme Procedure} logxor n1 n2
  2609. Return the bitwise XOR of the integer arguments.  A bit is
  2610. set in the result if it is set in an odd number of arguments.
  2611. @lisp
  2612. (logxor) @result{} 0
  2613. (logxor 7) @result{} 7
  2614. (logxor #b000 #b001 #b011) @result{} 2
  2615. (logxor #b000 #b001 #b011 #b011) @result{} 1
  2616. @end lisp
  2617. @end deffn
  2618.  
  2619. logtest
  2620. @c snarfed from numbers.c:995
  2621. @deffn {Scheme Procedure} logtest j k
  2622. @lisp
  2623. (logtest j k) @equiv{} (not (zero? (logand j k)))
  2624.  
  2625. (logtest #b0100 #b1011) @result{} #f
  2626. (logtest #b0100 #b0111) @result{} #t
  2627. @end lisp
  2628. @end deffn
  2629.  
  2630. logbit?
  2631. @c snarfed from numbers.c:1052
  2632. @deffn {Scheme Procedure} logbit? index j
  2633. @lisp
  2634. (logbit? index j) @equiv{} (logtest (integer-expt 2 index) j)
  2635.  
  2636. (logbit? 0 #b1101) @result{} #t
  2637. (logbit? 1 #b1101) @result{} #f
  2638. (logbit? 2 #b1101) @result{} #t
  2639. (logbit? 3 #b1101) @result{} #t
  2640. (logbit? 4 #b1101) @result{} #f
  2641. @end lisp
  2642. @end deffn
  2643.  
  2644. lognot
  2645. @c snarfed from numbers.c:1105
  2646. @deffn {Scheme Procedure} lognot n
  2647. Return the integer which is the ones-complement of the integer
  2648. argument.
  2649.  
  2650. @lisp
  2651. (number->string (lognot #b10000000) 2)
  2652.    @result{} "-10000001"
  2653. (number->string (lognot #b0) 2)
  2654.    @result{} "-1"
  2655. @end lisp
  2656. @end deffn
  2657.  
  2658. integer-expt
  2659. @c snarfed from numbers.c:1122
  2660. @deffn {Scheme Procedure} integer-expt n k
  2661. Return @var{n} raised to the non-negative integer exponent
  2662. @var{k}.
  2663.  
  2664. @lisp
  2665. (integer-expt 2 5)
  2666.    @result{} 32
  2667. (integer-expt -3 3)
  2668.    @result{} -27
  2669. @end lisp
  2670. @end deffn
  2671.  
  2672. ash
  2673. @c snarfed from numbers.c:1178
  2674. @deffn {Scheme Procedure} ash n cnt
  2675. The function ash performs an arithmetic shift left by @var{cnt}
  2676. bits (or shift right, if @var{cnt} is negative).  'Arithmetic'
  2677. means, that the function does not guarantee to keep the bit
  2678. structure of @var{n}, but rather guarantees that the result
  2679. will always be rounded towards minus infinity.  Therefore, the
  2680. results of ash and a corresponding bitwise shift will differ if
  2681. @var{n} is negative.
  2682.  
  2683. Formally, the function returns an integer equivalent to
  2684. @code{(inexact->exact (floor (* @var{n} (expt 2 @var{cnt}))))}.
  2685.  
  2686. @lisp
  2687. (number->string (ash #b1 3) 2)     @result{} "1000"
  2688. (number->string (ash #b1010 -1) 2) @result{} "101"
  2689. @end lisp
  2690. @end deffn
  2691.  
  2692. bit-extract
  2693. @c snarfed from numbers.c:1231
  2694. @deffn {Scheme Procedure} bit-extract n start end
  2695. Return the integer composed of the @var{start} (inclusive)
  2696. through @var{end} (exclusive) bits of @var{n}.  The
  2697. @var{start}th bit becomes the 0-th bit in the result.
  2698.  
  2699. @lisp
  2700. (number->string (bit-extract #b1101101010 0 4) 2)
  2701.    @result{} "1010"
  2702. (number->string (bit-extract #b1101101010 4 9) 2)
  2703.    @result{} "10110"
  2704. @end lisp
  2705. @end deffn
  2706.  
  2707. logcount
  2708. @c snarfed from numbers.c:1303
  2709. @deffn {Scheme Procedure} logcount n
  2710. Return the number of bits in integer @var{n}.  If integer is
  2711. positive, the 1-bits in its binary representation are counted.
  2712. If negative, the 0-bits in its two's-complement binary
  2713. representation are counted.  If 0, 0 is returned.
  2714.  
  2715. @lisp
  2716. (logcount #b10101010)
  2717.    @result{} 4
  2718. (logcount 0)
  2719.    @result{} 0
  2720. (logcount -2)
  2721.    @result{} 1
  2722. @end lisp
  2723. @end deffn
  2724.  
  2725. integer-length
  2726. @c snarfed from numbers.c:1354
  2727. @deffn {Scheme Procedure} integer-length n
  2728. Return the number of bits necessary to represent @var{n}.
  2729.  
  2730. @lisp
  2731. (integer-length #b10101010)
  2732.    @result{} 8
  2733. (integer-length 0)
  2734.    @result{} 0
  2735. (integer-length #b1111)
  2736.    @result{} 4
  2737. @end lisp
  2738. @end deffn
  2739.  
  2740. number->string
  2741. @c snarfed from numbers.c:2189
  2742. @deffn {Scheme Procedure} number->string n [radix]
  2743. Return a string holding the external representation of the
  2744. number @var{n} in the given @var{radix}.  If @var{n} is
  2745. inexact, a radix of 10 will be used.
  2746. @end deffn
  2747.  
  2748. string->number
  2749. @c snarfed from numbers.c:2804
  2750. @deffn {Scheme Procedure} string->number string [radix]
  2751. Return a number of the maximally precise representation
  2752. expressed by the given @var{string}. @var{radix} must be an
  2753. exact integer, either 2, 8, 10, or 16. If supplied, @var{radix}
  2754. is a default radix that may be overridden by an explicit radix
  2755. prefix in @var{string} (e.g. "#o177"). If @var{radix} is not
  2756. supplied, then the default radix is 10. If string is not a
  2757. syntactically valid notation for a number, then
  2758. @code{string->number} returns @code{#f}.
  2759. @end deffn
  2760.  
  2761. number?
  2762. @c snarfed from numbers.c:2871
  2763. @deffn {Scheme Procedure} number?
  2764. implemented by the C function "scm_number_p"
  2765. @end deffn
  2766.  
  2767. complex?
  2768. @c snarfed from numbers.c:2883
  2769. @deffn {Scheme Procedure} complex? x
  2770. Return @code{#t} if @var{x} is a complex number, @code{#f}
  2771. otherwise.  Note that the sets of real, rational and integer
  2772. values form subsets of the set of complex numbers, i. e. the
  2773. predicate will also be fulfilled if @var{x} is a real,
  2774. rational or integer number.
  2775. @end deffn
  2776.  
  2777. real?
  2778. @c snarfed from numbers.c:2891
  2779. @deffn {Scheme Procedure} real?
  2780. implemented by the C function "scm_real_p"
  2781. @end deffn
  2782.  
  2783. rational?
  2784. @c snarfed from numbers.c:2904
  2785. @deffn {Scheme Procedure} rational? x
  2786. Return @code{#t} if @var{x} is a rational number, @code{#f}
  2787. otherwise.  Note that the set of integer values forms a subset of
  2788. the set of rational numbers, i. e. the predicate will also be
  2789. fulfilled if @var{x} is an integer number.  Real numbers
  2790. will also satisfy this predicate, because of their limited
  2791. precision.
  2792. @end deffn
  2793.  
  2794. integer?
  2795. @c snarfed from numbers.c:2925
  2796. @deffn {Scheme Procedure} integer? x
  2797. Return @code{#t} if @var{x} is an integer number, @code{#f}
  2798. else.
  2799. @end deffn
  2800.  
  2801. inexact?
  2802. @c snarfed from numbers.c:2950
  2803. @deffn {Scheme Procedure} inexact? x
  2804. Return @code{#t} if @var{x} is an inexact number, @code{#f}
  2805. else.
  2806. @end deffn
  2807.  
  2808. truncate
  2809. @c snarfed from numbers.c:3932
  2810. @deffn {Scheme Procedure} truncate x
  2811. Round the inexact number @var{x} towards zero.
  2812. @end deffn
  2813.  
  2814. round
  2815. @c snarfed from numbers.c:3998
  2816. @deffn {Scheme Procedure} round x
  2817. Round the number @var{x} towards the nearest integer. When it is exactly halfway between two integers, round towards the even one.
  2818. @end deffn
  2819.  
  2820. floor
  2821. @c snarfed from numbers.c:4025
  2822. @deffn {Scheme Procedure} floor x
  2823. Round the number @var{x} towards minus infinity.
  2824. @end deffn
  2825.  
  2826. ceiling
  2827. @c snarfed from numbers.c:4039
  2828. @deffn {Scheme Procedure} ceiling x
  2829. Round the number @var{x} towards infinity.
  2830. @end deffn
  2831.  
  2832. $expt
  2833. @c snarfed from numbers.c:4130
  2834. @deffn {Scheme Procedure} $expt x y
  2835. Return @var{x} raised to the power of @var{y}. This
  2836. procedure does not accept complex arguments.
  2837. @end deffn
  2838.  
  2839. $atan2
  2840. @c snarfed from numbers.c:4146
  2841. @deffn {Scheme Procedure} $atan2 x y
  2842. Return the arc tangent of the two arguments @var{x} and
  2843. @var{y}. This is similar to calculating the arc tangent of
  2844. @var{x} / @var{y}, except that the signs of both arguments
  2845. are used to determine the quadrant of the result. This
  2846. procedure does not accept complex arguments.
  2847. @end deffn
  2848.  
  2849. make-rectangular
  2850. @c snarfed from numbers.c:4159
  2851. @deffn {Scheme Procedure} make-rectangular real imaginary
  2852. Return a complex number constructed of the given @var{real} and
  2853. @var{imaginary} parts.
  2854. @end deffn
  2855.  
  2856. make-polar
  2857. @c snarfed from numbers.c:4172
  2858. @deffn {Scheme Procedure} make-polar x y
  2859. Return the complex number @var{x} * e^(i * @var{y}).
  2860. @end deffn
  2861.  
  2862. inexact->exact
  2863. @c snarfed from numbers.c:4290
  2864. @deffn {Scheme Procedure} inexact->exact z
  2865. Return an exact number that is numerically closest to @var{z}.
  2866. @end deffn
  2867.  
  2868. class-of
  2869. @c snarfed from objects.c:88
  2870. @deffn {Scheme Procedure} class-of x
  2871. Return the class of @var{x}.
  2872. @end deffn
  2873.  
  2874. entity?
  2875. @c snarfed from objects.c:367
  2876. @deffn {Scheme Procedure} entity? obj
  2877. Return @code{#t} if @var{obj} is an entity.
  2878. @end deffn
  2879.  
  2880. operator?
  2881. @c snarfed from objects.c:376
  2882. @deffn {Scheme Procedure} operator? obj
  2883. Return @code{#t} if @var{obj} is an operator.
  2884. @end deffn
  2885.  
  2886. valid-object-procedure?
  2887. @c snarfed from objects.c:392
  2888. @deffn {Scheme Procedure} valid-object-procedure? proc
  2889. 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}.
  2890. @end deffn
  2891.  
  2892. set-object-procedure!
  2893. @c snarfed from objects.c:414
  2894. @deffn {Scheme Procedure} set-object-procedure! obj proc
  2895. Set the object procedure of @var{obj} to @var{proc}.
  2896. @var{obj} must be either an entity or an operator.
  2897. @end deffn
  2898.  
  2899. make-class-object
  2900. @c snarfed from objects.c:474
  2901. @deffn {Scheme Procedure} make-class-object metaclass layout
  2902. Create a new class object of class @var{metaclass}, with the
  2903. slot layout specified by @var{layout}.
  2904. @end deffn
  2905.  
  2906. make-subclass-object
  2907. @c snarfed from objects.c:489
  2908. @deffn {Scheme Procedure} make-subclass-object class layout
  2909. Create a subclass object of @var{class}, with the slot layout
  2910. specified by @var{layout}.
  2911. @end deffn
  2912.  
  2913. object-properties
  2914. @c snarfed from objprop.c:59
  2915. @deffn {Scheme Procedure} object-properties obj
  2916. Return @var{obj}'s property list.
  2917. @end deffn
  2918.  
  2919. set-object-properties!
  2920. @c snarfed from objprop.c:69
  2921. @deffn {Scheme Procedure} set-object-properties! obj alist
  2922. Set @var{obj}'s property list to @var{alist}.
  2923. @end deffn
  2924.  
  2925. object-property
  2926. @c snarfed from objprop.c:80
  2927. @deffn {Scheme Procedure} object-property obj key
  2928. Return the property of @var{obj} with name @var{key}.
  2929. @end deffn
  2930.  
  2931. set-object-property!
  2932. @c snarfed from objprop.c:92
  2933. @deffn {Scheme Procedure} set-object-property! obj key value
  2934. In @var{obj}'s property list, set the property named @var{key}
  2935. to @var{value}.
  2936. @end deffn
  2937.  
  2938. cons
  2939. @c snarfed from pairs.c:80
  2940. @deffn {Scheme Procedure} cons x y
  2941. Return a newly allocated pair whose car is @var{x} and whose
  2942. cdr is @var{y}.  The pair is guaranteed to be different (in the
  2943. sense of @code{eq?}) from every previously existing object.
  2944. @end deffn
  2945.  
  2946. pair?
  2947. @c snarfed from pairs.c:113
  2948. @deffn {Scheme Procedure} pair? x
  2949. Return @code{#t} if @var{x} is a pair; otherwise return
  2950. @code{#f}.
  2951. @end deffn
  2952.  
  2953. set-car!
  2954. @c snarfed from pairs.c:124
  2955. @deffn {Scheme Procedure} set-car! pair value
  2956. Stores @var{value} in the car field of @var{pair}.  The value returned
  2957. by @code{set-car!} is unspecified.
  2958. @end deffn
  2959.  
  2960. set-cdr!
  2961. @c snarfed from pairs.c:137
  2962. @deffn {Scheme Procedure} set-cdr! pair value
  2963. Stores @var{value} in the cdr field of @var{pair}.  The value returned
  2964. by @code{set-cdr!} is unspecified.
  2965. @end deffn
  2966.  
  2967. char-ready?
  2968. @c snarfed from ports.c:249
  2969. @deffn {Scheme Procedure} char-ready? [port]
  2970. Return @code{#t} if a character is ready on input @var{port}
  2971. and return @code{#f} otherwise.  If @code{char-ready?} returns
  2972. @code{#t} then the next @code{read-char} operation on
  2973. @var{port} is guaranteed not to hang.  If @var{port} is a file
  2974. port at end of file then @code{char-ready?} returns @code{#t}.
  2975. @footnote{@code{char-ready?} exists to make it possible for a
  2976. program to accept characters from interactive ports without
  2977. getting stuck waiting for input.  Any input editors associated
  2978. with such ports must make sure that characters whose existence
  2979. has been asserted by @code{char-ready?} cannot be rubbed out.
  2980. If @code{char-ready?} were to return @code{#f} at end of file,
  2981. a port at end of file would be indistinguishable from an
  2982. interactive port that has no ready characters.}
  2983. @end deffn
  2984.  
  2985. drain-input
  2986. @c snarfed from ports.c:326
  2987. @deffn {Scheme Procedure} drain-input port
  2988. This procedure clears a port's input buffers, similar
  2989. to the way that force-output clears the output buffer.  The
  2990. contents of the buffers are returned as a single string, e.g.,
  2991.  
  2992. @lisp
  2993. (define p (open-input-file ...))
  2994. (drain-input p) => empty string, nothing buffered yet.
  2995. (unread-char (read-char p) p)
  2996. (drain-input p) => initial chars from p, up to the buffer size.
  2997. @end lisp
  2998.  
  2999. Draining the buffers may be useful for cleanly finishing
  3000. buffered I/O so that the file descriptor can be used directly
  3001. for further input.
  3002. @end deffn
  3003.  
  3004. current-input-port
  3005. @c snarfed from ports.c:354
  3006. @deffn {Scheme Procedure} current-input-port
  3007. Return the current input port.  This is the default port used
  3008. by many input procedures.  Initially, @code{current-input-port}
  3009. returns the @dfn{standard input} in Unix and C terminology.
  3010. @end deffn
  3011.  
  3012. current-output-port
  3013. @c snarfed from ports.c:366
  3014. @deffn {Scheme Procedure} current-output-port
  3015. Return the current output port.  This is the default port used
  3016. by many output procedures.  Initially,
  3017. @code{current-output-port} returns the @dfn{standard output} in
  3018. Unix and C terminology.
  3019. @end deffn
  3020.  
  3021. current-error-port
  3022. @c snarfed from ports.c:376
  3023. @deffn {Scheme Procedure} current-error-port
  3024. Return the port to which errors and warnings should be sent (the
  3025. @dfn{standard error} in Unix and C terminology).
  3026. @end deffn
  3027.  
  3028. current-load-port
  3029. @c snarfed from ports.c:386
  3030. @deffn {Scheme Procedure} current-load-port
  3031. Return the current-load-port.
  3032. The load port is used internally by @code{primitive-load}.
  3033. @end deffn
  3034.  
  3035. set-current-input-port
  3036. @c snarfed from ports.c:399
  3037. @deffn {Scheme Procedure} set-current-input-port port
  3038. @deffnx {Scheme Procedure} set-current-output-port port
  3039. @deffnx {Scheme Procedure} set-current-error-port port
  3040. Change the ports returned by @code{current-input-port},
  3041. @code{current-output-port} and @code{current-error-port}, respectively,
  3042. so that they use the supplied @var{port} for input or output.
  3043. @end deffn
  3044.  
  3045. set-current-output-port
  3046. @c snarfed from ports.c:412
  3047. @deffn {Scheme Procedure} set-current-output-port port
  3048. Set the current default output port to @var{port}.
  3049. @end deffn
  3050.  
  3051. set-current-error-port
  3052. @c snarfed from ports.c:426
  3053. @deffn {Scheme Procedure} set-current-error-port port
  3054. Set the current default error port to @var{port}.
  3055. @end deffn
  3056.  
  3057. port-revealed
  3058. @c snarfed from ports.c:573
  3059. @deffn {Scheme Procedure} port-revealed port
  3060. Return the revealed count for @var{port}.
  3061. @end deffn
  3062.  
  3063. set-port-revealed!
  3064. @c snarfed from ports.c:586
  3065. @deffn {Scheme Procedure} set-port-revealed! port rcount
  3066. Sets the revealed count for a port to a given value.
  3067. The return value is unspecified.
  3068. @end deffn
  3069.  
  3070. port-mode
  3071. @c snarfed from ports.c:629
  3072. @deffn {Scheme Procedure} port-mode port
  3073. Return the port modes associated with the open port @var{port}.
  3074. These will not necessarily be identical to the modes used when
  3075. the port was opened, since modes such as "append" which are
  3076. used only during port creation are not retained.
  3077. @end deffn
  3078.  
  3079. close-port
  3080. @c snarfed from ports.c:666
  3081. @deffn {Scheme Procedure} close-port port
  3082. Close the specified port object.  Return @code{#t} if it
  3083. successfully closes a port or @code{#f} if it was already
  3084. closed.  An exception may be raised if an error occurs, for
  3085. example when flushing buffered output.  See also @ref{Ports and
  3086. File Descriptors, close}, for a procedure which can close file
  3087. descriptors.
  3088. @end deffn
  3089.  
  3090. close-input-port
  3091. @c snarfed from ports.c:694
  3092. @deffn {Scheme Procedure} close-input-port port
  3093. Close the specified input port object.  The routine has no effect if
  3094. the file has already been closed.  An exception may be raised if an
  3095. error occurs.  The value returned is unspecified.
  3096.  
  3097. See also @ref{Ports and File Descriptors, close}, for a procedure
  3098. which can close file descriptors.
  3099. @end deffn
  3100.  
  3101. close-output-port
  3102. @c snarfed from ports.c:709
  3103. @deffn {Scheme Procedure} close-output-port port
  3104. Close the specified output port object.  The routine has no effect if
  3105. the file has already been closed.  An exception may be raised if an
  3106. error occurs.  The value returned is unspecified.
  3107.  
  3108. See also @ref{Ports and File Descriptors, close}, for a procedure
  3109. which can close file descriptors.
  3110. @end deffn
  3111.  
  3112. port-for-each
  3113. @c snarfed from ports.c:726
  3114. @deffn {Scheme Procedure} port-for-each proc
  3115. Apply @var{proc} to each port in the Guile port table
  3116. in turn.  The return value is unspecified.  More specifically,
  3117. @var{proc} is applied exactly once to every port that exists
  3118. in the system at the time @var{port-for-each} is invoked.
  3119. Changes to the port table while @var{port-for-each} is running
  3120. have no effect as far as @var{port-for-each} is concerned.
  3121. @end deffn
  3122.  
  3123. close-all-ports-except
  3124. @c snarfed from ports.c:769
  3125. @deffn {Scheme Procedure} close-all-ports-except . ports
  3126. [DEPRECATED] Close all open file ports used by the interpreter
  3127. except for those supplied as arguments.  This procedure
  3128. was intended to be used before an exec call to close file descriptors
  3129. which are not needed in the new process.  However it has the
  3130. undesirable side effect of flushing buffers, so it's deprecated.
  3131. Use port-for-each instead.
  3132. @end deffn
  3133.  
  3134. input-port?
  3135. @c snarfed from ports.c:808
  3136. @deffn {Scheme Procedure} input-port? x
  3137. Return @code{#t} if @var{x} is an input port, otherwise return
  3138. @code{#f}.  Any object satisfying this predicate also satisfies
  3139. @code{port?}.
  3140. @end deffn
  3141.  
  3142. output-port?
  3143. @c snarfed from ports.c:819
  3144. @deffn {Scheme Procedure} output-port? x
  3145. Return @code{#t} if @var{x} is an output port, otherwise return
  3146. @code{#f}.  Any object satisfying this predicate also satisfies
  3147. @code{port?}.
  3148. @end deffn
  3149.  
  3150. port?
  3151. @c snarfed from ports.c:831
  3152. @deffn {Scheme Procedure} port? x
  3153. Return a boolean indicating whether @var{x} is a port.
  3154. Equivalent to @code{(or (input-port? @var{x}) (output-port?
  3155. @var{x}))}.
  3156. @end deffn
  3157.  
  3158. port-closed?
  3159. @c snarfed from ports.c:841
  3160. @deffn {Scheme Procedure} port-closed? port
  3161. Return @code{#t} if @var{port} is closed or @code{#f} if it is
  3162. open.
  3163. @end deffn
  3164.  
  3165. eof-object?
  3166. @c snarfed from ports.c:852
  3167. @deffn {Scheme Procedure} eof-object? x
  3168. Return @code{#t} if @var{x} is an end-of-file object; otherwise
  3169. return @code{#f}.
  3170. @end deffn
  3171.  
  3172. force-output
  3173. @c snarfed from ports.c:866
  3174. @deffn {Scheme Procedure} force-output [port]
  3175. Flush the specified output port, or the current output port if @var{port}
  3176. is omitted.  The current output buffer contents are passed to the
  3177. underlying port implementation (e.g., in the case of fports, the
  3178. data will be written to the file and the output buffer will be cleared.)
  3179. It has no effect on an unbuffered port.
  3180.  
  3181. The return value is unspecified.
  3182. @end deffn
  3183.  
  3184. flush-all-ports
  3185. @c snarfed from ports.c:884
  3186. @deffn {Scheme Procedure} flush-all-ports
  3187. Equivalent to calling @code{force-output} on
  3188. all open output ports.  The return value is unspecified.
  3189. @end deffn
  3190.  
  3191. read-char
  3192. @c snarfed from ports.c:902
  3193. @deffn {Scheme Procedure} read-char [port]
  3194. Return the next character available from @var{port}, updating
  3195. @var{port} to point to the following character.  If no more
  3196. characters are available, the end-of-file object is returned.
  3197. @end deffn
  3198.  
  3199. peek-char
  3200. @c snarfed from ports.c:1244
  3201. @deffn {Scheme Procedure} peek-char [port]
  3202. Return the next character available from @var{port},
  3203. @emph{without} updating @var{port} to point to the following
  3204. character.  If no more characters are available, the
  3205. end-of-file object is returned.@footnote{The value returned by
  3206. a call to @code{peek-char} is the same as the value that would
  3207. have been returned by a call to @code{read-char} on the same
  3208. port.  The only difference is that the very next call to
  3209. @code{read-char} or @code{peek-char} on that @var{port} will
  3210. return the value returned by the preceding call to
  3211. @code{peek-char}.  In particular, a call to @code{peek-char} on
  3212. an interactive port will hang waiting for input whenever a call
  3213. to @code{read-char} would have hung.}
  3214. @end deffn
  3215.  
  3216. unread-char
  3217. @c snarfed from ports.c:1265
  3218. @deffn {Scheme Procedure} unread-char cobj [port]
  3219. Place @var{char} in @var{port} so that it will be read by the
  3220. next read operation.  If called multiple times, the unread characters
  3221. will be read again in last-in first-out order.  If @var{port} is
  3222. not supplied, the current input port is used.
  3223. @end deffn
  3224.  
  3225. unread-string
  3226. @c snarfed from ports.c:1288
  3227. @deffn {Scheme Procedure} unread-string str port
  3228. Place the string @var{str} in @var{port} so that its characters will be
  3229. read in subsequent read operations.  If called multiple times, the
  3230. unread characters will be read again in last-in first-out order.  If
  3231. @var{port} is not supplied, the current-input-port is used.
  3232. @end deffn
  3233.  
  3234. seek
  3235. @c snarfed from ports.c:1327
  3236. @deffn {Scheme Procedure} seek fd_port offset whence
  3237. Sets the current position of @var{fd/port} to the integer
  3238. @var{offset}, which is interpreted according to the value of
  3239. @var{whence}.
  3240.  
  3241. One of the following variables should be supplied for
  3242. @var{whence}:
  3243. @defvar SEEK_SET
  3244. Seek from the beginning of the file.
  3245. @end defvar
  3246. @defvar SEEK_CUR
  3247. Seek from the current position.
  3248. @end defvar
  3249. @defvar SEEK_END
  3250. Seek from the end of the file.
  3251. @end defvar
  3252. If @var{fd/port} is a file descriptor, the underlying system
  3253. call is @code{lseek}.  @var{port} may be a string port.
  3254.  
  3255. The value returned is the new position in the file.  This means
  3256. that the current position of a port can be obtained using:
  3257. @lisp
  3258. (seek port 0 SEEK_CUR)
  3259. @end lisp
  3260. @end deffn
  3261.  
  3262. truncate-file
  3263. @c snarfed from ports.c:1382
  3264. @deffn {Scheme Procedure} truncate-file object [length]
  3265. Truncates the object referred to by @var{object} to at most
  3266. @var{length} bytes.  @var{object} can be a string containing a
  3267. file name or an integer file descriptor or a port.
  3268. @var{length} may be omitted if @var{object} is not a file name,
  3269. in which case the truncation occurs at the current port.
  3270. position.  The return value is unspecified.
  3271. @end deffn
  3272.  
  3273. port-line
  3274. @c snarfed from ports.c:1436
  3275. @deffn {Scheme Procedure} port-line port
  3276. Return the current line number for @var{port}.
  3277. @end deffn
  3278.  
  3279. set-port-line!
  3280. @c snarfed from ports.c:1447
  3281. @deffn {Scheme Procedure} set-port-line! port line
  3282. Set the current line number for @var{port} to @var{line}.
  3283. @end deffn
  3284.  
  3285. port-column
  3286. @c snarfed from ports.c:1468
  3287. @deffn {Scheme Procedure} port-column port
  3288. @deffnx {Scheme Procedure} port-line port
  3289. Return the current column number or line number of @var{port},
  3290. using the current input port if none is specified.  If the number is
  3291. unknown, the result is #f.  Otherwise, the result is a 0-origin integer
  3292. - i.e. the first character of the first line is line 0, column 0.
  3293. (However, when you display a file position, for example in an error
  3294. message, we recommend you add 1 to get 1-origin integers.  This is
  3295. because lines and column numbers traditionally start with 1, and that is
  3296. what non-programmers will find most natural.)
  3297. @end deffn
  3298.  
  3299. set-port-column!
  3300. @c snarfed from ports.c:1481
  3301. @deffn {Scheme Procedure} set-port-column! port column
  3302. @deffnx {Scheme Procedure} set-port-line! port line
  3303. Set the current column or line number of @var{port}, using the
  3304. current input port if none is specified.
  3305. @end deffn
  3306.  
  3307. port-filename
  3308. @c snarfed from ports.c:1496
  3309. @deffn {Scheme Procedure} port-filename port
  3310. Return the filename associated with @var{port}.  This function returns
  3311. the strings "standard input", "standard output" and "standard error"
  3312. when called on the current input, output and error ports respectively.
  3313. @end deffn
  3314.  
  3315. set-port-filename!
  3316. @c snarfed from ports.c:1510
  3317. @deffn {Scheme Procedure} set-port-filename! port filename
  3318. Change the filename associated with @var{port}, using the current input
  3319. port if none is specified.  Note that this does not change the port's
  3320. source of data, but only the value that is returned by
  3321. @code{port-filename} and reported in diagnostic output.
  3322. @end deffn
  3323.  
  3324. %make-void-port
  3325. @c snarfed from ports.c:1604
  3326. @deffn {Scheme Procedure} %make-void-port mode
  3327. Create and return a new void port.  A void port acts like
  3328. @file{/dev/null}.  The @var{mode} argument
  3329. specifies the input/output modes for this port: see the
  3330. documentation for @code{open-file} in @ref{File Ports}.
  3331. @end deffn
  3332.  
  3333. print-options-interface
  3334. @c snarfed from print.c:141
  3335. @deffn {Scheme Procedure} print-options-interface [setting]
  3336. Option interface for the print options. Instead of using
  3337. this procedure directly, use the procedures
  3338. @code{print-enable}, @code{print-disable}, @code{print-set!}
  3339. and @code{print-options}.
  3340. @end deffn
  3341.  
  3342. simple-format
  3343. @c snarfed from print.c:929
  3344. @deffn {Scheme Procedure} simple-format destination message . args
  3345. Write @var{message} to @var{destination}, defaulting to
  3346. the current output port.
  3347. @var{message} can contain @code{~A} (was @code{%s}) and
  3348. @code{~S} (was @code{%S}) escapes.  When printed,
  3349. the escapes are replaced with corresponding members of
  3350. @var{ARGS}:
  3351. @code{~A} formats using @code{display} and @code{~S} formats
  3352. using @code{write}.
  3353. If @var{destination} is @code{#t}, then use the current output
  3354. port, if @var{destination} is @code{#f}, then return a string
  3355. containing the formatted text. Does not add a trailing newline.
  3356. @end deffn
  3357.  
  3358. newline
  3359. @c snarfed from print.c:1017
  3360. @deffn {Scheme Procedure} newline [port]
  3361. Send a newline to @var{port}.
  3362. If @var{port} is omitted, send to the current output port.
  3363. @end deffn
  3364.  
  3365. write-char
  3366. @c snarfed from print.c:1032
  3367. @deffn {Scheme Procedure} write-char chr [port]
  3368. Send character @var{chr} to @var{port}.
  3369. @end deffn
  3370.  
  3371. port-with-print-state
  3372. @c snarfed from print.c:1086
  3373. @deffn {Scheme Procedure} port-with-print-state port pstate
  3374. Create a new port which behaves like @var{port}, but with an
  3375. included print state @var{pstate}.
  3376. @end deffn
  3377.  
  3378. get-print-state
  3379. @c snarfed from print.c:1101
  3380. @deffn {Scheme Procedure} get-print-state port
  3381. Return the print state of the port @var{port}. If @var{port}
  3382. has no associated print state, @code{#f} is returned.
  3383. @end deffn
  3384.  
  3385. procedure-properties
  3386. @c snarfed from procprop.c:178
  3387. @deffn {Scheme Procedure} procedure-properties proc
  3388. Return @var{obj}'s property list.
  3389. @end deffn
  3390.  
  3391. set-procedure-properties!
  3392. @c snarfed from procprop.c:191
  3393. @deffn {Scheme Procedure} set-procedure-properties! proc new_val
  3394. Set @var{obj}'s property list to @var{alist}.
  3395. @end deffn
  3396.  
  3397. procedure-property
  3398. @c snarfed from procprop.c:204
  3399. @deffn {Scheme Procedure} procedure-property p k
  3400. Return the property of @var{obj} with name @var{key}.
  3401. @end deffn
  3402.  
  3403. set-procedure-property!
  3404. @c snarfed from procprop.c:227
  3405. @deffn {Scheme Procedure} set-procedure-property! p k v
  3406. In @var{obj}'s property list, set the property named @var{key} to
  3407. @var{value}.
  3408. @end deffn
  3409.  
  3410. procedure?
  3411. @c snarfed from procs.c:195
  3412. @deffn {Scheme Procedure} procedure? obj
  3413. Return @code{#t} if @var{obj} is a procedure.
  3414. @end deffn
  3415.  
  3416. closure?
  3417. @c snarfed from procs.c:222
  3418. @deffn {Scheme Procedure} closure? obj
  3419. Return @code{#t} if @var{obj} is a closure.
  3420. @end deffn
  3421.  
  3422. thunk?
  3423. @c snarfed from procs.c:231
  3424. @deffn {Scheme Procedure} thunk? obj
  3425. Return @code{#t} if @var{obj} is a thunk.
  3426. @end deffn
  3427.  
  3428. procedure-documentation
  3429. @c snarfed from procs.c:281
  3430. @deffn {Scheme Procedure} procedure-documentation proc
  3431. Return the documentation string associated with @code{proc}.  By
  3432. convention, if a procedure contains more than one expression and the
  3433. first expression is a string constant, that string is assumed to contain
  3434. documentation for that procedure.
  3435. @end deffn
  3436.  
  3437. procedure-with-setter?
  3438. @c snarfed from procs.c:317
  3439. @deffn {Scheme Procedure} procedure-with-setter? obj
  3440. Return @code{#t} if @var{obj} is a procedure with an
  3441. associated setter procedure.
  3442. @end deffn
  3443.  
  3444. make-procedure-with-setter
  3445. @c snarfed from procs.c:327
  3446. @deffn {Scheme Procedure} make-procedure-with-setter procedure setter
  3447. Create a new procedure which behaves like @var{procedure}, but
  3448. with the associated setter @var{setter}.
  3449. @end deffn
  3450.  
  3451. procedure
  3452. @c snarfed from procs.c:346
  3453. @deffn {Scheme Procedure} procedure proc
  3454. Return the procedure of @var{proc}, which must be either a
  3455. procedure with setter, or an operator struct.
  3456. @end deffn
  3457.  
  3458. primitive-make-property
  3459. @c snarfed from properties.c:64
  3460. @deffn {Scheme Procedure} primitive-make-property not_found_proc
  3461. Create a @dfn{property token} that can be used with
  3462. @code{primitive-property-ref} and @code{primitive-property-set!}.
  3463. See @code{primitive-property-ref} for the significance of
  3464. @var{not_found_proc}.
  3465. @end deffn
  3466.  
  3467. primitive-property-ref
  3468. @c snarfed from properties.c:82
  3469. @deffn {Scheme Procedure} primitive-property-ref prop obj
  3470. Return the property @var{prop} of @var{obj}.  When no value
  3471. has yet been associated with @var{prop} and @var{obj}, call
  3472. @var{not-found-proc} instead (see @code{primitive-make-property})
  3473. and use its return value.  That value is also associated with
  3474. @var{obj} via @code{primitive-property-set!}.  When
  3475. @var{not-found-proc} is @code{#f}, use @code{#f} as the
  3476. default value of @var{prop}.
  3477. @end deffn
  3478.  
  3479. primitive-property-set!
  3480. @c snarfed from properties.c:113
  3481. @deffn {Scheme Procedure} primitive-property-set! prop obj val
  3482. Associate @var{code} with @var{prop} and @var{obj}.
  3483. @end deffn
  3484.  
  3485. primitive-property-del!
  3486. @c snarfed from properties.c:134
  3487. @deffn {Scheme Procedure} primitive-property-del! prop obj
  3488. Remove any value associated with @var{prop} and @var{obj}.
  3489. @end deffn
  3490.  
  3491. random
  3492. @c snarfed from random.c:376
  3493. @deffn {Scheme Procedure} random n [state]
  3494. Return a number in [0,N).
  3495.  
  3496. Accepts a positive integer or real n and returns a
  3497. number of the same type between zero (inclusive) and
  3498. N (exclusive). The values returned have a uniform
  3499. distribution.
  3500.  
  3501. The optional argument @var{state} must be of the type produced
  3502. by @code{seed->random-state}. It defaults to the value of the
  3503. variable @var{*random-state*}. This object is used to maintain
  3504. the state of the pseudo-random-number generator and is altered
  3505. as a side effect of the random operation.
  3506. @end deffn
  3507.  
  3508. copy-random-state
  3509. @c snarfed from random.c:399
  3510. @deffn {Scheme Procedure} copy-random-state [state]
  3511. Return a copy of the random state @var{state}.
  3512. @end deffn
  3513.  
  3514. seed->random-state
  3515. @c snarfed from random.c:411
  3516. @deffn {Scheme Procedure} seed->random-state seed
  3517. Return a new random state using @var{seed}.
  3518. @end deffn
  3519.  
  3520. random:uniform
  3521. @c snarfed from random.c:425
  3522. @deffn {Scheme Procedure} random:uniform [state]
  3523. Return a uniformly distributed inexact real random number in
  3524. [0,1).
  3525. @end deffn
  3526.  
  3527. random:normal
  3528. @c snarfed from random.c:440
  3529. @deffn {Scheme Procedure} random:normal [state]
  3530. Return an inexact real in a normal distribution.  The
  3531. distribution used has mean 0 and standard deviation 1.  For a
  3532. normal distribution with mean m and standard deviation d use
  3533. @code{(+ m (* d (random:normal)))}.
  3534. @end deffn
  3535.  
  3536. random:solid-sphere!
  3537. @c snarfed from random.c:496
  3538. @deffn {Scheme Procedure} random:solid-sphere! v [state]
  3539. Fills vect with inexact real random numbers
  3540. the sum of whose squares is less than 1.0.
  3541. Thinking of vect as coordinates in space of
  3542. dimension n = (vector-length vect), the coordinates
  3543. are uniformly distributed within the unit n-sphere.
  3544. The sum of the squares of the numbers is returned.
  3545. @end deffn
  3546.  
  3547. random:hollow-sphere!
  3548. @c snarfed from random.c:519
  3549. @deffn {Scheme Procedure} random:hollow-sphere! v [state]
  3550. Fills vect with inexact real random numbers
  3551. the sum of whose squares is equal to 1.0.
  3552. Thinking of vect as coordinates in space of
  3553. dimension n = (vector-length vect), the coordinates
  3554. are uniformly distributed over the surface of the
  3555. unit n-sphere.
  3556. @end deffn
  3557.  
  3558. random:normal-vector!
  3559. @c snarfed from random.c:537
  3560. @deffn {Scheme Procedure} random:normal-vector! v [state]
  3561. Fills vect with inexact real random numbers that are
  3562. independent and standard normally distributed
  3563. (i.e., with mean 0 and variance 1).
  3564. @end deffn
  3565.  
  3566. random:exp
  3567. @c snarfed from random.c:562
  3568. @deffn {Scheme Procedure} random:exp [state]
  3569. Return an inexact real in an exponential distribution with mean
  3570. 1.  For an exponential distribution with mean u use (* u
  3571. (random:exp)).
  3572. @end deffn
  3573.  
  3574. %read-delimited!
  3575. @c snarfed from rdelim.c:78
  3576. @deffn {Scheme Procedure} %read-delimited! delims str gobble [port [start [end]]]
  3577. Read characters from @var{port} into @var{str} until one of the
  3578. characters in the @var{delims} string is encountered.  If
  3579. @var{gobble} is true, discard the delimiter character;
  3580. otherwise, leave it in the input stream for the next read.  If
  3581. @var{port} is not specified, use the value of
  3582. @code{(current-input-port)}.  If @var{start} or @var{end} are
  3583. specified, store data only into the substring of @var{str}
  3584. bounded by @var{start} and @var{end} (which default to the
  3585. beginning and end of the string, respectively).
  3586.  
  3587.  Return a pair consisting of the delimiter that terminated the
  3588. string and the number of characters read.  If reading stopped
  3589. at the end of file, the delimiter returned is the
  3590. @var{eof-object}; if the string was filled without encountering
  3591. a delimiter, this value is @code{#f}.
  3592. @end deffn
  3593.  
  3594. %read-line
  3595. @c snarfed from rdelim.c:223
  3596. @deffn {Scheme Procedure} %read-line [port]
  3597. Read a newline-terminated line from @var{port}, allocating storage as
  3598. necessary.  The newline terminator (if any) is removed from the string,
  3599. and a pair consisting of the line and its delimiter is returned.  The
  3600. delimiter may be either a newline or the @var{eof-object}; if
  3601. @code{%read-line} is called at the end of file, it returns the pair
  3602. @code{(#<eof> . #<eof>)}.
  3603. @end deffn
  3604.  
  3605. write-line
  3606. @c snarfed from rdelim.c:277
  3607. @deffn {Scheme Procedure} write-line obj [port]
  3608. Display @var{obj} and a newline character to @var{port}.  If
  3609. @var{port} is not specified, @code{(current-output-port)} is
  3610. used.  This function is equivalent to:
  3611. @lisp
  3612. (display obj [port])
  3613. (newline [port])
  3614. @end lisp
  3615. @end deffn
  3616.  
  3617. read-options-interface
  3618. @c snarfed from read.c:82
  3619. @deffn {Scheme Procedure} read-options-interface [setting]
  3620. Option interface for the read options. Instead of using
  3621. this procedure directly, use the procedures @code{read-enable},
  3622. @code{read-disable}, @code{read-set!} and @code{read-options}.
  3623. @end deffn
  3624.  
  3625. read
  3626. @c snarfed from read.c:102
  3627. @deffn {Scheme Procedure} read [port]
  3628. Read an s-expression from the input port @var{port}, or from
  3629. the current input port if @var{port} is not specified.
  3630. Any whitespace before the next token is discarded.
  3631. @end deffn
  3632.  
  3633. read-hash-extend
  3634. @c snarfed from read.c:760
  3635. @deffn {Scheme Procedure} read-hash-extend chr proc
  3636. Install the procedure @var{proc} for reading expressions
  3637. starting with the character sequence @code{#} and @var{chr}.
  3638. @var{proc} will be called with two arguments:  the character
  3639. @var{chr} and the port to read further data from. The object
  3640. returned will be the return value of @code{read}.
  3641. @end deffn
  3642.  
  3643. call-with-dynamic-root
  3644. @c snarfed from root.c:356
  3645. @deffn {Scheme Procedure} call-with-dynamic-root thunk handler
  3646. Evaluate @code{(thunk)} in a new dynamic context, returning its value.
  3647.  
  3648. If an error occurs during evaluation, apply @var{handler} to the
  3649. arguments to the throw, just as @code{throw} would.  If this happens,
  3650. @var{handler} is called outside the scope of the new root -- it is
  3651. called in the same dynamic context in which
  3652. @code{call-with-dynamic-root} was evaluated.
  3653.  
  3654. If @var{thunk} captures a continuation, the continuation is rooted at
  3655. the call to @var{thunk}.  In particular, the call to
  3656. @code{call-with-dynamic-root} is not captured.  Therefore,
  3657. @code{call-with-dynamic-root} always returns at most one time.
  3658.  
  3659. Before calling @var{thunk}, the dynamic-wind chain is un-wound back to
  3660. the root and a new chain started for @var{thunk}.  Therefore, this call
  3661. may not do what you expect:
  3662.  
  3663. @lisp
  3664. ;; Almost certainly a bug:
  3665. (with-output-to-port
  3666.  some-port
  3667.  
  3668.  (lambda ()
  3669.    (call-with-dynamic-root
  3670.     (lambda ()
  3671.       (display 'fnord)
  3672.       (newline))
  3673.     (lambda (errcode) errcode))))
  3674. @end lisp
  3675.  
  3676. The problem is, on what port will @samp{fnord} be displayed?  You
  3677. might expect that because of the @code{with-output-to-port} that
  3678. it will be displayed on the port bound to @code{some-port}.  But it
  3679. probably won't -- before evaluating the thunk, dynamic winds are
  3680. unwound, including those created by @code{with-output-to-port}.
  3681. So, the standard output port will have been re-set to its default value
  3682. before @code{display} is evaluated.
  3683.  
  3684. (This function was added to Guile mostly to help calls to functions in C
  3685. libraries that can not tolerate non-local exits or calls that return
  3686. multiple times.  If such functions call back to the interpreter, it should
  3687. be under a new dynamic root.)
  3688. @end deffn
  3689.  
  3690. dynamic-root
  3691. @c snarfed from root.c:369
  3692. @deffn {Scheme Procedure} dynamic-root
  3693. Return an object representing the current dynamic root.
  3694.  
  3695. These objects are only useful for comparison using @code{eq?}.
  3696. They are currently represented as numbers, but your code should
  3697. in no way depend on this.
  3698. @end deffn
  3699.  
  3700. read-string!/partial
  3701. @c snarfed from rw.c:121
  3702. @deffn {Scheme Procedure} read-string!/partial str [port_or_fdes [start [end]]]
  3703. Read characters from a port or file descriptor into a
  3704. string @var{str}.  A port must have an underlying file
  3705. descriptor --- a so-called fport.  This procedure is
  3706. scsh-compatible and can efficiently read large strings.
  3707. It will:
  3708.  
  3709. @itemize
  3710. @item
  3711. attempt to fill the entire string, unless the @var{start}
  3712. and/or @var{end} arguments are supplied.  i.e., @var{start}
  3713. defaults to 0 and @var{end} defaults to
  3714. @code{(string-length str)}
  3715. @item
  3716. use the current input port if @var{port_or_fdes} is not
  3717. supplied.
  3718. @item
  3719. return fewer than the requested number of characters in some
  3720. cases, e.g., on end of file, if interrupted by a signal, or if
  3721. not all the characters are immediately available.
  3722. @item
  3723. wait indefinitely for some input if no characters are
  3724. currently available,
  3725. unless the port is in non-blocking mode.
  3726. @item
  3727. read characters from the port's input buffers if available,
  3728. instead from the underlying file descriptor.
  3729. @item
  3730. return @code{#f} if end-of-file is encountered before reading
  3731. any characters, otherwise return the number of characters
  3732. read.
  3733. @item
  3734. return 0 if the port is in non-blocking mode and no characters
  3735. are immediately available.
  3736. @item
  3737. return 0 if the request is for 0 bytes, with no
  3738. end-of-file check.
  3739. @end itemize
  3740. @end deffn
  3741.  
  3742. write-string/partial
  3743. @c snarfed from rw.c:215
  3744. @deffn {Scheme Procedure} write-string/partial str [port_or_fdes [start [end]]]
  3745. Write characters from a string @var{str} to a port or file
  3746. descriptor.  A port must have an underlying file descriptor
  3747. --- a so-called fport.  This procedure is
  3748. scsh-compatible and can efficiently write large strings.
  3749. It will:
  3750.  
  3751. @itemize
  3752. @item
  3753. attempt to write the entire string, unless the @var{start}
  3754. and/or @var{end} arguments are supplied.  i.e., @var{start}
  3755. defaults to 0 and @var{end} defaults to
  3756. @code{(string-length str)}
  3757. @item
  3758. use the current output port if @var{port_of_fdes} is not
  3759. supplied.
  3760. @item
  3761. in the case of a buffered port, store the characters in the
  3762. port's output buffer, if all will fit.  If they will not fit
  3763. then any existing buffered characters will be flushed
  3764. before attempting
  3765. to write the new characters directly to the underlying file
  3766. descriptor.  If the port is in non-blocking mode and
  3767. buffered characters can not be flushed immediately, then an
  3768. @code{EAGAIN} system-error exception will be raised (Note:
  3769. scsh does not support the use of non-blocking buffered ports.)
  3770. @item
  3771. write fewer than the requested number of
  3772. characters in some cases, e.g., if interrupted by a signal or
  3773. if not all of the output can be accepted immediately.
  3774. @item
  3775. wait indefinitely for at least one character
  3776. from @var{str} to be accepted by the port, unless the port is
  3777. in non-blocking mode.
  3778. @item
  3779. return the number of characters accepted by the port.
  3780. @item
  3781. return 0 if the port is in non-blocking mode and can not accept
  3782. at least one character from @var{str} immediately
  3783. @item
  3784. return 0 immediately if the request size is 0 bytes.
  3785. @end itemize
  3786. @end deffn
  3787.  
  3788. sigaction
  3789. @c snarfed from scmsigs.c:210
  3790. @deffn {Scheme Procedure} sigaction signum [handler [flags]]
  3791. Install or report the signal handler for a specified signal.
  3792.  
  3793. @var{signum} is the signal number, which can be specified using the value
  3794. of variables such as @code{SIGINT}.
  3795.  
  3796. If @var{action} is omitted, @code{sigaction} returns a pair: the
  3797. CAR is the current
  3798. signal hander, which will be either an integer with the value @code{SIG_DFL}
  3799. (default action) or @code{SIG_IGN} (ignore), or the Scheme procedure which
  3800. handles the signal, or @code{#f} if a non-Scheme procedure handles the
  3801. signal.  The CDR contains the current @code{sigaction} flags for the handler.
  3802.  
  3803. If @var{action} is provided, it is installed as the new handler for
  3804. @var{signum}.  @var{action} can be a Scheme procedure taking one
  3805. argument, or the value of @code{SIG_DFL} (default action) or
  3806. @code{SIG_IGN} (ignore), or @code{#f} to restore whatever signal handler
  3807. was installed before @code{sigaction} was first used.  Flags can
  3808. optionally be specified for the new handler (@code{SA_RESTART} will
  3809. always be added if it's available and the system is using restartable
  3810. system calls.)  The return value is a pair with information about the
  3811. old handler as described above.
  3812.  
  3813. This interface does not provide access to the "signal blocking"
  3814. facility.  Maybe this is not needed, since the thread support may
  3815. provide solutions to the problem of consistent access to data
  3816. structures.
  3817. @end deffn
  3818.  
  3819. restore-signals
  3820. @c snarfed from scmsigs.c:375
  3821. @deffn {Scheme Procedure} restore-signals
  3822. Return all signal handlers to the values they had before any call to
  3823. @code{sigaction} was made.  The return value is unspecified.
  3824. @end deffn
  3825.  
  3826. alarm
  3827. @c snarfed from scmsigs.c:414
  3828. @deffn {Scheme Procedure} alarm i
  3829. Set a timer to raise a @code{SIGALRM} signal after the specified
  3830. number of seconds (an integer).  It's advisable to install a signal
  3831. handler for
  3832. @code{SIGALRM} beforehand, since the default action is to terminate
  3833. the process.
  3834.  
  3835. The return value indicates the time remaining for the previous alarm,
  3836. if any.  The new value replaces the previous alarm.  If there was
  3837. no previous alarm, the return value is zero.
  3838. @end deffn
  3839.  
  3840. setitimer
  3841. @c snarfed from scmsigs.c:444
  3842. @deffn {Scheme Procedure} setitimer which_timer interval_seconds interval_microseconds value_seconds value_microseconds
  3843. Set the timer specified by @var{which_timer} according to the given
  3844. @var{interval_seconds}, @var{interval_microseconds},
  3845. @var{value_seconds}, and @var{value_microseconds} values.
  3846.  
  3847. Return information about the timer's previous setting.
  3848. Errors are handled as described in the guile info pages under ``POSIX
  3849. Interface Conventions''.
  3850.  
  3851. The timers available are: @code{ITIMER_REAL}, @code{ITIMER_VIRTUAL},
  3852. and @code{ITIMER_PROF}.
  3853.  
  3854. The return value will be a list of two cons pairs representing the
  3855. current state of the given timer.  The first pair is the seconds and
  3856. microseconds of the timer @code{it_interval}, and the second pair is
  3857. the seconds and microseconds of the timer @code{it_value}.
  3858. @end deffn
  3859.  
  3860. getitimer
  3861. @c snarfed from scmsigs.c:485
  3862. @deffn {Scheme Procedure} getitimer which_timer
  3863. Return information about the timer specified by @var{which_timer}
  3864. Errors are handled as described in the guile info pages under ``POSIX
  3865. Interface Conventions''.
  3866.  
  3867. The timers available are: @code{ITIMER_REAL}, @code{ITIMER_VIRTUAL},
  3868. and @code{ITIMER_PROF}.
  3869.  
  3870. The return value will be a list of two cons pairs representing the
  3871. current state of the given timer.  The first pair is the seconds and
  3872. microseconds of the timer @code{it_interval}, and the second pair is
  3873. the seconds and microseconds of the timer @code{it_value}.
  3874. @end deffn
  3875.  
  3876. pause
  3877. @c snarfed from scmsigs.c:512
  3878. @deffn {Scheme Procedure} pause
  3879. Pause the current process (thread?) until a signal arrives whose
  3880. action is to either terminate the current process or invoke a
  3881. handler procedure.  The return value is unspecified.
  3882. @end deffn
  3883.  
  3884. sleep
  3885. @c snarfed from scmsigs.c:525
  3886. @deffn {Scheme Procedure} sleep i
  3887. Wait for the given number of seconds (an integer) or until a signal
  3888. arrives.  The return value is zero if the time elapses or the number
  3889. of seconds remaining otherwise.
  3890. @end deffn
  3891.  
  3892. usleep
  3893. @c snarfed from scmsigs.c:543
  3894. @deffn {Scheme Procedure} usleep i
  3895. Sleep for I microseconds.  @code{usleep} is not available on
  3896. all platforms.
  3897. @end deffn
  3898.  
  3899. raise
  3900. @c snarfed from scmsigs.c:572
  3901. @deffn {Scheme Procedure} raise sig
  3902. Sends a specified signal @var{sig} to the current process, where
  3903. @var{sig} is as described for the kill procedure.
  3904. @end deffn
  3905.  
  3906. system
  3907. @c snarfed from simpos.c:76
  3908. @deffn {Scheme Procedure} system [cmd]
  3909. Execute @var{cmd} using the operating system's "command
  3910. processor".  Under Unix this is usually the default shell
  3911. @code{sh}.  The value returned is @var{cmd}'s exit status as
  3912. returned by @code{waitpid}, which can be interpreted using the
  3913. functions above.
  3914.  
  3915. If @code{system} is called without arguments, return a boolean
  3916. indicating whether the command processor is available.
  3917. @end deffn
  3918.  
  3919. getenv
  3920. @c snarfed from simpos.c:104
  3921. @deffn {Scheme Procedure} getenv nam
  3922. Looks up the string @var{name} in the current environment.  The return
  3923. value is @code{#f} unless a string of the form @code{NAME=VALUE} is
  3924. found, in which case the string @code{VALUE} is returned.
  3925. @end deffn
  3926.  
  3927. primitive-exit
  3928. @c snarfed from simpos.c:120
  3929. @deffn {Scheme Procedure} primitive-exit [status]
  3930. Terminate the current process without unwinding the Scheme stack.
  3931. This is would typically be useful after a fork.  The exit status
  3932. is @var{status} if supplied, otherwise zero.
  3933. @end deffn
  3934.  
  3935. restricted-vector-sort!
  3936. @c snarfed from sort.c:380
  3937. @deffn {Scheme Procedure} restricted-vector-sort! vec less startpos endpos
  3938. Sort the vector @var{vec}, using @var{less} for comparing
  3939. the vector elements.  @var{startpos} and @var{endpos} delimit
  3940. the range of the vector which gets sorted.  The return value
  3941. is not specified.
  3942. @end deffn
  3943.  
  3944. sorted?
  3945. @c snarfed from sort.c:411
  3946. @deffn {Scheme Procedure} sorted? items less
  3947. Return @code{#t} iff @var{items} is a list or a vector such that
  3948. for all 1 <= i <= m, the predicate @var{less} returns true when
  3949. applied to all elements i - 1 and i
  3950. @end deffn
  3951.  
  3952. merge
  3953. @c snarfed from sort.c:484
  3954. @deffn {Scheme Procedure} merge alist blist less
  3955. Merge two already sorted lists into one.
  3956. Given two lists @var{alist} and @var{blist}, such that
  3957. @code{(sorted? alist less?)} and @code{(sorted? blist less?)},
  3958. return a new list in which the elements of @var{alist} and
  3959. @var{blist} have been stably interleaved so that
  3960. @code{(sorted? (merge alist blist less?) less?)}.
  3961. Note:  this does _not_ accept vectors.
  3962. @end deffn
  3963.  
  3964. merge!
  3965. @c snarfed from sort.c:597
  3966. @deffn {Scheme Procedure} merge! alist blist less
  3967. Takes two lists @var{alist} and @var{blist} such that
  3968. @code{(sorted? alist less?)} and @code{(sorted? blist less?)} and
  3969. returns a new list in which the elements of @var{alist} and
  3970. @var{blist} have been stably interleaved so that
  3971.  @code{(sorted? (merge alist blist less?) less?)}.
  3972. This is the destructive variant of @code{merge}
  3973. Note:  this does _not_ accept vectors.
  3974. @end deffn
  3975.  
  3976. sort!
  3977. @c snarfed from sort.c:673
  3978. @deffn {Scheme Procedure} sort! items less
  3979. Sort the sequence @var{items}, which may be a list or a
  3980. vector.  @var{less} is used for comparing the sequence
  3981. elements.  The sorting is destructive, that means that the
  3982. input sequence is modified to produce the sorted result.
  3983. This is not a stable sort.
  3984. @end deffn
  3985.  
  3986. sort
  3987. @c snarfed from sort.c:707
  3988. @deffn {Scheme Procedure} sort items less
  3989. Sort the sequence @var{items}, which may be a list or a
  3990. vector.  @var{less} is used for comparing the sequence
  3991. elements.  This is not a stable sort.
  3992. @end deffn
  3993.  
  3994. stable-sort!
  3995. @c snarfed from sort.c:803
  3996. @deffn {Scheme Procedure} stable-sort! items less
  3997. Sort the sequence @var{items}, which may be a list or a
  3998. vector. @var{less} is used for comparing the sequence elements.
  3999. The sorting is destructive, that means that the input sequence
  4000. is modified to produce the sorted result.
  4001. This is a stable sort.
  4002. @end deffn
  4003.  
  4004. stable-sort
  4005. @c snarfed from sort.c:843
  4006. @deffn {Scheme Procedure} stable-sort items less
  4007. Sort the sequence @var{items}, which may be a list or a
  4008. vector. @var{less} is used for comparing the sequence elements.
  4009. This is a stable sort.
  4010. @end deffn
  4011.  
  4012. sort-list!
  4013. @c snarfed from sort.c:889
  4014. @deffn {Scheme Procedure} sort-list! items less
  4015. Sort the list @var{items}, using @var{less} for comparing the
  4016. list elements. The sorting is destructive, that means that the
  4017. input list is modified to produce the sorted result.
  4018. This is a stable sort.
  4019. @end deffn
  4020.  
  4021. sort-list
  4022. @c snarfed from sort.c:903
  4023. @deffn {Scheme Procedure} sort-list items less
  4024. Sort the list @var{items}, using @var{less} for comparing the
  4025. list elements. This is a stable sort.
  4026. @end deffn
  4027.  
  4028. source-properties
  4029. @c snarfed from srcprop.c:170
  4030. @deffn {Scheme Procedure} source-properties obj
  4031. Return the source property association list of @var{obj}.
  4032. @end deffn
  4033.  
  4034. set-source-properties!
  4035. @c snarfed from srcprop.c:195
  4036. @deffn {Scheme Procedure} set-source-properties! obj plist
  4037. Install the association list @var{plist} as the source property
  4038. list for @var{obj}.
  4039. @end deffn
  4040.  
  4041. source-property
  4042. @c snarfed from srcprop.c:215
  4043. @deffn {Scheme Procedure} source-property obj key
  4044. Return the source property specified by @var{key} from
  4045. @var{obj}'s source property list.
  4046. @end deffn
  4047.  
  4048. set-source-property!
  4049. @c snarfed from srcprop.c:248
  4050. @deffn {Scheme Procedure} set-source-property! obj key datum
  4051. Set the source property of object @var{obj}, which is specified by
  4052. @var{key} to @var{datum}.  Normally, the key will be a symbol.
  4053. @end deffn
  4054.  
  4055. stack?
  4056. @c snarfed from stacks.c:418
  4057. @deffn {Scheme Procedure} stack? obj
  4058. Return @code{#t} if @var{obj} is a calling stack.
  4059. @end deffn
  4060.  
  4061. make-stack
  4062. @c snarfed from stacks.c:449
  4063. @deffn {Scheme Procedure} make-stack obj . args
  4064. Create a new stack. If @var{obj} is @code{#t}, the current
  4065. evaluation stack is used for creating the stack frames,
  4066. otherwise the frames are taken from @var{obj} (which must be
  4067. either a debug object or a continuation).
  4068.  
  4069. @var{args} should be a list containing any combination of
  4070. integer, procedure and @code{#t} values.
  4071.  
  4072. These values specify various ways of cutting away uninteresting
  4073. stack frames from the top and bottom of the stack that
  4074. @code{make-stack} returns.  They come in pairs like this:
  4075. @code{(@var{inner_cut_1} @var{outer_cut_1} @var{inner_cut_2}
  4076. @var{outer_cut_2} @dots{})}.
  4077.  
  4078. Each @var{inner_cut_N} can be @code{#t}, an integer, or a
  4079. procedure.  @code{#t} means to cut away all frames up to but
  4080. excluding the first user module frame.  An integer means to cut
  4081. away exactly that number of frames.  A procedure means to cut
  4082. away all frames up to but excluding the application frame whose
  4083. procedure matches the specified one.
  4084.  
  4085. Each @var{outer_cut_N} can be an integer or a procedure.  An
  4086. integer means to cut away that number of frames.  A procedure
  4087. means to cut away frames down to but excluding the application
  4088. frame whose procedure matches the specified one.
  4089.  
  4090. If the @var{outer_cut_N} of the last pair is missing, it is
  4091. taken as 0.
  4092. @end deffn
  4093.  
  4094. stack-id
  4095. @c snarfed from stacks.c:538
  4096. @deffn {Scheme Procedure} stack-id stack
  4097. Return the identifier given to @var{stack} by @code{start-stack}.
  4098. @end deffn
  4099.  
  4100. stack-ref
  4101. @c snarfed from stacks.c:576
  4102. @deffn {Scheme Procedure} stack-ref stack index
  4103. Return the @var{index}'th frame from @var{stack}.
  4104. @end deffn
  4105.  
  4106. stack-length
  4107. @c snarfed from stacks.c:592
  4108. @deffn {Scheme Procedure} stack-length stack
  4109. Return the length of @var{stack}.
  4110. @end deffn
  4111.  
  4112. frame?
  4113. @c snarfed from stacks.c:605
  4114. @deffn {Scheme Procedure} frame? obj
  4115. Return @code{#t} if @var{obj} is a stack frame.
  4116. @end deffn
  4117.  
  4118. last-stack-frame
  4119. @c snarfed from stacks.c:616
  4120. @deffn {Scheme Procedure} last-stack-frame obj
  4121. Return a stack which consists of a single frame, which is the
  4122. last stack frame for @var{obj}. @var{obj} must be either a
  4123. debug object or a continuation.
  4124. @end deffn
  4125.  
  4126. frame-number
  4127. @c snarfed from stacks.c:655
  4128. @deffn {Scheme Procedure} frame-number frame
  4129. Return the frame number of @var{frame}.
  4130. @end deffn
  4131.  
  4132. frame-source
  4133. @c snarfed from stacks.c:665
  4134. @deffn {Scheme Procedure} frame-source frame
  4135. Return the source of @var{frame}.
  4136. @end deffn
  4137.  
  4138. frame-procedure
  4139. @c snarfed from stacks.c:676
  4140. @deffn {Scheme Procedure} frame-procedure frame
  4141. Return the procedure for @var{frame}, or @code{#f} if no
  4142. procedure is associated with @var{frame}.
  4143. @end deffn
  4144.  
  4145. frame-arguments
  4146. @c snarfed from stacks.c:688
  4147. @deffn {Scheme Procedure} frame-arguments frame
  4148. Return the arguments of @var{frame}.
  4149. @end deffn
  4150.  
  4151. frame-previous
  4152. @c snarfed from stacks.c:699
  4153. @deffn {Scheme Procedure} frame-previous frame
  4154. Return the previous frame of @var{frame}, or @code{#f} if
  4155. @var{frame} is the first frame in its stack.
  4156. @end deffn
  4157.  
  4158. frame-next
  4159. @c snarfed from stacks.c:715
  4160. @deffn {Scheme Procedure} frame-next frame
  4161. Return the next frame of @var{frame}, or @code{#f} if
  4162. @var{frame} is the last frame in its stack.
  4163. @end deffn
  4164.  
  4165. frame-real?
  4166. @c snarfed from stacks.c:730
  4167. @deffn {Scheme Procedure} frame-real? frame
  4168. Return @code{#t} if @var{frame} is a real frame.
  4169. @end deffn
  4170.  
  4171. frame-procedure?
  4172. @c snarfed from stacks.c:740
  4173. @deffn {Scheme Procedure} frame-procedure? frame
  4174. Return @code{#t} if a procedure is associated with @var{frame}.
  4175. @end deffn
  4176.  
  4177. frame-evaluating-args?
  4178. @c snarfed from stacks.c:750
  4179. @deffn {Scheme Procedure} frame-evaluating-args? frame
  4180. Return @code{#t} if @var{frame} contains evaluated arguments.
  4181. @end deffn
  4182.  
  4183. frame-overflow?
  4184. @c snarfed from stacks.c:760
  4185. @deffn {Scheme Procedure} frame-overflow? frame
  4186. Return @code{#t} if @var{frame} is an overflow frame.
  4187. @end deffn
  4188.  
  4189. get-internal-real-time
  4190. @c snarfed from stime.c:153
  4191. @deffn {Scheme Procedure} get-internal-real-time
  4192. Return the number of time units since the interpreter was
  4193. started.
  4194. @end deffn
  4195.  
  4196. times
  4197. @c snarfed from stime.c:198
  4198. @deffn {Scheme Procedure} times
  4199. Return an object with information about real and processor
  4200. time.  The following procedures accept such an object as an
  4201. argument and return a selected component:
  4202.  
  4203. @table @code
  4204. @item tms:clock
  4205. The current real time, expressed as time units relative to an
  4206. arbitrary base.
  4207. @item tms:utime
  4208. The CPU time units used by the calling process.
  4209. @item tms:stime
  4210. The CPU time units used by the system on behalf of the calling
  4211. process.
  4212. @item tms:cutime
  4213. The CPU time units used by terminated child processes of the
  4214. calling process, whose status has been collected (e.g., using
  4215. @code{waitpid}).
  4216. @item tms:cstime
  4217. Similarly, the CPU times units used by the system on behalf of
  4218. terminated child processes.
  4219. @end table
  4220. @end deffn
  4221.  
  4222. get-internal-run-time
  4223. @c snarfed from stime.c:230
  4224. @deffn {Scheme Procedure} get-internal-run-time
  4225. Return the number of time units of processor time used by the
  4226. interpreter.  Both @emph{system} and @emph{user} time are
  4227. included but subprocesses are not.
  4228. @end deffn
  4229.  
  4230. current-time
  4231. @c snarfed from stime.c:240
  4232. @deffn {Scheme Procedure} current-time
  4233. Return the number of seconds since 1970-01-01 00:00:00 UTC,
  4234. excluding leap seconds.
  4235. @end deffn
  4236.  
  4237. gettimeofday
  4238. @c snarfed from stime.c:258
  4239. @deffn {Scheme Procedure} gettimeofday
  4240. Return a pair containing the number of seconds and microseconds
  4241. since 1970-01-01 00:00:00 UTC, excluding leap seconds.  Note:
  4242. whether true microsecond resolution is available depends on the
  4243. operating system.
  4244. @end deffn
  4245.  
  4246. localtime
  4247. @c snarfed from stime.c:357
  4248. @deffn {Scheme Procedure} localtime time [zone]
  4249. Return an object representing the broken down components of
  4250. @var{time}, an integer like the one returned by
  4251. @code{current-time}.  The time zone for the calculation is
  4252. optionally specified by @var{zone} (a string), otherwise the
  4253. @code{TZ} environment variable or the system default is used.
  4254. @end deffn
  4255.  
  4256. gmtime
  4257. @c snarfed from stime.c:435
  4258. @deffn {Scheme Procedure} gmtime time
  4259. Return an object representing the broken down components of
  4260. @var{time}, an integer like the one returned by
  4261. @code{current-time}.  The values are calculated for UTC.
  4262. @end deffn
  4263.  
  4264. mktime
  4265. @c snarfed from stime.c:500
  4266. @deffn {Scheme Procedure} mktime sbd_time [zone]
  4267. @var{bd-time} is an object representing broken down time and @code{zone}
  4268. is an optional time zone specifier (otherwise the TZ environment variable
  4269. or the system default is used).
  4270.  
  4271. Returns a pair: the car is a corresponding
  4272. integer time value like that returned
  4273. by @code{current-time}; the cdr is a broken down time object, similar to
  4274. as @var{bd-time} but with normalized values.
  4275. @end deffn
  4276.  
  4277. tzset
  4278. @c snarfed from stime.c:575
  4279. @deffn {Scheme Procedure} tzset
  4280. Initialize the timezone from the TZ environment variable
  4281. or the system default.  It's not usually necessary to call this procedure
  4282. since it's done automatically by other procedures that depend on the
  4283. timezone.
  4284. @end deffn
  4285.  
  4286. strftime
  4287. @c snarfed from stime.c:592
  4288. @deffn {Scheme Procedure} strftime format stime
  4289. Formats a time specification @var{time} using @var{template}.  @var{time}
  4290. is an object with time components in the form returned by @code{localtime}
  4291. or @code{gmtime}.  @var{template} is a string which can include formatting
  4292. specifications introduced by a @code{%} character.  The formatting of
  4293. month and day names is dependent on the current locale.  The value returned
  4294. is the formatted string.
  4295. @xref{Formatting Date and Time, , , libc, The GNU C Library Reference Manual}.)
  4296. @end deffn
  4297.  
  4298. strptime
  4299. @c snarfed from stime.c:690
  4300. @deffn {Scheme Procedure} strptime format string
  4301. Performs the reverse action to @code{strftime}, parsing
  4302. @var{string} according to the specification supplied in
  4303. @var{template}.  The interpretation of month and day names is
  4304. dependent on the current locale.  The value returned is a pair.
  4305. The car has an object with time components
  4306. in the form returned by @code{localtime} or @code{gmtime},
  4307. but the time zone components
  4308. are not usefully set.
  4309. The cdr reports the number of characters from @var{string}
  4310. which were used for the conversion.
  4311. @end deffn
  4312.  
  4313. string?
  4314. @c snarfed from strings.c:61
  4315. @deffn {Scheme Procedure} string? obj
  4316. Return @code{#t} if @var{obj} is a string, else @code{#f}.
  4317. @end deffn
  4318.  
  4319. read-only-string?
  4320. @c snarfed from strings.c:77
  4321. @deffn {Scheme Procedure} read-only-string? obj
  4322. Return @code{#t} if @var{obj} is either a string or a symbol,
  4323. otherwise return @code{#f}.
  4324. @end deffn
  4325.  
  4326. list->string
  4327. @c snarfed from strings.c:86
  4328. @deffn {Scheme Procedure} list->string
  4329. implemented by the C function "scm_string"
  4330. @end deffn
  4331.  
  4332. string
  4333. @c snarfed from strings.c:92
  4334. @deffn {Scheme Procedure} string . chrs
  4335. @deffnx {Scheme Procedure} list->string chrs
  4336. Return a newly allocated string composed of the arguments,
  4337. @var{chrs}.
  4338. @end deffn
  4339.  
  4340. make-string
  4341. @c snarfed from strings.c:258
  4342. @deffn {Scheme Procedure} make-string k [chr]
  4343. Return a newly allocated string of
  4344. length @var{k}.  If @var{chr} is given, then all elements of
  4345. the string are initialized to @var{chr}, otherwise the contents
  4346. of the @var{string} are unspecified.
  4347. @end deffn
  4348.  
  4349. string-length
  4350. @c snarfed from strings.c:291
  4351. @deffn {Scheme Procedure} string-length string
  4352. Return the number of characters in @var{string}.
  4353. @end deffn
  4354.  
  4355. string-ref
  4356. @c snarfed from strings.c:302
  4357. @deffn {Scheme Procedure} string-ref str k
  4358. Return character @var{k} of @var{str} using zero-origin
  4359. indexing. @var{k} must be a valid index of @var{str}.
  4360. @end deffn
  4361.  
  4362. string-set!
  4363. @c snarfed from strings.c:319
  4364. @deffn {Scheme Procedure} string-set! str k chr
  4365. Store @var{chr} in element @var{k} of @var{str} and return
  4366. an unspecified value. @var{k} must be a valid index of
  4367. @var{str}.
  4368. @end deffn
  4369.  
  4370. substring
  4371. @c snarfed from strings.c:342
  4372. @deffn {Scheme Procedure} substring str start [end]
  4373. Return a newly allocated string formed from the characters
  4374. of @var{str} beginning with index @var{start} (inclusive) and
  4375. ending with index @var{end} (exclusive).
  4376. @var{str} must be a string, @var{start} and @var{end} must be
  4377. exact integers satisfying:
  4378.  
  4379. 0 <= @var{start} <= @var{end} <= (string-length @var{str}).
  4380. @end deffn
  4381.  
  4382. string-append
  4383. @c snarfed from strings.c:368
  4384. @deffn {Scheme Procedure} string-append . args
  4385. Return a newly allocated string whose characters form the
  4386. concatenation of the given strings, @var{args}.
  4387. @end deffn
  4388.  
  4389. make-shared-substring
  4390. @c snarfed from strings.c:408
  4391. @deffn {Scheme Procedure} make-shared-substring str [start [end]]
  4392. Return a shared substring of @var{str}.  The arguments are the
  4393. same as for the @code{substring} function: the shared substring
  4394. returned includes all of the text from @var{str} between
  4395. indexes @var{start} (inclusive) and @var{end} (exclusive).  If
  4396. @var{end} is omitted, it defaults to the end of @var{str}.  The
  4397. shared substring returned by @code{make-shared-substring}
  4398. occupies the same storage space as @var{str}.
  4399. @end deffn
  4400.  
  4401. string-index
  4402. @c snarfed from strop.c:138
  4403. @deffn {Scheme Procedure} string-index str chr [frm [to]]
  4404. Return the index of the first occurrence of @var{chr} in
  4405. @var{str}.  The optional integer arguments @var{frm} and
  4406. @var{to} limit the search to a portion of the string.  This
  4407. procedure essentially implements the @code{index} or
  4408. @code{strchr} functions from the C library.
  4409.  
  4410. @lisp
  4411. (string-index "weiner" #\e)
  4412. @result{} 1
  4413.  
  4414. (string-index "weiner" #\e 2)
  4415. @result{} 4
  4416.  
  4417. (string-index "weiner" #\e 2 4)
  4418. @result{} #f
  4419. @end lisp
  4420. @end deffn
  4421.  
  4422. string-rindex
  4423. @c snarfed from strop.c:168
  4424. @deffn {Scheme Procedure} string-rindex str chr [frm [to]]
  4425. Like @code{string-index}, but search from the right of the
  4426. string rather than from the left.  This procedure essentially
  4427. implements the @code{rindex} or @code{strrchr} functions from
  4428. the C library.
  4429.  
  4430. @lisp
  4431. (string-rindex "weiner" #\e)
  4432. @result{} 4
  4433.  
  4434. (string-rindex "weiner" #\e 2 4)
  4435. @result{} #f
  4436.  
  4437. (string-rindex "weiner" #\e 2 5)
  4438. @result{} 4
  4439. @end lisp
  4440. @end deffn
  4441.  
  4442. substring-move-left!
  4443. @c snarfed from strop.c:186
  4444. @deffn {Scheme Procedure} substring-move-left!
  4445. implemented by the C function "scm_substring_move_x"
  4446. @end deffn
  4447.  
  4448. substring-move-right!
  4449. @c snarfed from strop.c:187
  4450. @deffn {Scheme Procedure} substring-move-right!
  4451. implemented by the C function "scm_substring_move_x"
  4452. @end deffn
  4453.  
  4454. substring-move!
  4455. @c snarfed from strop.c:249
  4456. @deffn {Scheme Procedure} substring-move! str1 start1 end1 str2 start2
  4457. Copy the substring of @var{str1} bounded by @var{start1} and @var{end1}
  4458. into @var{str2} beginning at position @var{start2}.
  4459. @var{str1} and @var{str2} can be the same string.
  4460. @end deffn
  4461.  
  4462. substring-fill!
  4463. @c snarfed from strop.c:285
  4464. @deffn {Scheme Procedure} substring-fill! str start end fill
  4465. Change every character in @var{str} between @var{start} and
  4466. @var{end} to @var{fill}.
  4467.  
  4468. @lisp
  4469. (define y "abcdefg")
  4470. (substring-fill! y 1 3 #\r)
  4471. y
  4472. @result{} "arrdefg"
  4473. @end lisp
  4474. @end deffn
  4475.  
  4476. string-null?
  4477. @c snarfed from strop.c:310
  4478. @deffn {Scheme Procedure} string-null? str
  4479. Return @code{#t} if @var{str}'s length is zero, and
  4480. @code{#f} otherwise.
  4481. @lisp
  4482. (string-null? "")  @result{} #t
  4483. y                    @result{} "foo"
  4484. (string-null? y)     @result{} #f
  4485. @end lisp
  4486. @end deffn
  4487.  
  4488. string->list
  4489. @c snarfed from strop.c:324
  4490. @deffn {Scheme Procedure} string->list str
  4491. Return a newly allocated list of the characters that make up
  4492. the given string @var{str}. @code{string->list} and
  4493. @code{list->string} are inverses as far as @samp{equal?} is
  4494. concerned.
  4495. @end deffn
  4496.  
  4497. string-copy
  4498. @c snarfed from strop.c:353
  4499. @deffn {Scheme Procedure} string-copy str
  4500. Return a newly allocated copy of the given @var{string}.
  4501. @end deffn
  4502.  
  4503. string-fill!
  4504. @c snarfed from strop.c:366
  4505. @deffn {Scheme Procedure} string-fill! str chr
  4506. Store @var{char} in every element of the given @var{string} and
  4507. return an unspecified value.
  4508. @end deffn
  4509.  
  4510. string-upcase!
  4511. @c snarfed from strop.c:401
  4512. @deffn {Scheme Procedure} string-upcase! str
  4513. Destructively upcase every character in @var{str} and return
  4514. @var{str}.
  4515. @lisp
  4516. y                  @result{} "arrdefg"
  4517. (string-upcase! y) @result{} "ARRDEFG"
  4518. y                  @result{} "ARRDEFG"
  4519. @end lisp
  4520. @end deffn
  4521.  
  4522. string-upcase
  4523. @c snarfed from strop.c:414
  4524. @deffn {Scheme Procedure} string-upcase str
  4525. Return a freshly allocated string containing the characters of
  4526. @var{str} in upper case.
  4527. @end deffn
  4528.  
  4529. string-downcase!
  4530. @c snarfed from strop.c:446
  4531. @deffn {Scheme Procedure} string-downcase! str
  4532. Destructively downcase every character in @var{str} and return
  4533. @var{str}.
  4534. @lisp
  4535. y                     @result{} "ARRDEFG"
  4536. (string-downcase! y)  @result{} "arrdefg"
  4537. y                     @result{} "arrdefg"
  4538. @end lisp
  4539. @end deffn
  4540.  
  4541. string-downcase
  4542. @c snarfed from strop.c:459
  4543. @deffn {Scheme Procedure} string-downcase str
  4544. Return a freshly allocation string containing the characters in
  4545. @var{str} in lower case.
  4546. @end deffn
  4547.  
  4548. string-capitalize!
  4549. @c snarfed from strop.c:504
  4550. @deffn {Scheme Procedure} string-capitalize! str
  4551. Upcase the first character of every word in @var{str}
  4552. destructively and return @var{str}.
  4553.  
  4554. @lisp
  4555. y                      @result{} "hello world"
  4556. (string-capitalize! y) @result{} "Hello World"
  4557. y                      @result{} "Hello World"
  4558. @end lisp
  4559. @end deffn
  4560.  
  4561. string-capitalize
  4562. @c snarfed from strop.c:518
  4563. @deffn {Scheme Procedure} string-capitalize str
  4564. Return a freshly allocated string with the characters in
  4565. @var{str}, where the first character of every word is
  4566. capitalized.
  4567. @end deffn
  4568.  
  4569. string-split
  4570. @c snarfed from strop.c:547
  4571. @deffn {Scheme Procedure} string-split str chr
  4572. Split the string @var{str} into the a list of the substrings delimited
  4573. by appearances of the character @var{chr}.  Note that an empty substring
  4574. between separator characters will result in an empty string in the
  4575. result list.
  4576.  
  4577. @lisp
  4578. (string-split "root:x:0:0:root:/root:/bin/bash" #\:)
  4579. @result{}
  4580. ("root" "x" "0" "0" "root" "/root" "/bin/bash")
  4581.  
  4582. (string-split "::" #\:)
  4583. @result{}
  4584. ("" "" "")
  4585.  
  4586. (string-split "" #\:)
  4587. @result{}
  4588. ("")
  4589. @end lisp
  4590. @end deffn
  4591.  
  4592. string-ci->symbol
  4593. @c snarfed from strop.c:582
  4594. @deffn {Scheme Procedure} string-ci->symbol str
  4595. Return the symbol whose name is @var{str}.  @var{str} is
  4596. converted to lowercase before the conversion is done, if Guile
  4597. is currently reading symbols case-insensitively.
  4598. @end deffn
  4599.  
  4600. string=?
  4601. @c snarfed from strorder.c:62
  4602. @deffn {Scheme Procedure} string=? s1 s2
  4603. Lexicographic equality predicate; return @code{#t} if the two
  4604. strings are the same length and contain the same characters in
  4605. the same positions, otherwise return @code{#f}.
  4606.  
  4607. The procedure @code{string-ci=?} treats upper and lower case
  4608. letters as though they were the same character, but
  4609. @code{string=?} treats upper and lower case as distinct
  4610. characters.
  4611. @end deffn
  4612.  
  4613. string-ci=?
  4614. @c snarfed from strorder.c:97
  4615. @deffn {Scheme Procedure} string-ci=? s1 s2
  4616. Case-insensitive string equality predicate; return @code{#t} if
  4617. the two strings are the same length and their component
  4618. characters match (ignoring case) at each position; otherwise
  4619. return @code{#f}.
  4620. @end deffn
  4621.  
  4622. string<?
  4623. @c snarfed from strorder.c:154
  4624. @deffn {Scheme Procedure} string<? s1 s2
  4625. Lexicographic ordering predicate; return @code{#t} if @var{s1}
  4626. is lexicographically less than @var{s2}.
  4627. @end deffn
  4628.  
  4629. string<=?
  4630. @c snarfed from strorder.c:168
  4631. @deffn {Scheme Procedure} string<=? s1 s2
  4632. Lexicographic ordering predicate; return @code{#t} if @var{s1}
  4633. is lexicographically less than or equal to @var{s2}.
  4634. @end deffn
  4635.  
  4636. string>?
  4637. @c snarfed from strorder.c:182
  4638. @deffn {Scheme Procedure} string>? s1 s2
  4639. Lexicographic ordering predicate; return @code{#t} if @var{s1}
  4640. is lexicographically greater than @var{s2}.
  4641. @end deffn
  4642.  
  4643. string>=?
  4644. @c snarfed from strorder.c:196
  4645. @deffn {Scheme Procedure} string>=? s1 s2
  4646. Lexicographic ordering predicate; return @code{#t} if @var{s1}
  4647. is lexicographically greater than or equal to @var{s2}.
  4648. @end deffn
  4649.  
  4650. string-ci<?
  4651. @c snarfed from strorder.c:235
  4652. @deffn {Scheme Procedure} string-ci<? s1 s2
  4653. Case insensitive lexicographic ordering predicate; return
  4654. @code{#t} if @var{s1} is lexicographically less than @var{s2}
  4655. regardless of case.
  4656. @end deffn
  4657.  
  4658. string-ci<=?
  4659. @c snarfed from strorder.c:250
  4660. @deffn {Scheme Procedure} string-ci<=? s1 s2
  4661. Case insensitive lexicographic ordering predicate; return
  4662. @code{#t} if @var{s1} is lexicographically less than or equal
  4663. to @var{s2} regardless of case.
  4664. @end deffn
  4665.  
  4666. string-ci>?
  4667. @c snarfed from strorder.c:265
  4668. @deffn {Scheme Procedure} string-ci>? s1 s2
  4669. Case insensitive lexicographic ordering predicate; return
  4670. @code{#t} if @var{s1} is lexicographically greater than
  4671. @var{s2} regardless of case.
  4672. @end deffn
  4673.  
  4674. string-ci>=?
  4675. @c snarfed from strorder.c:280
  4676. @deffn {Scheme Procedure} string-ci>=? s1 s2
  4677. Case insensitive lexicographic ordering predicate; return
  4678. @code{#t} if @var{s1} is lexicographically greater than or
  4679. equal to @var{s2} regardless of case.
  4680. @end deffn
  4681.  
  4682. object->string
  4683. @c snarfed from strports.c:321
  4684. @deffn {Scheme Procedure} object->string obj [printer]
  4685. Return a Scheme string obtained by printing @var{obj}.
  4686. Printing function can be specified by the optional second
  4687. argument @var{printer} (default: @code{write}).
  4688. @end deffn
  4689.  
  4690. call-with-output-string
  4691. @c snarfed from strports.c:355
  4692. @deffn {Scheme Procedure} call-with-output-string proc
  4693. Calls the one-argument procedure @var{proc} with a newly created output
  4694. port.  When the function returns, the string composed of the characters
  4695. written into the port is returned.
  4696. @end deffn
  4697.  
  4698. call-with-input-string
  4699. @c snarfed from strports.c:374
  4700. @deffn {Scheme Procedure} call-with-input-string string proc
  4701. Calls the one-argument procedure @var{proc} with a newly
  4702. created input port from which @var{string}'s contents may be
  4703. read.  The value yielded by the @var{proc} is returned.
  4704. @end deffn
  4705.  
  4706. open-input-string
  4707. @c snarfed from strports.c:387
  4708. @deffn {Scheme Procedure} open-input-string str
  4709. Take a string and return an input port that delivers characters
  4710. from the string. The port can be closed by
  4711. @code{close-input-port}, though its storage will be reclaimed
  4712. by the garbage collector if it becomes inaccessible.
  4713. @end deffn
  4714.  
  4715. open-output-string
  4716. @c snarfed from strports.c:401
  4717. @deffn {Scheme Procedure} open-output-string
  4718. Return an output port that will accumulate characters for
  4719. retrieval by @code{get-output-string}. The port can be closed
  4720. by the procedure @code{close-output-port}, though its storage
  4721. will be reclaimed by the garbage collector if it becomes
  4722. inaccessible.
  4723. @end deffn
  4724.  
  4725. get-output-string
  4726. @c snarfed from strports.c:418
  4727. @deffn {Scheme Procedure} get-output-string port
  4728. Given an output port created by @code{open-output-string},
  4729. return a string consisting of the characters that have been
  4730. output to the port so far.
  4731. @end deffn
  4732.  
  4733. eval-string
  4734. @c snarfed from strports.c:499
  4735. @deffn {Scheme Procedure} eval-string string
  4736. Evaluate @var{string} as the text representation of a Scheme
  4737. form or forms, and return whatever value they produce.
  4738. Evaluation takes place in the environment returned by the
  4739. procedure @code{interaction-environment}.
  4740. @end deffn
  4741.  
  4742. make-struct-layout
  4743. @c snarfed from struct.c:77
  4744. @deffn {Scheme Procedure} make-struct-layout fields
  4745. Return a new structure layout object.
  4746.  
  4747. @var{fields} must be a string made up of pairs of characters
  4748. strung together.  The first character of each pair describes a field
  4749. type, the second a field protection.  Allowed types are 'p' for
  4750. GC-protected Scheme data, 'u' for unprotected binary data, and 's' for
  4751. a field that points to the structure itself.    Allowed protections
  4752. are 'w' for mutable fields, 'r' for read-only fields, and 'o' for opaque
  4753. fields.  The last field protection specification may be capitalized to
  4754. indicate that the field is a tail-array.
  4755. @end deffn
  4756.  
  4757. struct?
  4758. @c snarfed from struct.c:244
  4759. @deffn {Scheme Procedure} struct? x
  4760. Return @code{#t} iff @var{x} is a structure object, else
  4761. @code{#f}.
  4762. @end deffn
  4763.  
  4764. struct-vtable?
  4765. @c snarfed from struct.c:253
  4766. @deffn {Scheme Procedure} struct-vtable? x
  4767. Return @code{#t} iff @var{x} is a vtable structure.
  4768. @end deffn
  4769.  
  4770. make-struct
  4771. @c snarfed from struct.c:440
  4772. @deffn {Scheme Procedure} make-struct vtable tail_array_size . init
  4773. Create a new structure.
  4774.  
  4775. @var{type} must be a vtable structure (@pxref{Vtables}).
  4776.  
  4777. @var{tail-elts} must be a non-negative integer.  If the layout
  4778. specification indicated by @var{type} includes a tail-array,
  4779. this is the number of elements allocated to that array.
  4780.  
  4781. The @var{init1}, @dots{} are optional arguments describing how
  4782. successive fields of the structure should be initialized.  Only fields
  4783. with protection 'r' or 'w' can be initialized, except for fields of
  4784. type 's', which are automatically initialized to point to the new
  4785. structure itself; fields with protection 'o' can not be initialized by
  4786. Scheme programs.
  4787.  
  4788. If fewer optional arguments than initializable fields are supplied,
  4789. fields of type 'p' get default value #f while fields of type 'u' are
  4790. initialized to 0.
  4791.  
  4792. Structs are currently the basic representation for record-like data
  4793. structures in Guile.  The plan is to eventually replace them with a
  4794. new representation which will at the same time be easier to use and
  4795. more powerful.
  4796.  
  4797. For more information, see the documentation for @code{make-vtable-vtable}.
  4798. @end deffn
  4799.  
  4800. make-vtable-vtable
  4801. @c snarfed from struct.c:526
  4802. @deffn {Scheme Procedure} make-vtable-vtable user_fields tail_array_size . init
  4803. Return a new, self-describing vtable structure.
  4804.  
  4805. @var{user-fields} is a string describing user defined fields of the
  4806. vtable beginning at index @code{vtable-offset-user}
  4807. (see @code{make-struct-layout}).
  4808.  
  4809. @var{tail-size} specifies the size of the tail-array (if any) of
  4810. this vtable.
  4811.  
  4812. @var{init1}, @dots{} are the optional initializers for the fields of
  4813. the vtable.
  4814.  
  4815. Vtables have one initializable system field---the struct printer.
  4816. This field comes before the user fields in the initializers passed
  4817. to @code{make-vtable-vtable} and @code{make-struct}, and thus works as
  4818. a third optional argument to @code{make-vtable-vtable} and a fourth to
  4819. @code{make-struct} when creating vtables:
  4820.  
  4821. If the value is a procedure, it will be called instead of the standard
  4822. printer whenever a struct described by this vtable is printed.
  4823. The procedure will be called with arguments STRUCT and PORT.
  4824.  
  4825. The structure of a struct is described by a vtable, so the vtable is
  4826. in essence the type of the struct.  The vtable is itself a struct with
  4827. a vtable.  This could go on forever if it weren't for the
  4828. vtable-vtables which are self-describing vtables, and thus terminate
  4829. the chain.
  4830.  
  4831. There are several potential ways of using structs, but the standard
  4832. one is to use three kinds of structs, together building up a type
  4833. sub-system: one vtable-vtable working as the root and one or several
  4834. "types", each with a set of "instances".  (The vtable-vtable should be
  4835. compared to the class <class> which is the class of itself.)
  4836.  
  4837. @lisp
  4838. (define ball-root (make-vtable-vtable "pr" 0))
  4839.  
  4840. (define (make-ball-type ball-color)
  4841.   (make-struct ball-root 0
  4842.            (make-struct-layout "pw")
  4843.                (lambda (ball port)
  4844.                  (format port "#<a ~A ball owned by ~A>"
  4845.                          (color ball)
  4846.                          (owner ball)))
  4847.                ball-color))
  4848. (define (color ball) (struct-ref (struct-vtable ball) vtable-offset-user))
  4849. (define (owner ball) (struct-ref ball 0))
  4850.  
  4851. (define red (make-ball-type 'red))
  4852. (define green (make-ball-type 'green))
  4853.  
  4854. (define (make-ball type owner) (make-struct type 0 owner))
  4855.  
  4856. (define ball (make-ball green 'Nisse))
  4857. ball @result{} #<a green ball owned by Nisse>
  4858. @end lisp
  4859. @end deffn
  4860.  
  4861. struct-ref
  4862. @c snarfed from struct.c:569
  4863. @deffn {Scheme Procedure} struct-ref handle pos
  4864. @deffnx {Scheme Procedure} struct-set! struct n value
  4865. Access (or modify) the @var{n}th field of @var{struct}.
  4866.  
  4867. If the field is of type 'p', then it can be set to an arbitrary value.
  4868.  
  4869. If the field is of type 'u', then it can only be set to a non-negative
  4870. integer value small enough to fit in one machine word.
  4871. @end deffn
  4872.  
  4873. struct-set!
  4874. @c snarfed from struct.c:647
  4875. @deffn {Scheme Procedure} struct-set! handle pos val
  4876. Set the slot of the structure @var{handle} with index @var{pos}
  4877. to @var{val}.  Signal an error if the slot can not be written
  4878. to.
  4879. @end deffn
  4880.  
  4881. struct-vtable
  4882. @c snarfed from struct.c:717
  4883. @deffn {Scheme Procedure} struct-vtable handle
  4884. Return the vtable structure that describes the type of @var{struct}.
  4885. @end deffn
  4886.  
  4887. struct-vtable-tag
  4888. @c snarfed from struct.c:728
  4889. @deffn {Scheme Procedure} struct-vtable-tag handle
  4890. Return the vtable tag of the structure @var{handle}.
  4891. @end deffn
  4892.  
  4893. struct-vtable-name
  4894. @c snarfed from struct.c:767
  4895. @deffn {Scheme Procedure} struct-vtable-name vtable
  4896. Return the name of the vtable @var{vtable}.
  4897. @end deffn
  4898.  
  4899. set-struct-vtable-name!
  4900. @c snarfed from struct.c:777
  4901. @deffn {Scheme Procedure} set-struct-vtable-name! vtable name
  4902. Set the name of the vtable @var{vtable} to @var{name}.
  4903. @end deffn
  4904.  
  4905. symbol?
  4906. @c snarfed from symbols.c:152
  4907. @deffn {Scheme Procedure} symbol? obj
  4908. Return @code{#t} if @var{obj} is a symbol, otherwise return
  4909. @code{#f}.
  4910. @end deffn
  4911.  
  4912. symbol->string
  4913. @c snarfed from symbols.c:183
  4914. @deffn {Scheme Procedure} symbol->string s
  4915. Return the name of @var{symbol} as a string.  If the symbol was
  4916. part of an object returned as the value of a literal expression
  4917. (section @pxref{Literal expressions,,,r5rs, The Revised^5
  4918. Report on Scheme}) or by a call to the @code{read} procedure,
  4919. and its name contains alphabetic characters, then the string
  4920. returned will contain characters in the implementation's
  4921. preferred standard case---some implementations will prefer
  4922. upper case, others lower case.  If the symbol was returned by
  4923. @code{string->symbol}, the case of characters in the string
  4924. returned will be the same as the case in the string that was
  4925. passed to @code{string->symbol}.  It is an error to apply
  4926. mutation procedures like @code{string-set!} to strings returned
  4927. by this procedure.
  4928.  
  4929. The following examples assume that the implementation's
  4930. standard case is lower case:
  4931.  
  4932. @lisp
  4933. (symbol->string 'flying-fish)    @result{} "flying-fish"
  4934. (symbol->string 'Martin)         @result{}  "martin"
  4935. (symbol->string
  4936.    (string->symbol "Malvina")) @result{} "Malvina"
  4937. @end lisp
  4938. @end deffn
  4939.  
  4940. string->symbol
  4941. @c snarfed from symbols.c:216
  4942. @deffn {Scheme Procedure} string->symbol string
  4943. Return the symbol whose name is @var{string}. This procedure
  4944. can create symbols with names containing special characters or
  4945. letters in the non-standard case, but it is usually a bad idea
  4946. to create such symbols because in some implementations of
  4947. Scheme they cannot be read as themselves.  See
  4948. @code{symbol->string}.
  4949.  
  4950. The following examples assume that the implementation's
  4951. standard case is lower case:
  4952.  
  4953. @lisp
  4954. (eq? 'mISSISSIppi 'mississippi) @result{} #t
  4955. (string->symbol "mISSISSIppi") @result{} @r{the symbol with name "mISSISSIppi"}
  4956. (eq? 'bitBlt (string->symbol "bitBlt")) @result{} #f
  4957. (eq? 'JollyWog
  4958.   (string->symbol (symbol->string 'JollyWog))) @result{} #t
  4959. (string=? "K. Harper, M.D."
  4960.   (symbol->string
  4961.     (string->symbol "K. Harper, M.D."))) @result{}#t
  4962. @end lisp
  4963. @end deffn
  4964.  
  4965. gensym
  4966. @c snarfed from symbols.c:235
  4967. @deffn {Scheme Procedure} gensym [prefix]
  4968. Create a new symbol with a name constructed from a prefix and
  4969. a counter value. The string @var{prefix} can be specified as
  4970. an optional argument. Default prefix is @code{ g}.  The counter
  4971. is increased by 1 at each call. There is no provision for
  4972. resetting the counter.
  4973. @end deffn
  4974.  
  4975. symbol-hash
  4976. @c snarfed from symbols.c:267
  4977. @deffn {Scheme Procedure} symbol-hash symbol
  4978. Return a hash value for @var{symbol}.
  4979. @end deffn
  4980.  
  4981. symbol-fref
  4982. @c snarfed from symbols.c:277
  4983. @deffn {Scheme Procedure} symbol-fref s
  4984. Return the contents of @var{symbol}'s @dfn{function slot}.
  4985. @end deffn
  4986.  
  4987. symbol-pref
  4988. @c snarfed from symbols.c:288
  4989. @deffn {Scheme Procedure} symbol-pref s
  4990. Return the @dfn{property list} currently associated with @var{symbol}.
  4991. @end deffn
  4992.  
  4993. symbol-fset!
  4994. @c snarfed from symbols.c:299
  4995. @deffn {Scheme Procedure} symbol-fset! s val
  4996. Change the binding of @var{symbol}'s function slot.
  4997. @end deffn
  4998.  
  4999. symbol-pset!
  5000. @c snarfed from symbols.c:311
  5001. @deffn {Scheme Procedure} symbol-pset! s val
  5002. Change the binding of @var{symbol}'s property slot.
  5003. @end deffn
  5004.  
  5005. catch
  5006. @c snarfed from throw.c:533
  5007. @deffn {Scheme Procedure} catch key thunk handler
  5008. Invoke @var{thunk} in the dynamic context of @var{handler} for
  5009. exceptions matching @var{key}.  If thunk throws to the symbol
  5010. @var{key}, then @var{handler} is invoked this way:
  5011. @lisp
  5012. (handler key args ...)
  5013. @end lisp
  5014.  
  5015. @var{key} is a symbol or @code{#t}.
  5016.  
  5017. @var{thunk} takes no arguments.  If @var{thunk} returns
  5018. normally, that is the return value of @code{catch}.
  5019.  
  5020. Handler is invoked outside the scope of its own @code{catch}.
  5021. If @var{handler} again throws to the same key, a new handler
  5022. from further up the call chain is invoked.
  5023.  
  5024. If the key is @code{#t}, then a throw to @emph{any} symbol will
  5025. match this call to @code{catch}.
  5026. @end deffn
  5027.  
  5028. lazy-catch
  5029. @c snarfed from throw.c:561
  5030. @deffn {Scheme Procedure} lazy-catch key thunk handler
  5031. This behaves exactly like @code{catch}, except that it does
  5032. not unwind the stack before invoking @var{handler}.
  5033. The @var{handler} procedure is not allowed to return:
  5034. it must throw to another catch, or otherwise exit non-locally.
  5035. @end deffn
  5036.  
  5037. throw
  5038. @c snarfed from throw.c:594
  5039. @deffn {Scheme Procedure} throw key . args
  5040. Invoke the catch form matching @var{key}, passing @var{args} to the
  5041. @var{handler}.  
  5042.  
  5043. @var{key} is a symbol.  It will match catches of the same symbol or of
  5044. @code{#t}.
  5045.  
  5046. If there is no handler at all, Guile prints an error and then exits.
  5047. @end deffn
  5048.  
  5049. values
  5050. @c snarfed from values.c:77
  5051. @deffn {Scheme Procedure} values . args
  5052. Delivers all of its arguments to its continuation.  Except for
  5053. continuations created by the @code{call-with-values} procedure,
  5054. all continuations take exactly one value.  The effect of
  5055. passing no value or more than one value to continuations that
  5056. were not created by @code{call-with-values} is unspecified.
  5057. @end deffn
  5058.  
  5059. make-variable
  5060. @c snarfed from variable.c:91
  5061. @deffn {Scheme Procedure} make-variable init
  5062. Return a variable initialized to value @var{init}.
  5063. @end deffn
  5064.  
  5065. make-undefined-variable
  5066. @c snarfed from variable.c:101
  5067. @deffn {Scheme Procedure} make-undefined-variable
  5068. Return a variable that is initially unbound.
  5069. @end deffn
  5070.  
  5071. variable?
  5072. @c snarfed from variable.c:112
  5073. @deffn {Scheme Procedure} variable? obj
  5074. Return @code{#t} iff @var{obj} is a variable object, else
  5075. return @code{#f}.
  5076. @end deffn
  5077.  
  5078. variable-ref
  5079. @c snarfed from variable.c:124
  5080. @deffn {Scheme Procedure} variable-ref var
  5081. Dereference @var{var} and return its value.
  5082. @var{var} must be a variable object; see @code{make-variable}
  5083. and @code{make-undefined-variable}.
  5084. @end deffn
  5085.  
  5086. variable-set!
  5087. @c snarfed from variable.c:140
  5088. @deffn {Scheme Procedure} variable-set! var val
  5089. Set the value of the variable @var{var} to @var{val}.
  5090. @var{var} must be a variable object, @var{val} can be any
  5091. value. Return an unspecified value.
  5092. @end deffn
  5093.  
  5094. variable-bound?
  5095. @c snarfed from variable.c:152
  5096. @deffn {Scheme Procedure} variable-bound? var
  5097. Return @code{#t} iff @var{var} is bound to a value.
  5098. Throws an error if @var{var} is not a variable object.
  5099. @end deffn
  5100.  
  5101. variable-set-name-hint!
  5102. @c snarfed from variable.c:162
  5103. @deffn {Scheme Procedure} variable-set-name-hint! var hint
  5104. Do not use this function.
  5105. @end deffn
  5106.  
  5107. builtin-variable
  5108. @c snarfed from variable.c:180
  5109. @deffn {Scheme Procedure} builtin-variable name
  5110. Return the built-in variable with the name @var{name}.
  5111. @var{name} must be a symbol (not a string).
  5112. Then use @code{variable-ref} to access its value.
  5113. @end deffn
  5114.  
  5115. vector?
  5116. @c snarfed from vectors.c:140
  5117. @deffn {Scheme Procedure} vector? obj
  5118. Return @code{#t} if @var{obj} is a vector, otherwise return
  5119. @code{#f}.
  5120. @end deffn
  5121.  
  5122. list->vector
  5123. @c snarfed from vectors.c:159
  5124. @deffn {Scheme Procedure} list->vector
  5125. implemented by the C function "scm_vector"
  5126. @end deffn
  5127.  
  5128. vector
  5129. @c snarfed from vectors.c:176
  5130. @deffn {Scheme Procedure} vector . l
  5131. @deffnx {Scheme Procedure} list->vector l
  5132. Return a newly allocated vector whose elements contain the
  5133. given arguments.  Analogous to @code{list}.
  5134.  
  5135. @lisp
  5136. (vector 'a 'b 'c) @result{} #(a b c)
  5137. @end lisp
  5138. @end deffn
  5139.  
  5140. make-vector
  5141. @c snarfed from vectors.c:262
  5142. @deffn {Scheme Procedure} make-vector k [fill]
  5143. Return a newly allocated vector of @var{k} elements.  If a
  5144. second argument is given, then each element is initialized to
  5145. @var{fill}.  Otherwise the initial contents of each element is
  5146. unspecified.
  5147. @end deffn
  5148.  
  5149. vector->list
  5150. @c snarfed from vectors.c:319
  5151. @deffn {Scheme Procedure} vector->list v
  5152. Return a newly allocated list of the objects contained in the
  5153. elements of @var{vector}.
  5154.  
  5155. @lisp
  5156. (vector->list '#(dah dah didah)) @result{}  (dah dah didah)
  5157. (list->vector '(dididit dah)) @result{}  #(dididit dah)
  5158. @end lisp
  5159. @end deffn
  5160.  
  5161. vector-fill!
  5162. @c snarfed from vectors.c:336
  5163. @deffn {Scheme Procedure} vector-fill! v fill
  5164. Store @var{fill} in every element of @var{vector}.  The value
  5165. returned by @code{vector-fill!} is unspecified.
  5166. @end deffn
  5167.  
  5168. vector-move-left!
  5169. @c snarfed from vectors.c:369
  5170. @deffn {Scheme Procedure} vector-move-left! vec1 start1 end1 vec2 start2
  5171. Copy elements from @var{vec1}, positions @var{start1} to @var{end1},
  5172. to @var{vec2} starting at position @var{start2}.  @var{start1} and
  5173. @var{start2} are inclusive indices; @var{end1} is exclusive.
  5174.  
  5175. @code{vector-move-left!} copies elements in leftmost order.
  5176. Therefore, in the case where @var{vec1} and @var{vec2} refer to the
  5177. same vector, @code{vector-move-left!} is usually appropriate when
  5178. @var{start1} is greater than @var{start2}.
  5179. @end deffn
  5180.  
  5181. vector-move-right!
  5182. @c snarfed from vectors.c:398
  5183. @deffn {Scheme Procedure} vector-move-right! vec1 start1 end1 vec2 start2
  5184. Copy elements from @var{vec1}, positions @var{start1} to @var{end1},
  5185. to @var{vec2} starting at position @var{start2}.  @var{start1} and
  5186. @var{start2} are inclusive indices; @var{end1} is exclusive.
  5187.  
  5188. @code{vector-move-right!} copies elements in rightmost order.
  5189. Therefore, in the case where @var{vec1} and @var{vec2} refer to the
  5190. same vector, @code{vector-move-right!} is usually appropriate when
  5191. @var{start1} is less than @var{start2}.
  5192. @end deffn
  5193.  
  5194. major-version
  5195. @c snarfed from version.c:57
  5196. @deffn {Scheme Procedure} major-version
  5197. Return a string containing Guile's major version number.
  5198. E.g., the 1 in "1.6.5".
  5199. @end deffn
  5200.  
  5201. minor-version
  5202. @c snarfed from version.c:70
  5203. @deffn {Scheme Procedure} minor-version
  5204. Return a string containing Guile's minor version number.
  5205. E.g., the 6 in "1.6.5".
  5206. @end deffn
  5207.  
  5208. micro-version
  5209. @c snarfed from version.c:83
  5210. @deffn {Scheme Procedure} micro-version
  5211. Return a string containing Guile's micro version number.
  5212. E.g., the 5 in "1.6.5".
  5213. @end deffn
  5214.  
  5215. version
  5216. @c snarfed from version.c:105
  5217. @deffn {Scheme Procedure} version
  5218. @deffnx {Scheme Procedure} major-version
  5219. @deffnx {Scheme Procedure} minor-version
  5220. @deffnx {Scheme Procedure} micro-version
  5221. Return a string describing Guile's version number, or its major, minor
  5222. or micro version number, respectively.
  5223.  
  5224. @lisp
  5225. (version) @result{} "1.6.0"
  5226. (major-version) @result{} "1"
  5227. (minor-version) @result{} "6"
  5228. (micro-version) @result{} "0"
  5229. @end lisp
  5230. @end deffn
  5231.  
  5232. effective-version
  5233. @c snarfed from version.c:136
  5234. @deffn {Scheme Procedure} effective-version
  5235. Return a string describing Guile's effective version number.
  5236. @lisp
  5237. (version) @result{} "1.6.0"
  5238. (effective-version) @result{} "1.6"
  5239. (major-version) @result{} "1"
  5240. (minor-version) @result{} "6"
  5241. (micro-version) @result{} "0"
  5242. @end lisp
  5243. @end deffn
  5244.  
  5245. make-soft-port
  5246. @c snarfed from vports.c:185
  5247. @deffn {Scheme Procedure} make-soft-port pv modes
  5248. Return a port capable of receiving or delivering characters as
  5249. specified by the @var{modes} string (@pxref{File Ports,
  5250. open-file}).  @var{pv} must be a vector of length 5.  Its
  5251. components are as follows:
  5252.  
  5253. @enumerate 0
  5254. @item
  5255. procedure accepting one character for output
  5256. @item
  5257. procedure accepting a string for output
  5258. @item
  5259. thunk for flushing output
  5260. @item
  5261. thunk for getting one character
  5262. @item
  5263. thunk for closing port (not by garbage collection)
  5264. @end enumerate
  5265.  
  5266. For an output-only port only elements 0, 1, 2, and 4 need be
  5267. procedures.  For an input-only port only elements 3 and 4 need
  5268. be procedures.  Thunks 2 and 4 can instead be @code{#f} if
  5269. there is no useful operation for them to perform.
  5270.  
  5271. If thunk 3 returns @code{#f} or an @code{eof-object}
  5272. (@pxref{Input, eof-object?, ,r5rs, The Revised^5 Report on
  5273. Scheme}) it indicates that the port has reached end-of-file.
  5274. For example:
  5275.  
  5276. @lisp
  5277. (define stdout (current-output-port))
  5278. (define p (make-soft-port
  5279.            (vector
  5280.             (lambda (c) (write c stdout))
  5281.             (lambda (s) (display s stdout))
  5282.             (lambda () (display "." stdout))
  5283.             (lambda () (char-upcase (read-char)))
  5284.             (lambda () (display "@@" stdout)))
  5285.            "rw"))
  5286.  
  5287. (write p p) @result{} #<input-output: soft 8081e20>
  5288. @end lisp
  5289. @end deffn
  5290.  
  5291. make-weak-vector
  5292. @c snarfed from weaks.c:115
  5293. @deffn {Scheme Procedure} make-weak-vector size [fill]
  5294. Return a weak vector with @var{size} elements. If the optional
  5295. argument @var{fill} is given, all entries in the vector will be
  5296. set to @var{fill}. The default value for @var{fill} is the
  5297. empty list.
  5298. @end deffn
  5299.  
  5300. list->weak-vector
  5301. @c snarfed from weaks.c:123
  5302. @deffn {Scheme Procedure} list->weak-vector
  5303. implemented by the C function "scm_weak_vector"
  5304. @end deffn
  5305.  
  5306. weak-vector
  5307. @c snarfed from weaks.c:131
  5308. @deffn {Scheme Procedure} weak-vector . l
  5309. @deffnx {Scheme Procedure} list->weak-vector l
  5310. Construct a weak vector from a list: @code{weak-vector} uses
  5311. the list of its arguments while @code{list->weak-vector} uses
  5312. its only argument @var{l} (a list) to construct a weak vector
  5313. the same way @code{list->vector} would.
  5314. @end deffn
  5315.  
  5316. weak-vector?
  5317. @c snarfed from weaks.c:159
  5318. @deffn {Scheme Procedure} weak-vector? obj
  5319. Return @code{#t} if @var{obj} is a weak vector. Note that all
  5320. weak hashes are also weak vectors.
  5321. @end deffn
  5322.  
  5323. make-weak-key-hash-table
  5324. @c snarfed from weaks.c:177
  5325. @deffn {Scheme Procedure} make-weak-key-hash-table size
  5326. @deffnx {Scheme Procedure} make-weak-value-hash-table size
  5327. @deffnx {Scheme Procedure} make-doubly-weak-hash-table size
  5328. Return a weak hash table with @var{size} buckets. As with any
  5329. hash table, choosing a good size for the table requires some
  5330. caution.
  5331.  
  5332. You can modify weak hash tables in exactly the same way you
  5333. would modify regular hash tables. (@pxref{Hash Tables})
  5334. @end deffn
  5335.  
  5336. make-weak-value-hash-table
  5337. @c snarfed from weaks.c:188
  5338. @deffn {Scheme Procedure} make-weak-value-hash-table size
  5339. Return a hash table with weak values with @var{size} buckets.
  5340. (@pxref{Hash Tables})
  5341. @end deffn
  5342.  
  5343. make-doubly-weak-hash-table
  5344. @c snarfed from weaks.c:199
  5345. @deffn {Scheme Procedure} make-doubly-weak-hash-table size
  5346. Return a hash table with weak keys and values with @var{size}
  5347. buckets.  (@pxref{Hash Tables})
  5348. @end deffn
  5349.  
  5350. weak-key-hash-table?
  5351. @c snarfed from weaks.c:213
  5352. @deffn {Scheme Procedure} weak-key-hash-table? obj
  5353. @deffnx {Scheme Procedure} weak-value-hash-table? obj
  5354. @deffnx {Scheme Procedure} doubly-weak-hash-table? obj
  5355. Return @code{#t} if @var{obj} is the specified weak hash
  5356. table. Note that a doubly weak hash table is neither a weak key
  5357. nor a weak value hash table.
  5358. @end deffn
  5359.  
  5360. weak-value-hash-table?
  5361. @c snarfed from weaks.c:223
  5362. @deffn {Scheme Procedure} weak-value-hash-table? obj
  5363. Return @code{#t} if @var{obj} is a weak value hash table.
  5364. @end deffn
  5365.  
  5366. doubly-weak-hash-table?
  5367. @c snarfed from weaks.c:233
  5368. @deffn {Scheme Procedure} doubly-weak-hash-table? obj
  5369. Return @code{#t} if @var{obj} is a doubly weak hash table.
  5370. @end deffn
  5371.  
  5372. string->obarray-symbol
  5373. @c snarfed from symbols-deprecated.c:288
  5374. @deffn {Scheme Procedure} string->obarray-symbol o s [softp]
  5375. Intern a new symbol in @var{obarray}, a symbol table, with name
  5376. @var{string}.
  5377.  
  5378. If @var{obarray} is @code{#f}, use the default system symbol table.  If
  5379. @var{obarray} is @code{#t}, the symbol should not be interned in any
  5380. symbol table; merely return the pair (@var{symbol}
  5381. . @var{#<undefined>}).
  5382.  
  5383. The @var{soft?} argument determines whether new symbol table entries
  5384. should be created when the specified symbol is not already present in
  5385. @var{obarray}.  If @var{soft?} is specified and is a true value, then
  5386. new entries should not be added for symbols not already present in the
  5387. table; instead, simply return @code{#f}.
  5388. @end deffn
  5389.  
  5390. intern-symbol
  5391. @c snarfed from symbols-deprecated.c:326
  5392. @deffn {Scheme Procedure} intern-symbol o s
  5393. Add a new symbol to @var{obarray} with name @var{string}, bound to an
  5394. unspecified initial value.  The symbol table is not modified if a symbol
  5395. with this name is already present.
  5396. @end deffn
  5397.  
  5398. unintern-symbol
  5399. @c snarfed from symbols-deprecated.c:367
  5400. @deffn {Scheme Procedure} unintern-symbol o s
  5401. Remove the symbol with name @var{string} from @var{obarray}.  This
  5402. function returns @code{#t} if the symbol was present and @code{#f}
  5403. otherwise.
  5404. @end deffn
  5405.  
  5406. symbol-binding
  5407. @c snarfed from symbols-deprecated.c:412
  5408. @deffn {Scheme Procedure} symbol-binding o s
  5409. Look up in @var{obarray} the symbol whose name is @var{string}, and
  5410. return the value to which it is bound.  If @var{obarray} is @code{#f},
  5411. use the global symbol table.  If @var{string} is not interned in
  5412. @var{obarray}, an error is signalled.
  5413. @end deffn
  5414.  
  5415. symbol-interned?
  5416. @c snarfed from symbols-deprecated.c:433
  5417. @deffn {Scheme Procedure} symbol-interned? o s
  5418. Return @code{#t} if @var{obarray} contains a symbol with name
  5419. @var{string}, and @code{#f} otherwise.
  5420. @end deffn
  5421.  
  5422. symbol-bound?
  5423. @c snarfed from symbols-deprecated.c:465
  5424. @deffn {Scheme Procedure} symbol-bound? o s
  5425. Return @code{#t} if @var{obarray} contains a symbol with name
  5426. @var{string} bound to a defined value.  This differs from
  5427. @var{symbol-interned?} in that the mere mention of a symbol
  5428. usually causes it to be interned; @code{symbol-bound?}
  5429. determines whether a symbol has been given any meaningful
  5430. value.
  5431. @end deffn
  5432.  
  5433. symbol-set!
  5434. @c snarfed from symbols-deprecated.c:492
  5435. @deffn {Scheme Procedure} symbol-set! o s v
  5436. Find the symbol in @var{obarray} whose name is @var{string}, and rebind
  5437. it to @var{value}.  An error is signalled if @var{string} is not present
  5438. in @var{obarray}.
  5439. @end deffn
  5440.  
  5441. gentemp
  5442. @c snarfed from symbols-deprecated.c:571
  5443. @deffn {Scheme Procedure} gentemp [prefix [obarray]]
  5444. Create a new symbol with a name unique in an obarray.
  5445. The name is constructed from an optional string @var{prefix}
  5446. and a counter value.  The default prefix is @code{t}.  The
  5447. @var{obarray} is specified as a second optional argument.
  5448. Default is the system obarray where all normal symbols are
  5449. interned.  The counter is increased by 1 at each
  5450. call.  There is no provision for resetting the counter.
  5451. @end deffn
  5452.  
  5453. array-fill!
  5454. @c snarfed from ramap.c:462
  5455. @deffn {Scheme Procedure} array-fill! ra fill
  5456. Store @var{fill} in every element of @var{array}.  The value returned
  5457. is unspecified.
  5458. @end deffn
  5459.  
  5460. array-copy-in-order!
  5461. @c snarfed from ramap.c:827
  5462. @deffn {Scheme Procedure} array-copy-in-order!
  5463. implemented by the C function "scm_array_copy_x"
  5464. @end deffn
  5465.  
  5466. array-copy!
  5467. @c snarfed from ramap.c:836
  5468. @deffn {Scheme Procedure} array-copy! src dst
  5469. @deffnx {Scheme Procedure} array-copy-in-order! src dst
  5470. Copy every element from vector or array @var{source} to the
  5471. corresponding element of @var{destination}.  @var{destination} must have
  5472. the same rank as @var{source}, and be at least as large in each
  5473. dimension.  The order is unspecified.
  5474. @end deffn
  5475.  
  5476. array-map-in-order!
  5477. @c snarfed from ramap.c:1516
  5478. @deffn {Scheme Procedure} array-map-in-order!
  5479. implemented by the C function "scm_array_map_x"
  5480. @end deffn
  5481.  
  5482. array-map!
  5483. @c snarfed from ramap.c:1527
  5484. @deffn {Scheme Procedure} array-map! dest proc . sources
  5485. @var{dest} must be an array, and @var{sources} must be a non-empty list
  5486. of arrays where each element must have the same number of dimensions as
  5487. @var{dest} and must have a range for each index which includes the range
  5488. for the corresponding index in @var{dest}.  @var{proc} is applied to
  5489. each tuple of elements of @var{sources} and the result is stored as the
  5490. corresponding element in @var{dest}.  The value returned is unspecified, and
  5491. the order of application is unspecified.
  5492.  
  5493. @end deffn
  5494.  
  5495. array-for-each
  5496. @c snarfed from ramap.c:1684
  5497. @deffn {Scheme Procedure} array-for-each proc ra0 . lra
  5498. Apply @var{proc} to each tuple of elements of @var{array0} @dots{}
  5499. in row-major order.  The value returned is unspecified.
  5500. @end deffn
  5501.  
  5502. array-index-map!
  5503. @c snarfed from ramap.c:1712
  5504. @deffn {Scheme Procedure} array-index-map! ra proc
  5505. Apply @var{proc} to the indices of each element of @var{array} in
  5506. turn, storing the result in the corresponding element.  The value
  5507. returned and the order of application are unspecified.
  5508.  
  5509. One can implement @var{array-indexes} as
  5510. @lisp
  5511. (define (array-indexes array)
  5512.     (let ((ra (apply make-array #f (array-shape array))))
  5513.       (array-index-map! ra (lambda x x))
  5514.       ra))
  5515. @end lisp
  5516. Another example:
  5517. @lisp
  5518. (define (apl:index-generator n)
  5519.     (let ((v (make-uniform-vector n 1)))
  5520.       (array-index-map! v (lambda (i) i))
  5521.       v))
  5522. @end lisp
  5523. @end deffn
  5524.  
  5525. uniform-vector-length
  5526. @c snarfed from unif.c:257
  5527. @deffn {Scheme Procedure} uniform-vector-length v
  5528. Return the number of elements in @var{uve}.
  5529. @end deffn
  5530.  
  5531. array?
  5532. @c snarfed from unif.c:291
  5533. @deffn {Scheme Procedure} array? v [prot]
  5534. Return @code{#t} if the @var{obj} is an array, and @code{#f} if
  5535. not.  The @var{prototype} argument is used with uniform arrays
  5536. and is described elsewhere.
  5537. @end deffn
  5538.  
  5539. array-rank
  5540. @c snarfed from unif.c:372
  5541. @deffn {Scheme Procedure} array-rank ra
  5542. Return the number of dimensions of @var{obj}.  If @var{obj} is
  5543. not an array, @code{0} is returned.
  5544. @end deffn
  5545.  
  5546. array-dimensions
  5547. @c snarfed from unif.c:410
  5548. @deffn {Scheme Procedure} array-dimensions ra
  5549. @code{Array-dimensions} is similar to @code{array-shape} but replaces
  5550. elements with a @code{0} minimum with one greater than the maximum. So:
  5551. @lisp
  5552. (array-dimensions (make-array 'foo '(-1 3) 5)) @result{} ((-1 3) 5)
  5553. @end lisp
  5554. @end deffn
  5555.  
  5556. shared-array-root
  5557. @c snarfed from unif.c:457
  5558. @deffn {Scheme Procedure} shared-array-root ra
  5559. Return the root vector of a shared array.
  5560. @end deffn
  5561.  
  5562. shared-array-offset
  5563. @c snarfed from unif.c:468
  5564. @deffn {Scheme Procedure} shared-array-offset ra
  5565. Return the root vector index of the first element in the array.
  5566. @end deffn
  5567.  
  5568. shared-array-increments
  5569. @c snarfed from unif.c:479
  5570. @deffn {Scheme Procedure} shared-array-increments ra
  5571. For each dimension, return the distance between elements in the root vector.
  5572. @end deffn
  5573.  
  5574. dimensions->uniform-array
  5575. @c snarfed from unif.c:599
  5576. @deffn {Scheme Procedure} dimensions->uniform-array dims prot [fill]
  5577. @deffnx {Scheme Procedure} make-uniform-vector length prototype [fill]
  5578. Create and return a uniform array or vector of type
  5579. corresponding to @var{prototype} with dimensions @var{dims} or
  5580. length @var{length}.  If @var{fill} is supplied, it's used to
  5581. fill the array, otherwise @var{prototype} is used.
  5582. @end deffn
  5583.  
  5584. make-shared-array
  5585. @c snarfed from unif.c:688
  5586. @deffn {Scheme Procedure} make-shared-array oldra mapfunc . dims
  5587. @code{make-shared-array} can be used to create shared subarrays of other
  5588. arrays.  The @var{mapper} is a function that translates coordinates in
  5589. the new array into coordinates in the old array.  A @var{mapper} must be
  5590. linear, and its range must stay within the bounds of the old array, but
  5591. it can be otherwise arbitrary.  A simple example:
  5592. @lisp
  5593. (define fred (make-array #f 8 8))
  5594. (define freds-diagonal
  5595.   (make-shared-array fred (lambda (i) (list i i)) 8))
  5596. (array-set! freds-diagonal 'foo 3)
  5597. (array-ref fred 3 3) @result{} foo
  5598. (define freds-center
  5599.   (make-shared-array fred (lambda (i j) (list (+ 3 i) (+ 3 j))) 2 2))
  5600. (array-ref freds-center 0 0) @result{} foo
  5601. @end lisp
  5602. @end deffn
  5603.  
  5604. transpose-array
  5605. @c snarfed from unif.c:820
  5606. @deffn {Scheme Procedure} transpose-array ra . args
  5607. Return an array sharing contents with @var{array}, but with
  5608. dimensions arranged in a different order.  There must be one
  5609. @var{dim} argument for each dimension of @var{array}.
  5610. @var{dim0}, @var{dim1}, @dots{} should be integers between 0
  5611. and the rank of the array to be returned.  Each integer in that
  5612. range must appear at least once in the argument list.
  5613.  
  5614. The values of @var{dim0}, @var{dim1}, @dots{} correspond to
  5615. dimensions in the array to be returned, their positions in the
  5616. argument list to dimensions of @var{array}.  Several @var{dim}s
  5617. may have the same value, in which case the returned array will
  5618. have smaller rank than @var{array}.
  5619.  
  5620. @lisp
  5621. (transpose-array '#2((a b) (c d)) 1 0) @result{} #2((a c) (b d))
  5622. (transpose-array '#2((a b) (c d)) 0 0) @result{} #1(a d)
  5623. (transpose-array '#3(((a b c) (d e f)) ((1 2 3) (4 5 6))) 1 1 0) @result{}
  5624.                 #2((a 4) (b 5) (c 6))
  5625. @end lisp
  5626. @end deffn
  5627.  
  5628. enclose-array
  5629. @c snarfed from unif.c:929
  5630. @deffn {Scheme Procedure} enclose-array ra . axes
  5631. @var{dim0}, @var{dim1} @dots{} should be nonnegative integers less than
  5632. the rank of @var{array}.  @var{enclose-array} returns an array
  5633. resembling an array of shared arrays.  The dimensions of each shared
  5634. array are the same as the @var{dim}th dimensions of the original array,
  5635. the dimensions of the outer array are the same as those of the original
  5636. array that did not match a @var{dim}.
  5637.  
  5638. An enclosed array is not a general Scheme array.  Its elements may not
  5639. be set using @code{array-set!}.  Two references to the same element of
  5640. an enclosed array will be @code{equal?} but will not in general be
  5641. @code{eq?}.  The value returned by @var{array-prototype} when given an
  5642. enclosed array is unspecified.
  5643.  
  5644. examples:
  5645. @lisp
  5646. (enclose-array '#3(((a b c) (d e f)) ((1 2 3) (4 5 6))) 1) @result{}
  5647.    #<enclosed-array (#1(a d) #1(b e) #1(c f)) (#1(1 4) #1(2 5) #1(3 6))>
  5648.  
  5649. (enclose-array '#3(((a b c) (d e f)) ((1 2 3) (4 5 6))) 1 0) @result{}
  5650.    #<enclosed-array #2((a 1) (d 4)) #2((b 2) (e 5)) #2((c 3) (f 6))>
  5651. @end lisp
  5652. @end deffn
  5653.  
  5654. array-in-bounds?
  5655. @c snarfed from unif.c:1013
  5656. @deffn {Scheme Procedure} array-in-bounds? v . args
  5657. Return @code{#t} if its arguments would be acceptable to
  5658. @code{array-ref}.
  5659. @end deffn
  5660.  
  5661. array-ref
  5662. @c snarfed from unif.c:1092
  5663. @deffn {Scheme Procedure} array-ref
  5664. implemented by the C function "scm_uniform_vector_ref"
  5665. @end deffn
  5666.  
  5667. uniform-vector-ref
  5668. @c snarfed from unif.c:1099
  5669. @deffn {Scheme Procedure} uniform-vector-ref v args
  5670. @deffnx {Scheme Procedure} array-ref v . args
  5671. Return the element at the @code{(index1, index2)} element in
  5672. @var{array}.
  5673. @end deffn
  5674.  
  5675. uniform-array-set1!
  5676. @c snarfed from unif.c:1268
  5677. @deffn {Scheme Procedure} uniform-array-set1!
  5678. implemented by the C function "scm_array_set_x"
  5679. @end deffn
  5680.  
  5681. array-set!
  5682. @c snarfed from unif.c:1277
  5683. @deffn {Scheme Procedure} array-set! v obj . args
  5684. @deffnx {Scheme Procedure} uniform-array-set1! v obj args
  5685. Set the element at the @code{(index1, index2)} element in @var{array} to
  5686. @var{new-value}.  The value returned by array-set! is unspecified.
  5687. @end deffn
  5688.  
  5689. array-contents
  5690. @c snarfed from unif.c:1394
  5691. @deffn {Scheme Procedure} array-contents ra [strict]
  5692. If @var{array} may be @dfn{unrolled} into a one dimensional shared array
  5693. without changing their order (last subscript changing fastest), then
  5694. @code{array-contents} returns that shared array, otherwise it returns
  5695. @code{#f}.  All arrays made by @var{make-array} and
  5696. @var{make-uniform-array} may be unrolled, some arrays made by
  5697. @var{make-shared-array} may not be.
  5698.  
  5699. If the optional argument @var{strict} is provided, a shared array will
  5700. be returned only if its elements are stored internally contiguous in
  5701. memory.
  5702. @end deffn
  5703.  
  5704. uniform-array-read!
  5705. @c snarfed from unif.c:1508
  5706. @deffn {Scheme Procedure} uniform-array-read! ra [port_or_fd [start [end]]]
  5707. @deffnx {Scheme Procedure} uniform-vector-read! uve [port-or-fdes] [start] [end]
  5708. Attempt to read all elements of @var{ura}, in lexicographic order, as
  5709. binary objects from @var{port-or-fdes}.
  5710. If an end of file is encountered during
  5711. uniform-array-read! the objects up to that point only are put into @var{ura}
  5712. (starting at the beginning) and the remainder of the array is
  5713. unchanged.
  5714.  
  5715. The optional arguments @var{start} and @var{end} allow
  5716. a specified region of a vector (or linearized array) to be read,
  5717. leaving the remainder of the vector unchanged.
  5718.  
  5719. @code{uniform-array-read!} returns the number of objects read.
  5720. @var{port-or-fdes} may be omitted, in which case it defaults to the value
  5721. returned by @code{(current-input-port)}.
  5722. @end deffn
  5723.  
  5724. uniform-array-write
  5725. @c snarfed from unif.c:1673
  5726. @deffn {Scheme Procedure} uniform-array-write v [port_or_fd [start [end]]]
  5727. @deffnx {Scheme Procedure} uniform-vector-write uve [port-or-fdes] [start] [end]
  5728. Writes all elements of @var{ura} as binary objects to
  5729. @var{port-or-fdes}.
  5730.  
  5731. The optional arguments @var{start}
  5732. and @var{end} allow
  5733. a specified region of a vector (or linearized array) to be written.
  5734.  
  5735. The number of objects actually written is returned.
  5736. @var{port-or-fdes} may be
  5737. omitted, in which case it defaults to the value returned by
  5738. @code{(current-output-port)}.
  5739. @end deffn
  5740.  
  5741. bit-count
  5742. @c snarfed from unif.c:1800
  5743. @deffn {Scheme Procedure} bit-count b bitvector
  5744. Return the number of occurrences of the boolean @var{b} in
  5745. @var{bitvector}.
  5746. @end deffn
  5747.  
  5748. bit-position
  5749. @c snarfed from unif.c:1839
  5750. @deffn {Scheme Procedure} bit-position item v k
  5751. Return the minimum index of an occurrence of @var{bool} in
  5752. @var{bv} which is at least @var{k}.  If no @var{bool} occurs
  5753. within the specified range @code{#f} is returned.
  5754. @end deffn
  5755.  
  5756. bit-set*!
  5757. @c snarfed from unif.c:1907
  5758. @deffn {Scheme Procedure} bit-set*! v kv obj
  5759. If uve is a bit-vector @var{bv} and uve must be of the same
  5760. length.  If @var{bool} is @code{#t}, uve is OR'ed into
  5761. @var{bv}; If @var{bool} is @code{#f}, the inversion of uve is
  5762. AND'ed into @var{bv}.
  5763.  
  5764. If uve is a unsigned integer vector all the elements of uve
  5765. must be between 0 and the @code{length} of @var{bv}.  The bits
  5766. of @var{bv} corresponding to the indexes in uve are set to
  5767. @var{bool}.  The return value is unspecified.
  5768. @end deffn
  5769.  
  5770. bit-count*
  5771. @c snarfed from unif.c:1961
  5772. @deffn {Scheme Procedure} bit-count* v kv obj
  5773. Return
  5774. @lisp
  5775. (bit-count (bit-set*! (if bool bv (bit-invert! bv)) uve #t) #t).
  5776. @end lisp
  5777. @var{bv} is not modified.
  5778. @end deffn
  5779.  
  5780. bit-invert!
  5781. @c snarfed from unif.c:2025
  5782. @deffn {Scheme Procedure} bit-invert! v
  5783. Modify @var{bv} by replacing each element with its negation.
  5784. @end deffn
  5785.  
  5786. array->list
  5787. @c snarfed from unif.c:2104
  5788. @deffn {Scheme Procedure} array->list v
  5789. Return a list consisting of all the elements, in order, of
  5790. @var{array}.
  5791. @end deffn
  5792.  
  5793. list->uniform-array
  5794. @c snarfed from unif.c:2205
  5795. @deffn {Scheme Procedure} list->uniform-array ndim prot lst
  5796. @deffnx {Scheme Procedure} list->uniform-vector prot lst
  5797. Return a uniform array of the type indicated by prototype
  5798. @var{prot} with elements the same as those of @var{lst}.
  5799. Elements must be of the appropriate type, no coercions are
  5800. done.
  5801. @end deffn
  5802.  
  5803. array-prototype
  5804. @c snarfed from unif.c:2556
  5805. @deffn {Scheme Procedure} array-prototype ra
  5806. Return an object that would produce an array of the same type
  5807. as @var{array}, if used as the @var{prototype} for
  5808. @code{make-uniform-array}.
  5809. @end deffn
  5810.  
  5811. chown
  5812. @c snarfed from filesys.c:161
  5813. @deffn {Scheme Procedure} chown object owner group
  5814. Change the ownership and group of the file referred to by @var{object} to
  5815. the integer values @var{owner} and @var{group}.  @var{object} can be
  5816. a string containing a file name or, if the platform
  5817. supports fchown, a port or integer file descriptor
  5818. which is open on the file.  The return value
  5819. is unspecified.
  5820.  
  5821. If @var{object} is a symbolic link, either the
  5822. ownership of the link or the ownership of the referenced file will be
  5823. changed depending on the operating system (lchown is
  5824. unsupported at present).  If @var{owner} or @var{group} is specified
  5825. as @code{-1}, then that ID is not changed.
  5826. @end deffn
  5827.  
  5828. chmod
  5829. @c snarfed from filesys.c:202
  5830. @deffn {Scheme Procedure} chmod object mode
  5831. Changes the permissions of the file referred to by @var{obj}.
  5832. @var{obj} can be a string containing a file name or a port or integer file
  5833. descriptor which is open on a file (in which case @code{fchmod} is used
  5834. as the underlying system call).
  5835. @var{mode} specifies
  5836. the new permissions as a decimal number, e.g., @code{(chmod "foo" #o755)}.
  5837. The return value is unspecified.
  5838. @end deffn
  5839.  
  5840. umask
  5841. @c snarfed from filesys.c:236
  5842. @deffn {Scheme Procedure} umask [mode]
  5843. If @var{mode} is omitted, returns a decimal number representing the current
  5844. file creation mask.  Otherwise the file creation mask is set to
  5845. @var{mode} and the previous value is returned.
  5846.  
  5847. E.g., @code{(umask #o022)} sets the mask to octal 22, decimal 18.
  5848. @end deffn
  5849.  
  5850. open-fdes
  5851. @c snarfed from filesys.c:259
  5852. @deffn {Scheme Procedure} open-fdes path flags [mode]
  5853. Similar to @code{open} but return a file descriptor instead of
  5854. a port.
  5855. @end deffn
  5856.  
  5857. open
  5858. @c snarfed from filesys.c:302
  5859. @deffn {Scheme Procedure} open path flags [mode]
  5860. Open the file named by @var{path} for reading and/or writing.
  5861. @var{flags} is an integer specifying how the file should be opened.
  5862. @var{mode} is an integer specifying the permission bits of the file, if
  5863. it needs to be created, before the umask is applied.  The default is 666
  5864. (Unix itself has no default).
  5865.  
  5866. @var{flags} can be constructed by combining variables using @code{logior}.
  5867. Basic flags are:
  5868.  
  5869. @defvar O_RDONLY
  5870. Open the file read-only.
  5871. @end defvar
  5872. @defvar O_WRONLY
  5873. Open the file write-only.
  5874. @end defvar
  5875. @defvar O_RDWR
  5876. Open the file read/write.
  5877. @end defvar
  5878. @defvar O_APPEND
  5879. Append to the file instead of truncating.
  5880. @end defvar
  5881. @defvar O_CREAT
  5882. Create the file if it does not already exist.
  5883. @end defvar
  5884.  
  5885. See the Unix documentation of the @code{open} system call
  5886. for additional flags.
  5887. @end deffn
  5888.  
  5889. close
  5890. @c snarfed from filesys.c:340
  5891. @deffn {Scheme Procedure} close fd_or_port
  5892. Similar to close-port (@pxref{Closing, close-port}),
  5893. but also works on file descriptors.  A side
  5894. effect of closing a file descriptor is that any ports using that file
  5895. descriptor are moved to a different file descriptor and have
  5896. their revealed counts set to zero.
  5897. @end deffn
  5898.  
  5899. close-fdes
  5900. @c snarfed from filesys.c:368
  5901. @deffn {Scheme Procedure} close-fdes fd
  5902. A simple wrapper for the @code{close} system call.
  5903. Close file descriptor @var{fd}, which must be an integer.
  5904. Unlike close (@pxref{Ports and File Descriptors, close}),
  5905. the file descriptor will be closed even if a port is using it.
  5906. The return value is unspecified.
  5907. @end deffn
  5908.  
  5909. stat
  5910. @c snarfed from filesys.c:546
  5911. @deffn {Scheme Procedure} stat object
  5912. Return an object containing various information about the file
  5913. determined by @var{obj}.  @var{obj} can be a string containing
  5914. a file name or a port or integer file descriptor which is open
  5915. on a file (in which case @code{fstat} is used as the underlying
  5916. system call).
  5917.  
  5918. The object returned by @code{stat} can be passed as a single
  5919. parameter to the following procedures, all of which return
  5920. integers:
  5921.  
  5922. @table @code
  5923. @item stat:dev
  5924. The device containing the file.
  5925. @item stat:ino
  5926. The file serial number, which distinguishes this file from all
  5927. other files on the same device.
  5928. @item stat:mode
  5929. The mode of the file.  This includes file type information and
  5930. the file permission bits.  See @code{stat:type} and
  5931. @code{stat:perms} below.
  5932. @item stat:nlink
  5933. The number of hard links to the file.
  5934. @item stat:uid
  5935. The user ID of the file's owner.
  5936. @item stat:gid
  5937. The group ID of the file.
  5938. @item stat:rdev
  5939. Device ID; this entry is defined only for character or block
  5940. special files.
  5941. @item stat:size
  5942. The size of a regular file in bytes.
  5943. @item stat:atime
  5944. The last access time for the file.
  5945. @item stat:mtime
  5946. The last modification time for the file.
  5947. @item stat:ctime
  5948. The last modification time for the attributes of the file.
  5949. @item stat:blksize
  5950. The optimal block size for reading or writing the file, in
  5951. bytes.
  5952. @item stat:blocks
  5953. The amount of disk space that the file occupies measured in
  5954. units of 512 byte blocks.
  5955. @end table
  5956.  
  5957. In addition, the following procedures return the information
  5958. from stat:mode in a more convenient form:
  5959.  
  5960. @table @code
  5961. @item stat:type
  5962. A symbol representing the type of file.  Possible values are
  5963. regular, directory, symlink, block-special, char-special, fifo,
  5964. socket and unknown
  5965. @item stat:perms
  5966. An integer representing the access permission bits.
  5967. @end table
  5968. @end deffn
  5969.  
  5970. link
  5971. @c snarfed from filesys.c:593
  5972. @deffn {Scheme Procedure} link oldpath newpath
  5973. Creates a new name @var{newpath} in the file system for the
  5974. file named by @var{oldpath}.  If @var{oldpath} is a symbolic
  5975. link, the link may or may not be followed depending on the
  5976. system.
  5977. @end deffn
  5978.  
  5979. rename-file
  5980. @c snarfed from filesys.c:616
  5981. @deffn {Scheme Procedure} rename-file oldname newname
  5982. Renames the file specified by @var{oldname} to @var{newname}.
  5983. The return value is unspecified.
  5984. @end deffn
  5985.  
  5986. delete-file
  5987. @c snarfed from filesys.c:645
  5988. @deffn {Scheme Procedure} delete-file str
  5989. Deletes (or "unlinks") the file specified by @var{path}.
  5990. @end deffn
  5991.  
  5992. mkdir
  5993. @c snarfed from filesys.c:664
  5994. @deffn {Scheme Procedure} mkdir path [mode]
  5995. Create a new directory named by @var{path}.  If @var{mode} is omitted
  5996. then the permissions of the directory file are set using the current
  5997. umask.  Otherwise they are set to the decimal value specified with
  5998. @var{mode}.  The return value is unspecified.
  5999. @end deffn
  6000.  
  6001. rmdir
  6002. @c snarfed from filesys.c:693
  6003. @deffn {Scheme Procedure} rmdir path
  6004. Remove the existing directory named by @var{path}.  The directory must
  6005. be empty for this to succeed.  The return value is unspecified.
  6006. @end deffn
  6007.  
  6008. directory-stream?
  6009. @c snarfed from filesys.c:719
  6010. @deffn {Scheme Procedure} directory-stream? obj
  6011. Return a boolean indicating whether @var{object} is a directory
  6012. stream as returned by @code{opendir}.
  6013. @end deffn
  6014.  
  6015. opendir
  6016. @c snarfed from filesys.c:730
  6017. @deffn {Scheme Procedure} opendir dirname
  6018. Open the directory specified by @var{path} and return a directory
  6019. stream.
  6020. @end deffn
  6021.  
  6022. readdir
  6023. @c snarfed from filesys.c:748
  6024. @deffn {Scheme Procedure} readdir port
  6025. Return (as a string) the next directory entry from the directory stream
  6026. @var{stream}.  If there is no remaining entry to be read then the
  6027. end of file object is returned.
  6028. @end deffn
  6029.  
  6030. rewinddir
  6031. @c snarfed from filesys.c:771
  6032. @deffn {Scheme Procedure} rewinddir port
  6033. Reset the directory port @var{stream} so that the next call to
  6034. @code{readdir} will return the first directory entry.
  6035. @end deffn
  6036.  
  6037. closedir
  6038. @c snarfed from filesys.c:788
  6039. @deffn {Scheme Procedure} closedir port
  6040. Close the directory stream @var{stream}.
  6041. The return value is unspecified.
  6042. @end deffn
  6043.  
  6044. chdir
  6045. @c snarfed from filesys.c:838
  6046. @deffn {Scheme Procedure} chdir str
  6047. Change the current working directory to @var{path}.
  6048. The return value is unspecified.
  6049. @end deffn
  6050.  
  6051. getcwd
  6052. @c snarfed from filesys.c:855
  6053. @deffn {Scheme Procedure} getcwd
  6054. Return the name of the current working directory.
  6055. @end deffn
  6056.  
  6057. select
  6058. @c snarfed from filesys.c:1056
  6059. @deffn {Scheme Procedure} select reads writes excepts [secs [usecs]]
  6060. This procedure has a variety of uses: waiting for the ability
  6061. to provide input, accept output, or the existence of
  6062. exceptional conditions on a collection of ports or file
  6063. descriptors, or waiting for a timeout to occur.
  6064. It also returns if interrupted by a signal.
  6065.  
  6066. @var{reads}, @var{writes} and @var{excepts} can be lists or
  6067. vectors, with each member a port or a file descriptor.
  6068. The value returned is a list of three corresponding
  6069. lists or vectors containing only the members which meet the
  6070. specified requirement.  The ability of port buffers to
  6071. provide input or accept output is taken into account.
  6072. Ordering of the input lists or vectors is not preserved.
  6073.  
  6074. The optional arguments @var{secs} and @var{usecs} specify the
  6075. timeout.  Either @var{secs} can be specified alone, as
  6076. either an integer or a real number, or both @var{secs} and
  6077. @var{usecs} can be specified as integers, in which case
  6078. @var{usecs} is an additional timeout expressed in
  6079. microseconds.  If @var{secs} is omitted or is @code{#f} then
  6080. select will wait for as long as it takes for one of the other
  6081. conditions to be satisfied.
  6082.  
  6083. The scsh version of @code{select} differs as follows:
  6084. Only vectors are accepted for the first three arguments.
  6085. The @var{usecs} argument is not supported.
  6086. Multiple values are returned instead of a list.
  6087. Duplicates in the input vectors appear only once in output.
  6088. An additional @code{select!} interface is provided.
  6089. @end deffn
  6090.  
  6091. fcntl
  6092. @c snarfed from filesys.c:1202
  6093. @deffn {Scheme Procedure} fcntl object cmd [value]
  6094. Apply @var{command} to the specified file descriptor or the underlying
  6095. file descriptor of the specified port.  @var{value} is an optional
  6096. integer argument.
  6097.  
  6098. Values for @var{command} are:
  6099.  
  6100. @table @code
  6101. @item F_DUPFD
  6102. Duplicate a file descriptor
  6103. @item F_GETFD
  6104. Get flags associated with the file descriptor.
  6105. @item F_SETFD
  6106. Set flags associated with the file descriptor to @var{value}.
  6107. @item F_GETFL
  6108. Get flags associated with the open file.
  6109. @item F_SETFL
  6110. Set flags associated with the open file to @var{value}
  6111. @item F_GETOWN
  6112. Get the process ID of a socket's owner, for @code{SIGIO} signals.
  6113. @item F_SETOWN
  6114. Set the process that owns a socket to @var{value}, for @code{SIGIO} signals.
  6115. @item FD_CLOEXEC
  6116. The value used to indicate the "close on exec" flag with @code{F_GETFL} or
  6117. @code{F_SETFL}.
  6118. @end table
  6119. @end deffn
  6120.  
  6121. fsync
  6122. @c snarfed from filesys.c:1239
  6123. @deffn {Scheme Procedure} fsync object
  6124. Copies any unwritten data for the specified output file descriptor to disk.
  6125. If @var{port/fd} is a port, its buffer is flushed before the underlying
  6126. file descriptor is fsync'd.
  6127. The return value is unspecified.
  6128. @end deffn
  6129.  
  6130. symlink
  6131. @c snarfed from filesys.c:1266
  6132. @deffn {Scheme Procedure} symlink oldpath newpath
  6133. Create a symbolic link named @var{path-to} with the value (i.e., pointing to)
  6134. @var{path-from}.  The return value is unspecified.
  6135. @end deffn
  6136.  
  6137. readlink
  6138. @c snarfed from filesys.c:1287
  6139. @deffn {Scheme Procedure} readlink path
  6140. Return the value of the symbolic link named by @var{path} (a
  6141. string), i.e., the file that the link points to.
  6142. @end deffn
  6143.  
  6144. lstat
  6145. @c snarfed from filesys.c:1322
  6146. @deffn {Scheme Procedure} lstat str
  6147. Similar to @code{stat}, but does not follow symbolic links, i.e.,
  6148. it will return information about a symbolic link itself, not the
  6149. file it points to.  @var{path} must be a string.
  6150. @end deffn
  6151.  
  6152. copy-file
  6153. @c snarfed from filesys.c:1347
  6154. @deffn {Scheme Procedure} copy-file oldfile newfile
  6155. Copy the file specified by @var{path-from} to @var{path-to}.
  6156. The return value is unspecified.
  6157. @end deffn
  6158.  
  6159. dirname
  6160. @c snarfed from filesys.c:1401
  6161. @deffn {Scheme Procedure} dirname filename
  6162. Return the directory name component of the file name
  6163. @var{filename}. If @var{filename} does not contain a directory
  6164. component, @code{.} is returned.
  6165. @end deffn
  6166.  
  6167. basename
  6168. @c snarfed from filesys.c:1444
  6169. @deffn {Scheme Procedure} basename filename [suffix]
  6170. Return the base name of the file name @var{filename}. The
  6171. base name is the file name without any directory components.
  6172. If @var{suffix} is provided, and is equal to the end of
  6173. @var{basename}, it is removed also.
  6174. @end deffn
  6175.  
  6176. pipe
  6177. @c snarfed from posix.c:228
  6178. @deffn {Scheme Procedure} pipe
  6179. Return a newly created pipe: a pair of ports which are linked
  6180. together on the local machine.  The @emph{car} is the input
  6181. port and the @emph{cdr} is the output port.  Data written (and
  6182. flushed) to the output port can be read from the input port.
  6183. Pipes are commonly used for communication with a newly forked
  6184. child process.  The need to flush the output port can be
  6185. avoided by making it unbuffered using @code{setvbuf}.
  6186.  
  6187. Writes occur atomically provided the size of the data in bytes
  6188. is not greater than the value of @code{PIPE_BUF}.  Note that
  6189. the output port is likely to block if too much data (typically
  6190. equal to @code{PIPE_BUF}) has been written but not yet read
  6191. from the input port.
  6192. @end deffn
  6193.  
  6194. getgroups
  6195. @c snarfed from posix.c:249
  6196. @deffn {Scheme Procedure} getgroups
  6197. Return a vector of integers representing the current
  6198. supplementary group IDs.
  6199. @end deffn
  6200.  
  6201. getpw
  6202. @c snarfed from posix.c:282
  6203. @deffn {Scheme Procedure} getpw [user]
  6204. Look up an entry in the user database.  @var{obj} can be an integer,
  6205. a string, or omitted, giving the behaviour of getpwuid, getpwnam
  6206. or getpwent respectively.
  6207. @end deffn
  6208.  
  6209. setpw
  6210. @c snarfed from posix.c:336
  6211. @deffn {Scheme Procedure} setpw [arg]
  6212. If called with a true argument, initialize or reset the password data
  6213. stream.  Otherwise, close the stream.  The @code{setpwent} and
  6214. @code{endpwent} procedures are implemented on top of this.
  6215. @end deffn
  6216.  
  6217. getgr
  6218. @c snarfed from posix.c:355
  6219. @deffn {Scheme Procedure} getgr [name]
  6220. Look up an entry in the group database.  @var{obj} can be an integer,
  6221. a string, or omitted, giving the behaviour of getgrgid, getgrnam
  6222. or getgrent respectively.
  6223. @end deffn
  6224.  
  6225. setgr
  6226. @c snarfed from posix.c:396
  6227. @deffn {Scheme Procedure} setgr [arg]
  6228. If called with a true argument, initialize or reset the group data
  6229. stream.  Otherwise, close the stream.  The @code{setgrent} and
  6230. @code{endgrent} procedures are implemented on top of this.
  6231. @end deffn
  6232.  
  6233. kill
  6234. @c snarfed from posix.c:432
  6235. @deffn {Scheme Procedure} kill pid sig
  6236. Sends a signal to the specified process or group of processes.
  6237.  
  6238. @var{pid} specifies the processes to which the signal is sent:
  6239.  
  6240. @table @r
  6241. @item @var{pid} greater than 0
  6242. The process whose identifier is @var{pid}.
  6243. @item @var{pid} equal to 0
  6244. All processes in the current process group.
  6245. @item @var{pid} less than -1
  6246. The process group whose identifier is -@var{pid}
  6247. @item @var{pid} equal to -1
  6248. If the process is privileged, all processes except for some special
  6249. system processes.  Otherwise, all processes with the current effective
  6250. user ID.
  6251. @end table
  6252.  
  6253. @var{sig} should be specified using a variable corresponding to
  6254. the Unix symbolic name, e.g.,
  6255.  
  6256. @defvar SIGHUP
  6257. Hang-up signal.
  6258. @end defvar
  6259.  
  6260. @defvar SIGINT
  6261. Interrupt signal.
  6262. @end defvar
  6263. @end deffn
  6264.  
  6265. waitpid
  6266. @c snarfed from posix.c:485
  6267. @deffn {Scheme Procedure} waitpid pid [options]
  6268. This procedure collects status information from a child process which
  6269. has terminated or (optionally) stopped.  Normally it will
  6270. suspend the calling process until this can be done.  If more than one
  6271. child process is eligible then one will be chosen by the operating system.
  6272.  
  6273. The value of @var{pid} determines the behaviour:
  6274.  
  6275. @table @r
  6276. @item @var{pid} greater than 0
  6277. Request status information from the specified child process.
  6278. @item @var{pid} equal to -1 or WAIT_ANY
  6279. Request status information for any child process.
  6280. @item @var{pid} equal to 0 or WAIT_MYPGRP
  6281. Request status information for any child process in the current process
  6282. group.
  6283. @item @var{pid} less than -1
  6284. Request status information for any child process whose process group ID
  6285. is -@var{PID}.
  6286. @end table
  6287.  
  6288. The @var{options} argument, if supplied, should be the bitwise OR of the
  6289. values of zero or more of the following variables:
  6290.  
  6291. @defvar WNOHANG
  6292. Return immediately even if there are no child processes to be collected.
  6293. @end defvar
  6294.  
  6295. @defvar WUNTRACED
  6296. Report status information for stopped processes as well as terminated
  6297. processes.
  6298. @end defvar
  6299.  
  6300. The return value is a pair containing:
  6301.  
  6302. @enumerate
  6303. @item
  6304. The process ID of the child process, or 0 if @code{WNOHANG} was
  6305. specified and no process was collected.
  6306. @item
  6307. The integer status value.
  6308. @end enumerate
  6309. @end deffn
  6310.  
  6311. status:exit-val
  6312. @c snarfed from posix.c:513
  6313. @deffn {Scheme Procedure} status:exit-val status
  6314. Return the exit status value, as would be set if a process
  6315. ended normally through a call to @code{exit} or @code{_exit},
  6316. if any, otherwise @code{#f}.
  6317. @end deffn
  6318.  
  6319. status:term-sig
  6320. @c snarfed from posix.c:533
  6321. @deffn {Scheme Procedure} status:term-sig status
  6322. Return the signal number which terminated the process, if any,
  6323. otherwise @code{#f}.
  6324. @end deffn
  6325.  
  6326. status:stop-sig
  6327. @c snarfed from posix.c:551
  6328. @deffn {Scheme Procedure} status:stop-sig status
  6329. Return the signal number which stopped the process, if any,
  6330. otherwise @code{#f}.
  6331. @end deffn
  6332.  
  6333. getppid
  6334. @c snarfed from posix.c:571
  6335. @deffn {Scheme Procedure} getppid
  6336. Return an integer representing the process ID of the parent
  6337. process.
  6338. @end deffn
  6339.  
  6340. getuid
  6341. @c snarfed from posix.c:583
  6342. @deffn {Scheme Procedure} getuid
  6343. Return an integer representing the current real user ID.
  6344. @end deffn
  6345.  
  6346. getgid
  6347. @c snarfed from posix.c:594
  6348. @deffn {Scheme Procedure} getgid
  6349. Return an integer representing the current real group ID.
  6350. @end deffn
  6351.  
  6352. geteuid
  6353. @c snarfed from posix.c:608
  6354. @deffn {Scheme Procedure} geteuid
  6355. Return an integer representing the current effective user ID.
  6356. If the system does not support effective IDs, then the real ID
  6357. is returned.  @code{(feature? 'EIDs)} reports whether the
  6358. system supports effective IDs.
  6359. @end deffn
  6360.  
  6361. getegid
  6362. @c snarfed from posix.c:625
  6363. @deffn {Scheme Procedure} getegid
  6364. Return an integer representing the current effective group ID.
  6365. If the system does not support effective IDs, then the real ID
  6366. is returned.  @code{(feature? 'EIDs)} reports whether the
  6367. system supports effective IDs.
  6368. @end deffn
  6369.  
  6370. setuid
  6371. @c snarfed from posix.c:641
  6372. @deffn {Scheme Procedure} setuid id
  6373. Sets both the real and effective user IDs to the integer @var{id}, provided
  6374. the process has appropriate privileges.
  6375. The return value is unspecified.
  6376. @end deffn
  6377.  
  6378. setgid
  6379. @c snarfed from posix.c:655
  6380. @deffn {Scheme Procedure} setgid id
  6381. Sets both the real and effective group IDs to the integer @var{id}, provided
  6382. the process has appropriate privileges.
  6383. The return value is unspecified.
  6384. @end deffn
  6385.  
  6386. seteuid
  6387. @c snarfed from posix.c:671
  6388. @deffn {Scheme Procedure} seteuid id
  6389. Sets the effective user ID to the integer @var{id}, provided the process
  6390. has appropriate privileges.  If effective IDs are not supported, the
  6391. real ID is set instead -- @code{(feature? 'EIDs)} reports whether the
  6392. system supports effective IDs.
  6393. The return value is unspecified.
  6394. @end deffn
  6395.  
  6396. setegid
  6397. @c snarfed from posix.c:697
  6398. @deffn {Scheme Procedure} setegid id
  6399. Sets the effective group ID to the integer @var{id}, provided the process
  6400. has appropriate privileges.  If effective IDs are not supported, the
  6401. real ID is set instead -- @code{(feature? 'EIDs)} reports whether the
  6402. system supports effective IDs.
  6403. The return value is unspecified.
  6404. @end deffn
  6405.  
  6406. getpgrp
  6407. @c snarfed from posix.c:721
  6408. @deffn {Scheme Procedure} getpgrp
  6409. Return an integer representing the current process group ID.
  6410. This is the POSIX definition, not BSD.
  6411. @end deffn
  6412.  
  6413. setpgid
  6414. @c snarfed from posix.c:739
  6415. @deffn {Scheme Procedure} setpgid pid pgid
  6416. Move the process @var{pid} into the process group @var{pgid}.  @var{pid} or
  6417. @var{pgid} must be integers: they can be zero to indicate the ID of the
  6418. current process.
  6419. Fails on systems that do not support job control.
  6420. The return value is unspecified.
  6421. @end deffn
  6422.  
  6423. setsid
  6424. @c snarfed from posix.c:758
  6425. @deffn {Scheme Procedure} setsid
  6426. Creates a new session.  The current process becomes the session leader
  6427. and is put in a new process group.  The process will be detached
  6428. from its controlling terminal if it has one.
  6429. The return value is an integer representing the new process group ID.
  6430. @end deffn
  6431.  
  6432. ttyname
  6433. @c snarfed from posix.c:773
  6434. @deffn {Scheme Procedure} ttyname port
  6435. Return a string with the name of the serial terminal device
  6436. underlying @var{port}.
  6437. @end deffn
  6438.  
  6439. ctermid
  6440. @c snarfed from posix.c:797
  6441. @deffn {Scheme Procedure} ctermid
  6442. Return a string containing the file name of the controlling
  6443. terminal for the current process.
  6444. @end deffn
  6445.  
  6446. tcgetpgrp
  6447. @c snarfed from posix.c:821
  6448. @deffn {Scheme Procedure} tcgetpgrp port
  6449. Return the process group ID of the foreground process group
  6450. associated with the terminal open on the file descriptor
  6451. underlying @var{port}.
  6452.  
  6453. If there is no foreground process group, the return value is a
  6454. number greater than 1 that does not match the process group ID
  6455. of any existing process group.  This can happen if all of the
  6456. processes in the job that was formerly the foreground job have
  6457. terminated, and no other job has yet been moved into the
  6458. foreground.
  6459. @end deffn
  6460.  
  6461. tcsetpgrp
  6462. @c snarfed from posix.c:845
  6463. @deffn {Scheme Procedure} tcsetpgrp port pgid
  6464. Set the foreground process group ID for the terminal used by the file
  6465. descriptor underlying @var{port} to the integer @var{pgid}.
  6466. The calling process
  6467. must be a member of the same session as @var{pgid} and must have the same
  6468. controlling terminal.  The return value is unspecified.
  6469. @end deffn
  6470.  
  6471. execl
  6472. @c snarfed from posix.c:905
  6473. @deffn {Scheme Procedure} execl filename . args
  6474. Executes the file named by @var{path} as a new process image.
  6475. The remaining arguments are supplied to the process; from a C program
  6476. they are accessible as the @code{argv} argument to @code{main}.
  6477. Conventionally the first @var{arg} is the same as @var{path}.
  6478. All arguments must be strings.
  6479.  
  6480. If @var{arg} is missing, @var{path} is executed with a null
  6481. argument list, which may have system-dependent side-effects.
  6482.  
  6483. This procedure is currently implemented using the @code{execv} system
  6484. call, but we call it @code{execl} because of its Scheme calling interface.
  6485. @end deffn
  6486.  
  6487. execlp
  6488. @c snarfed from posix.c:932
  6489. @deffn {Scheme Procedure} execlp filename . args
  6490. Similar to @code{execl}, however if
  6491. @var{filename} does not contain a slash
  6492. then the file to execute will be located by searching the
  6493. directories listed in the @code{PATH} environment variable.
  6494.  
  6495. This procedure is currently implemented using the @code{execvp} system
  6496. call, but we call it @code{execlp} because of its Scheme calling interface.
  6497. @end deffn
  6498.  
  6499. execle
  6500. @c snarfed from posix.c:989
  6501. @deffn {Scheme Procedure} execle filename env . args
  6502. Similar to @code{execl}, but the environment of the new process is
  6503. specified by @var{env}, which must be a list of strings as returned by the
  6504. @code{environ} procedure.
  6505.  
  6506. This procedure is currently implemented using the @code{execve} system
  6507. call, but we call it @code{execle} because of its Scheme calling interface.
  6508. @end deffn
  6509.  
  6510. primitive-fork
  6511. @c snarfed from posix.c:1023
  6512. @deffn {Scheme Procedure} primitive-fork
  6513. Creates a new "child" process by duplicating the current "parent" process.
  6514. In the child the return value is 0.  In the parent the return value is
  6515. the integer process ID of the child.
  6516.  
  6517. This procedure has been renamed from @code{fork} to avoid a naming conflict
  6518. with the scsh fork.
  6519. @end deffn
  6520.  
  6521. uname
  6522. @c snarfed from posix.c:1039
  6523. @deffn {Scheme Procedure} uname
  6524. Return an object with some information about the computer
  6525. system the program is running on.
  6526. @end deffn
  6527.  
  6528. environ
  6529. @c snarfed from posix.c:1069
  6530. @deffn {Scheme Procedure} environ [env]
  6531. If @var{env} is omitted, return the current environment (in the
  6532. Unix sense) as a list of strings.  Otherwise set the current
  6533. environment, which is also the default environment for child
  6534. processes, to the supplied list of strings.  Each member of
  6535. @var{env} should be of the form @code{NAME=VALUE} and values of
  6536. @code{NAME} should not be duplicated.  If @var{env} is supplied
  6537. then the return value is unspecified.
  6538. @end deffn
  6539.  
  6540. tmpnam
  6541. @c snarfed from posix.c:1107
  6542. @deffn {Scheme Procedure} tmpnam
  6543. Return a name in the file system that does not match any
  6544. existing file.  However there is no guarantee that another
  6545. process will not create the file after @code{tmpnam} is called.
  6546. Care should be taken if opening the file, e.g., use the
  6547. @code{O_EXCL} open flag or use @code{mkstemp!} instead.
  6548. @end deffn
  6549.  
  6550. mkstemp!
  6551. @c snarfed from posix.c:1129
  6552. @deffn {Scheme Procedure} mkstemp! tmpl
  6553. Create a new unique file in the file system and returns a new
  6554. buffered port open for reading and writing to the file.
  6555. @var{tmpl} is a string specifying where the file should be
  6556. created: it must end with @code{XXXXXX} and will be changed in
  6557. place to return the name of the temporary file.
  6558. @end deffn
  6559.  
  6560. utime
  6561. @c snarfed from posix.c:1155
  6562. @deffn {Scheme Procedure} utime pathname [actime [modtime]]
  6563. @code{utime} sets the access and modification times for the
  6564. file named by @var{path}.  If @var{actime} or @var{modtime} is
  6565. not supplied, then the current time is used.  @var{actime} and
  6566. @var{modtime} must be integer time values as returned by the
  6567. @code{current-time} procedure.
  6568. @lisp
  6569. (utime "foo" (- (current-time) 3600))
  6570. @end lisp
  6571. will set the access time to one hour in the past and the
  6572. modification time to the current time.
  6573. @end deffn
  6574.  
  6575. access?
  6576. @c snarfed from posix.c:1204
  6577. @deffn {Scheme Procedure} access? path how
  6578. Return @code{#t} if @var{path} corresponds to an existing file
  6579. and the current process has the type of access specified by
  6580. @var{how}, otherwise @code{#f}.  @var{how} should be specified
  6581. using the values of the variables listed below.  Multiple
  6582. values can be combined using a bitwise or, in which case
  6583. @code{#t} will only be returned if all accesses are granted.
  6584.  
  6585. Permissions are checked using the real id of the current
  6586. process, not the effective id, although it's the effective id
  6587. which determines whether the access would actually be granted.
  6588.  
  6589. @defvar R_OK
  6590. test for read permission.
  6591. @end defvar
  6592. @defvar W_OK
  6593. test for write permission.
  6594. @end defvar
  6595. @defvar X_OK
  6596. test for execute permission.
  6597. @end defvar
  6598. @defvar F_OK
  6599. test for existence of the file.
  6600. @end defvar
  6601. @end deffn
  6602.  
  6603. getpid
  6604. @c snarfed from posix.c:1219
  6605. @deffn {Scheme Procedure} getpid
  6606. Return an integer representing the current process ID.
  6607. @end deffn
  6608.  
  6609. putenv
  6610. @c snarfed from posix.c:1236
  6611. @deffn {Scheme Procedure} putenv str
  6612. Modifies the environment of the current process, which is
  6613. also the default environment inherited by child processes.
  6614.  
  6615. If @var{string} is of the form @code{NAME=VALUE} then it will be written
  6616. directly into the environment, replacing any existing environment string
  6617. with
  6618. name matching @code{NAME}.  If @var{string} does not contain an equal
  6619. sign, then any existing string with name matching @var{string} will
  6620. be removed.
  6621.  
  6622. The return value is unspecified.
  6623. @end deffn
  6624.  
  6625. setlocale
  6626. @c snarfed from posix.c:1279
  6627. @deffn {Scheme Procedure} setlocale category [locale]
  6628. If @var{locale} is omitted, return the current value of the
  6629. specified locale category as a system-dependent string.
  6630. @var{category} should be specified using the values
  6631. @code{LC_COLLATE}, @code{LC_ALL} etc.
  6632.  
  6633. Otherwise the specified locale category is set to the string
  6634. @var{locale} and the new value is returned as a
  6635. system-dependent string.  If @var{locale} is an empty string,
  6636. the locale will be set using environment variables.
  6637. @end deffn
  6638.  
  6639. mknod
  6640. @c snarfed from posix.c:1326
  6641. @deffn {Scheme Procedure} mknod path type perms dev
  6642. Creates a new special file, such as a file corresponding to a device.
  6643. @var{path} specifies the name of the file.  @var{type} should
  6644. be one of the following symbols:
  6645. regular, directory, symlink, block-special, char-special,
  6646. fifo, or socket.  @var{perms} (an integer) specifies the file permissions.
  6647. @var{dev} (an integer) specifies which device the special file refers
  6648. to.  Its exact interpretation depends on the kind of special file
  6649. being created.
  6650.  
  6651. E.g.,
  6652. @lisp
  6653. (mknod "/dev/fd0" 'block-special #o660 (+ (* 2 256) 2))
  6654. @end lisp
  6655.  
  6656. The return value is unspecified.
  6657. @end deffn
  6658.  
  6659. nice
  6660. @c snarfed from posix.c:1373
  6661. @deffn {Scheme Procedure} nice incr
  6662. Increment the priority of the current process by @var{incr}.  A higher
  6663. priority value means that the process runs less often.
  6664. The return value is unspecified.
  6665. @end deffn
  6666.  
  6667. sync
  6668. @c snarfed from posix.c:1392
  6669. @deffn {Scheme Procedure} sync
  6670. Flush the operating system disk buffers.
  6671. The return value is unspecified.
  6672. @end deffn
  6673.  
  6674. crypt
  6675. @c snarfed from posix.c:1405
  6676. @deffn {Scheme Procedure} crypt key salt
  6677. Encrypt @var{key} using @var{salt} as the salt value to the
  6678. crypt(3) library call.
  6679. @end deffn
  6680.  
  6681. chroot
  6682. @c snarfed from posix.c:1428
  6683. @deffn {Scheme Procedure} chroot path
  6684. Change the root directory to that specified in @var{path}.
  6685. This directory will be used for path names beginning with
  6686. @file{/}.  The root directory is inherited by all children
  6687. of the current process.  Only the superuser may change the
  6688. root directory.
  6689. @end deffn
  6690.  
  6691. getlogin
  6692. @c snarfed from posix.c:1461
  6693. @deffn {Scheme Procedure} getlogin
  6694. Return a string containing the name of the user logged in on
  6695. the controlling terminal of the process, or @code{#f} if this
  6696. information cannot be obtained.
  6697. @end deffn
  6698.  
  6699. cuserid
  6700. @c snarfed from posix.c:1479
  6701. @deffn {Scheme Procedure} cuserid
  6702. Return a string containing a user name associated with the
  6703. effective user id of the process.  Return @code{#f} if this
  6704. information cannot be obtained.
  6705. @end deffn
  6706.  
  6707. getpriority
  6708. @c snarfed from posix.c:1504
  6709. @deffn {Scheme Procedure} getpriority which who
  6710. Return the scheduling priority of the process, process group
  6711. or user, as indicated by @var{which} and @var{who}. @var{which}
  6712. is one of the variables @code{PRIO_PROCESS}, @code{PRIO_PGRP}
  6713. or @code{PRIO_USER}, and @var{who} is interpreted relative to
  6714. @var{which} (a process identifier for @code{PRIO_PROCESS},
  6715. process group identifier for @code{PRIO_PGRP}, and a user
  6716. identifier for @code{PRIO_USER}.  A zero value of @var{who}
  6717. denotes the current process, process group, or user.  Return
  6718. the highest priority (lowest numerical value) of any of the
  6719. specified processes.
  6720. @end deffn
  6721.  
  6722. setpriority
  6723. @c snarfed from posix.c:1538
  6724. @deffn {Scheme Procedure} setpriority which who prio
  6725. Set the scheduling priority of the process, process group
  6726. or user, as indicated by @var{which} and @var{who}. @var{which}
  6727. is one of the variables @code{PRIO_PROCESS}, @code{PRIO_PGRP}
  6728. or @code{PRIO_USER}, and @var{who} is interpreted relative to
  6729. @var{which} (a process identifier for @code{PRIO_PROCESS},
  6730. process group identifier for @code{PRIO_PGRP}, and a user
  6731. identifier for @code{PRIO_USER}.  A zero value of @var{who}
  6732. denotes the current process, process group, or user.
  6733. @var{prio} is a value in the range -20 and 20, the default
  6734. priority is 0; lower priorities cause more favorable
  6735. scheduling.  Sets the priority of all of the specified
  6736. processes.  Only the super-user may lower priorities.
  6737. The return value is not specified.
  6738. @end deffn
  6739.  
  6740. getpass
  6741. @c snarfed from posix.c:1563
  6742. @deffn {Scheme Procedure} getpass prompt
  6743. Display @var{prompt} to the standard error output and read
  6744. a password from @file{/dev/tty}.  If this file is not
  6745. accessible, it reads from standard input.  The password may be
  6746. up to 127 characters in length.  Additional characters and the
  6747. terminating newline character are discarded.  While reading
  6748. the password, echoing and the generation of signals by special
  6749. characters is disabled.
  6750. @end deffn
  6751.  
  6752. flock
  6753. @c snarfed from posix.c:1602
  6754. @deffn {Scheme Procedure} flock file operation
  6755. Apply or remove an advisory lock on an open file.
  6756. @var{operation} specifies the action to be done:
  6757. @table @code
  6758. @item LOCK_SH
  6759. Shared lock.  More than one process may hold a shared lock
  6760. for a given file at a given time.
  6761. @item LOCK_EX
  6762. Exclusive lock.  Only one process may hold an exclusive lock
  6763. for a given file at a given time.
  6764. @item LOCK_UN
  6765. Unlock the file.
  6766. @item LOCK_NB
  6767. Don't block when locking.  May be specified by bitwise OR'ing
  6768. it to one of the other operations.
  6769. @end table
  6770. The return value is not specified. @var{file} may be an open
  6771. file descriptor or an open file descriptor port.
  6772. @end deffn
  6773.  
  6774. sethostname
  6775. @c snarfed from posix.c:1628
  6776. @deffn {Scheme Procedure} sethostname name
  6777. Set the host name of the current processor to @var{name}. May
  6778. only be used by the superuser.  The return value is not
  6779. specified.
  6780. @end deffn
  6781.  
  6782. gethostname
  6783. @c snarfed from posix.c:1644
  6784. @deffn {Scheme Procedure} gethostname
  6785. Return the host name of the current processor.
  6786. @end deffn
  6787.  
  6788. gethost
  6789. @c snarfed from net_db.c:149
  6790. @deffn {Scheme Procedure} gethost [host]
  6791. @deffnx {Scheme Procedure} gethostbyname hostname
  6792. @deffnx {Scheme Procedure} gethostbyaddr address
  6793. Look up a host by name or address, returning a host object.  The
  6794. @code{gethost} procedure will accept either a string name or an integer
  6795. address; if given no arguments, it behaves like @code{gethostent} (see
  6796. below).  If a name or address is supplied but the address can not be
  6797. found, an error will be thrown to one of the keys:
  6798. @code{host-not-found}, @code{try-again}, @code{no-recovery} or
  6799. @code{no-data}, corresponding to the equivalent @code{h_error} values.
  6800. Unusual conditions may result in errors thrown to the
  6801. @code{system-error} or @code{misc_error} keys.
  6802. @end deffn
  6803.  
  6804. getnet
  6805. @c snarfed from net_db.c:229
  6806. @deffn {Scheme Procedure} getnet [net]
  6807. @deffnx {Scheme Procedure} getnetbyname net-name
  6808. @deffnx {Scheme Procedure} getnetbyaddr net-number
  6809. Look up a network by name or net number in the network database.  The
  6810. @var{net-name} argument must be a string, and the @var{net-number}
  6811. argument must be an integer.  @code{getnet} will accept either type of
  6812. argument, behaving like @code{getnetent} (see below) if no arguments are
  6813. given.
  6814. @end deffn
  6815.  
  6816. getproto
  6817. @c snarfed from net_db.c:279
  6818. @deffn {Scheme Procedure} getproto [protocol]
  6819. @deffnx {Scheme Procedure} getprotobyname name
  6820. @deffnx {Scheme Procedure} getprotobynumber number
  6821. Look up a network protocol by name or by number.  @code{getprotobyname}
  6822. takes a string argument, and @code{getprotobynumber} takes an integer
  6823. argument.  @code{getproto} will accept either type, behaving like
  6824. @code{getprotoent} (see below) if no arguments are supplied.
  6825. @end deffn
  6826.  
  6827. getserv
  6828. @c snarfed from net_db.c:346
  6829. @deffn {Scheme Procedure} getserv [name [protocol]]
  6830. @deffnx {Scheme Procedure} getservbyname name protocol
  6831. @deffnx {Scheme Procedure} getservbyport port protocol
  6832. Look up a network service by name or by service number, and return a
  6833. network service object.  The @var{protocol} argument specifies the name
  6834. of the desired protocol; if the protocol found in the network service
  6835. database does not match this name, a system error is signalled.
  6836.  
  6837. The @code{getserv} procedure will take either a service name or number
  6838. as its first argument; if given no arguments, it behaves like
  6839. @code{getservent} (see below).
  6840. @end deffn
  6841.  
  6842. sethost
  6843. @c snarfed from net_db.c:385
  6844. @deffn {Scheme Procedure} sethost [stayopen]
  6845. If @var{stayopen} is omitted, this is equivalent to @code{endhostent}.
  6846. Otherwise it is equivalent to @code{sethostent stayopen}.
  6847. @end deffn
  6848.  
  6849. setnet
  6850. @c snarfed from net_db.c:401
  6851. @deffn {Scheme Procedure} setnet [stayopen]
  6852. If @var{stayopen} is omitted, this is equivalent to @code{endnetent}.
  6853. Otherwise it is equivalent to @code{setnetent stayopen}.
  6854. @end deffn
  6855.  
  6856. setproto
  6857. @c snarfed from net_db.c:417
  6858. @deffn {Scheme Procedure} setproto [stayopen]
  6859. If @var{stayopen} is omitted, this is equivalent to @code{endprotoent}.
  6860. Otherwise it is equivalent to @code{setprotoent stayopen}.
  6861. @end deffn
  6862.  
  6863. setserv
  6864. @c snarfed from net_db.c:433
  6865. @deffn {Scheme Procedure} setserv [stayopen]
  6866. If @var{stayopen} is omitted, this is equivalent to @code{endservent}.
  6867. Otherwise it is equivalent to @code{setservent stayopen}.
  6868. @end deffn
  6869.  
  6870. htons
  6871. @c snarfed from socket.c:107
  6872. @deffn {Scheme Procedure} htons value
  6873. Convert a 16 bit quantity from host to network byte ordering.
  6874. @var{value} is packed into 2 bytes, which are then converted
  6875. and returned as a new integer.
  6876. @end deffn
  6877.  
  6878. ntohs
  6879. @c snarfed from socket.c:124
  6880. @deffn {Scheme Procedure} ntohs value
  6881. Convert a 16 bit quantity from network to host byte ordering.
  6882. @var{value} is packed into 2 bytes, which are then converted
  6883. and returned as a new integer.
  6884. @end deffn
  6885.  
  6886. htonl
  6887. @c snarfed from socket.c:141
  6888. @deffn {Scheme Procedure} htonl value
  6889. Convert a 32 bit quantity from host to network byte ordering.
  6890. @var{value} is packed into 4 bytes, which are then converted
  6891. and returned as a new integer.
  6892. @end deffn
  6893.  
  6894. ntohl
  6895. @c snarfed from socket.c:154
  6896. @deffn {Scheme Procedure} ntohl value
  6897. Convert a 32 bit quantity from network to host byte ordering.
  6898. @var{value} is packed into 4 bytes, which are then converted
  6899. and returned as a new integer.
  6900. @end deffn
  6901.  
  6902. inet-aton
  6903. @c snarfed from socket.c:174
  6904. @deffn {Scheme Procedure} inet-aton address
  6905. Convert an IPv4 Internet address from printable string
  6906. (dotted decimal notation) to an integer.  E.g.,
  6907.  
  6908. @lisp
  6909. (inet-aton "127.0.0.1") @result{} 2130706433
  6910. @end lisp
  6911. @end deffn
  6912.  
  6913. inet-ntoa
  6914. @c snarfed from socket.c:194
  6915. @deffn {Scheme Procedure} inet-ntoa inetid
  6916. Convert an IPv4 Internet address to a printable
  6917. (dotted decimal notation) string.  E.g.,
  6918.  
  6919. @lisp
  6920. (inet-ntoa 2130706433) @result{} "127.0.0.1"
  6921. @end lisp
  6922. @end deffn
  6923.  
  6924. inet-netof
  6925. @c snarfed from socket.c:214
  6926. @deffn {Scheme Procedure} inet-netof address
  6927. Return the network number part of the given IPv4
  6928. Internet address.  E.g.,
  6929.  
  6930. @lisp
  6931. (inet-netof 2130706433) @result{} 127
  6932. @end lisp
  6933. @end deffn
  6934.  
  6935. inet-lnaof
  6936. @c snarfed from socket.c:232
  6937. @deffn {Scheme Procedure} inet-lnaof address
  6938. Return the local-address-with-network part of the given
  6939. IPv4 Internet address, using the obsolete class A/B/C system.
  6940. E.g.,
  6941.  
  6942. @lisp
  6943. (inet-lnaof 2130706433) @result{} 1
  6944. @end lisp
  6945. @end deffn
  6946.  
  6947. inet-makeaddr
  6948. @c snarfed from socket.c:250
  6949. @deffn {Scheme Procedure} inet-makeaddr net lna
  6950. Make an IPv4 Internet address by combining the network number
  6951. @var{net} with the local-address-within-network number
  6952. @var{lna}.  E.g.,
  6953.  
  6954. @lisp
  6955. (inet-makeaddr 127 1) @result{} 2130706433
  6956. @end lisp
  6957. @end deffn
  6958.  
  6959. inet-pton
  6960. @c snarfed from socket.c:368
  6961. @deffn {Scheme Procedure} inet-pton family address
  6962. Convert a string containing a printable network address to
  6963. an integer address.  Note that unlike the C version of this
  6964. function,
  6965. the result is an integer with normal host byte ordering.
  6966. @var{family} can be @code{AF_INET} or @code{AF_INET6}.  E.g.,
  6967.  
  6968. @lisp
  6969. (inet-pton AF_INET "127.0.0.1") @result{} 2130706433
  6970. (inet-pton AF_INET6 "::1") @result{} 1
  6971. @end lisp
  6972. @end deffn
  6973.  
  6974. inet-ntop
  6975. @c snarfed from socket.c:403
  6976. @deffn {Scheme Procedure} inet-ntop family address
  6977. Convert a network address into a printable string.
  6978. Note that unlike the C version of this function,
  6979. the input is an integer with normal host byte ordering.
  6980. @var{family} can be @code{AF_INET} or @code{AF_INET6}.  E.g.,
  6981.  
  6982. @lisp
  6983. (inet-ntop AF_INET 2130706433) @result{} "127.0.0.1"
  6984. (inet-ntop AF_INET6 (- (expt 2 128) 1)) @result{}
  6985. ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
  6986. @end lisp
  6987. @end deffn
  6988.  
  6989. socket
  6990. @c snarfed from socket.c:448
  6991. @deffn {Scheme Procedure} socket family style proto
  6992. Return a new socket port of the type specified by @var{family},
  6993. @var{style} and @var{proto}.  All three parameters are
  6994. integers.  Supported values for @var{family} are
  6995. @code{AF_UNIX}, @code{AF_INET} and @code{AF_INET6}.
  6996. Typical values for @var{style} are @code{SOCK_STREAM},
  6997. @code{SOCK_DGRAM} and @code{SOCK_RAW}.
  6998.  
  6999. @var{proto} can be obtained from a protocol name using
  7000. @code{getprotobyname}.  A value of zero specifies the default
  7001. protocol, which is usually right.
  7002.  
  7003. A single socket port cannot by used for communication until it
  7004. has been connected to another socket.
  7005. @end deffn
  7006.  
  7007. socketpair
  7008. @c snarfed from socket.c:470
  7009. @deffn {Scheme Procedure} socketpair family style proto
  7010. Return a pair of connected (but unnamed) socket ports of the
  7011. type specified by @var{family}, @var{style} and @var{proto}.
  7012. Many systems support only socket pairs of the @code{AF_UNIX}
  7013. family.  Zero is likely to be the only meaningful value for
  7014. @var{proto}.
  7015. @end deffn
  7016.  
  7017. getsockopt
  7018. @c snarfed from socket.c:499
  7019. @deffn {Scheme Procedure} getsockopt sock level optname
  7020. Return the value of a particular socket option for the socket
  7021. port @var{sock}.  @var{level} is an integer code for type of
  7022. option being requested, e.g., @code{SOL_SOCKET} for
  7023. socket-level options.  @var{optname} is an integer code for the
  7024. option required and should be specified using one of the
  7025. symbols @code{SO_DEBUG}, @code{SO_REUSEADDR} etc.
  7026.  
  7027. The returned value is typically an integer but @code{SO_LINGER}
  7028. returns a pair of integers.
  7029. @end deffn
  7030.  
  7031. setsockopt
  7032. @c snarfed from socket.c:567
  7033. @deffn {Scheme Procedure} setsockopt sock level optname value
  7034. Set the value of a particular socket option for the socket
  7035. port @var{sock}.  @var{level} is an integer code for type of option
  7036. being set, e.g., @code{SOL_SOCKET} for socket-level options.
  7037. @var{optname} is an
  7038. integer code for the option to set and should be specified using one of
  7039. the symbols @code{SO_DEBUG}, @code{SO_REUSEADDR} etc.
  7040. @var{value} is the value to which the option should be set.  For
  7041. most options this must be an integer, but for @code{SO_LINGER} it must
  7042. be a pair.
  7043.  
  7044. The return value is unspecified.
  7045. @end deffn
  7046.  
  7047. shutdown
  7048. @c snarfed from socket.c:671
  7049. @deffn {Scheme Procedure} shutdown sock how
  7050. Sockets can be closed simply by using @code{close-port}. The
  7051. @code{shutdown} procedure allows reception or transmission on a
  7052. connection to be shut down individually, according to the parameter
  7053. @var{how}:
  7054.  
  7055. @table @asis
  7056. @item 0
  7057. Stop receiving data for this socket.  If further data arrives,  reject it.
  7058. @item 1
  7059. Stop trying to transmit data from this socket.  Discard any
  7060. data waiting to be sent.  Stop looking for acknowledgement of
  7061. data already sent; don't retransmit it if it is lost.
  7062. @item 2
  7063. Stop both reception and transmission.
  7064. @end table
  7065.  
  7066. The return value is unspecified.
  7067. @end deffn
  7068.  
  7069. connect
  7070. @c snarfed from socket.c:813
  7071. @deffn {Scheme Procedure} connect sock fam address . args
  7072. Initiate a connection from a socket using a specified address
  7073. family to the address
  7074. specified by @var{address} and possibly @var{args}.
  7075. The format required for @var{address}
  7076. and @var{args} depends on the family of the socket.
  7077.  
  7078. For a socket of family @code{AF_UNIX},
  7079. only @var{address} is specified and must be a string with the
  7080. filename where the socket is to be created.
  7081.  
  7082. For a socket of family @code{AF_INET},
  7083. @var{address} must be an integer IPv4 host address and
  7084. @var{args} must be a single integer port number.
  7085.  
  7086. For a socket of family @code{AF_INET6},
  7087. @var{address} must be an integer IPv6 host address and
  7088. @var{args} may be up to three integers:
  7089. port [flowinfo] [scope_id],
  7090. where flowinfo and scope_id default to zero.
  7091.  
  7092. The return value is unspecified.
  7093. @end deffn
  7094.  
  7095. bind
  7096. @c snarfed from socket.c:873
  7097. @deffn {Scheme Procedure} bind sock fam address . args
  7098. Assign an address to the socket port @var{sock}.
  7099. Generally this only needs to be done for server sockets,
  7100. so they know where to look for incoming connections.  A socket
  7101. without an address will be assigned one automatically when it
  7102. starts communicating.
  7103.  
  7104. The format of @var{address} and @var{args} depends
  7105. on the family of the socket.
  7106.  
  7107. For a socket of family @code{AF_UNIX}, only @var{address}
  7108. is specified and must be a string with the filename where
  7109. the socket is to be created.
  7110.  
  7111. For a socket of family @code{AF_INET}, @var{address}
  7112. must be an integer IPv4 address and @var{args}
  7113. must be a single integer port number.
  7114.  
  7115. The values of the following variables can also be used for
  7116. @var{address}:
  7117.  
  7118. @defvar INADDR_ANY
  7119. Allow connections from any address.
  7120. @end defvar
  7121.  
  7122. @defvar INADDR_LOOPBACK
  7123. The address of the local host using the loopback device.
  7124. @end defvar
  7125.  
  7126. @defvar INADDR_BROADCAST
  7127. The broadcast address on the local network.
  7128. @end defvar
  7129.  
  7130. @defvar INADDR_NONE
  7131. No address.
  7132. @end defvar
  7133.  
  7134. For a socket of family @code{AF_INET6}, @var{address}
  7135. must be an integer IPv6 address and @var{args}
  7136. may be up to three integers:
  7137. port [flowinfo] [scope_id],
  7138. where flowinfo and scope_id default to zero.
  7139.  
  7140. The return value is unspecified.
  7141. @end deffn
  7142.  
  7143. listen
  7144. @c snarfed from socket.c:907
  7145. @deffn {Scheme Procedure} listen sock backlog
  7146. Enable @var{sock} to accept connection
  7147. requests.  @var{backlog} is an integer specifying
  7148. the maximum length of the queue for pending connections.
  7149. If the queue fills, new clients will fail to connect until
  7150. the server calls @code{accept} to accept a connection from
  7151. the queue.
  7152.  
  7153. The return value is unspecified.
  7154. @end deffn
  7155.  
  7156. accept
  7157. @c snarfed from socket.c:1012
  7158. @deffn {Scheme Procedure} accept sock
  7159. Accept a connection on a bound, listening socket.
  7160. If there
  7161. are no pending connections in the queue, wait until
  7162. one is available unless the non-blocking option has been
  7163. set on the socket.
  7164.  
  7165. The return value is a
  7166. pair in which the @emph{car} is a new socket port for the
  7167. connection and
  7168. the @emph{cdr} is an object with address information about the
  7169. client which initiated the connection.
  7170.  
  7171. @var{sock} does not become part of the
  7172. connection and will continue to accept new requests.
  7173. @end deffn
  7174.  
  7175. getsockname
  7176. @c snarfed from socket.c:1039
  7177. @deffn {Scheme Procedure} getsockname sock
  7178. Return the address of @var{sock}, in the same form as the
  7179. object returned by @code{accept}.  On many systems the address
  7180. of a socket in the @code{AF_FILE} namespace cannot be read.
  7181. @end deffn
  7182.  
  7183. getpeername
  7184. @c snarfed from socket.c:1061
  7185. @deffn {Scheme Procedure} getpeername sock
  7186. Return the address that @var{sock}
  7187. is connected to, in the same form as the object returned by
  7188. @code{accept}.  On many systems the address of a socket in the
  7189. @code{AF_FILE} namespace cannot be read.
  7190. @end deffn
  7191.  
  7192. recv!
  7193. @c snarfed from socket.c:1096
  7194. @deffn {Scheme Procedure} recv! sock buf [flags]
  7195. Receive data from a socket port.
  7196. @var{sock} must already
  7197. be bound to the address from which data is to be received.
  7198. @var{buf} is a string into which
  7199. the data will be written.  The size of @var{buf} limits
  7200. the amount of
  7201. data which can be received: in the case of packet
  7202. protocols, if a packet larger than this limit is encountered
  7203. then some data
  7204. will be irrevocably lost.
  7205.  
  7206. The optional @var{flags} argument is a value or
  7207. bitwise OR of MSG_OOB, MSG_PEEK, MSG_DONTROUTE etc.
  7208.  
  7209. The value returned is the number of bytes read from the
  7210. socket.
  7211.  
  7212. Note that the data is read directly from the socket file
  7213. descriptor:
  7214. any unread buffered port data is ignored.
  7215. @end deffn
  7216.  
  7217. send
  7218. @c snarfed from socket.c:1129
  7219. @deffn {Scheme Procedure} send sock message [flags]
  7220. Transmit the string @var{message} on a socket port @var{sock}.
  7221. @var{sock} must already be bound to a destination address.  The
  7222. value returned is the number of bytes transmitted --
  7223. it's possible for
  7224. this to be less than the length of @var{message}
  7225. if the socket is
  7226. set to be non-blocking.  The optional @var{flags} argument
  7227. is a value or
  7228. bitwise OR of MSG_OOB, MSG_PEEK, MSG_DONTROUTE etc.
  7229.  
  7230. Note that the data is written directly to the socket
  7231. file descriptor:
  7232. any unflushed buffered port data is ignored.
  7233. @end deffn
  7234.  
  7235. recvfrom!
  7236. @c snarfed from socket.c:1169
  7237. @deffn {Scheme Procedure} recvfrom! sock str [flags [start [end]]]
  7238. Return data from the socket port @var{sock} and also
  7239. information about where the data was received from.
  7240. @var{sock} must already be bound to the address from which
  7241. data is to be received.  @code{str}, is a string into which the
  7242. data will be written.  The size of @var{str} limits the amount
  7243. of data which can be received: in the case of packet protocols,
  7244. if a packet larger than this limit is encountered then some
  7245. data will be irrevocably lost.
  7246.  
  7247. The optional @var{flags} argument is a value or bitwise OR of
  7248. @code{MSG_OOB}, @code{MSG_PEEK}, @code{MSG_DONTROUTE} etc.
  7249.  
  7250. The value returned is a pair: the @emph{car} is the number of
  7251. bytes read from the socket and the @emph{cdr} an address object
  7252. in the same form as returned by @code{accept}.  The address
  7253. will given as @code{#f} if not available, as is usually the
  7254. case for stream sockets.
  7255.  
  7256. The @var{start} and @var{end} arguments specify a substring of
  7257. @var{str} to which the data should be written.
  7258.  
  7259. Note that the data is read directly from the socket file
  7260. descriptor: any unread buffered port data is ignored.
  7261. @end deffn
  7262.  
  7263. sendto
  7264. @c snarfed from socket.c:1227
  7265. @deffn {Scheme Procedure} sendto sock message fam address . args_and_flags
  7266. Transmit the string @var{message} on the socket port
  7267. @var{sock}.  The
  7268. destination address is specified using the @var{fam},
  7269. @var{address} and
  7270. @var{args_and_flags} arguments, in a similar way to the
  7271. @code{connect} procedure.  @var{args_and_flags} contains
  7272. the usual connection arguments optionally followed by
  7273. a flags argument, which is a value or
  7274. bitwise OR of MSG_OOB, MSG_PEEK, MSG_DONTROUTE etc.
  7275.  
  7276. The value returned is the number of bytes transmitted --
  7277. it's possible for
  7278. this to be less than the length of @var{message} if the
  7279. socket is
  7280. set to be non-blocking.
  7281. Note that the data is written directly to the socket
  7282. file descriptor:
  7283. any unflushed buffered port data is ignored.
  7284. @end deffn
  7285.  
  7286. regexp?
  7287. @c snarfed from regex-posix.c:137
  7288. @deffn {Scheme Procedure} regexp? obj
  7289. Return @code{#t} if @var{obj} is a compiled regular expression,
  7290. or @code{#f} otherwise.
  7291. @end deffn
  7292.  
  7293. make-regexp
  7294. @c snarfed from regex-posix.c:182
  7295. @deffn {Scheme Procedure} make-regexp pat . flags
  7296. Compile the regular expression described by @var{pat}, and
  7297. return the compiled regexp structure.  If @var{pat} does not
  7298. describe a legal regular expression, @code{make-regexp} throws
  7299. a @code{regular-expression-syntax} error.
  7300.  
  7301. The @var{flags} arguments change the behavior of the compiled
  7302. regular expression.  The following flags may be supplied:
  7303.  
  7304. @table @code
  7305. @item regexp/icase
  7306. Consider uppercase and lowercase letters to be the same when
  7307. matching.
  7308. @item regexp/newline
  7309. If a newline appears in the target string, then permit the
  7310. @samp{^} and @samp{$} operators to match immediately after or
  7311. immediately before the newline, respectively.  Also, the
  7312. @samp{.} and @samp{[^...]} operators will never match a newline
  7313. character.  The intent of this flag is to treat the target
  7314. string as a buffer containing many lines of text, and the
  7315. regular expression as a pattern that may match a single one of
  7316. those lines.
  7317. @item regexp/basic
  7318. Compile a basic (``obsolete'') regexp instead of the extended
  7319. (``modern'') regexps that are the default.  Basic regexps do
  7320. not consider @samp{|}, @samp{+} or @samp{?} to be special
  7321. characters, and require the @samp{@{...@}} and @samp{(...)}
  7322. metacharacters to be backslash-escaped (@pxref{Backslash
  7323. Escapes}).  There are several other differences between basic
  7324. and extended regular expressions, but these are the most
  7325. significant.
  7326. @item regexp/extended
  7327. Compile an extended regular expression rather than a basic
  7328. regexp.  This is the default behavior; this flag will not
  7329. usually be needed.  If a call to @code{make-regexp} includes
  7330. both @code{regexp/basic} and @code{regexp/extended} flags, the
  7331. one which comes last will override the earlier one.
  7332. @end table
  7333. @end deffn
  7334.  
  7335. regexp-exec
  7336. @c snarfed from regex-posix.c:251
  7337. @deffn {Scheme Procedure} regexp-exec rx str [start [flags]]
  7338. Match the compiled regular expression @var{rx} against
  7339. @code{str}.  If the optional integer @var{start} argument is
  7340. provided, begin matching from that position in the string.
  7341. Return a match structure describing the results of the match,
  7342. or @code{#f} if no match could be found.
  7343.  
  7344. The @var{flags} arguments change the matching behavior.
  7345. The following flags may be supplied:
  7346.  
  7347. @table @code
  7348. @item regexp/notbol
  7349. Operator @samp{^} always fails (unless @code{regexp/newline}
  7350. is used).  Use this when the beginning of the string should
  7351. not be considered the beginning of a line.
  7352. @item regexp/noteol
  7353. Operator @samp{$} always fails (unless @code{regexp/newline}
  7354. is used).  Use this when the end of the string should not be
  7355. considered the end of a line.
  7356. @end table
  7357. @end deffn
  7358.  
  7359. single-active-thread?
  7360. @c snarfed from threads.c:79
  7361. @deffn {Scheme Procedure} single-active-thread?
  7362. implemented by the C function "scm_single_thread_p"
  7363. @end deffn
  7364.  
  7365. yield
  7366. @c snarfed from threads.c:85
  7367. @deffn {Scheme Procedure} yield
  7368. implemented by the C function "scm_yield"
  7369. @end deffn
  7370.  
  7371. call-with-new-thread
  7372. @c snarfed from threads.c:90
  7373. @deffn {Scheme Procedure} call-with-new-thread
  7374. implemented by the C function "scm_call_with_new_thread"
  7375. @end deffn
  7376.  
  7377. join-thread
  7378. @c snarfed from threads.c:104
  7379. @deffn {Scheme Procedure} join-thread
  7380. implemented by the C function "scm_join_thread"
  7381. @end deffn
  7382.  
  7383. make-mutex
  7384. @c snarfed from threads.c:109
  7385. @deffn {Scheme Procedure} make-mutex
  7386. implemented by the C function "scm_make_mutex"
  7387. @end deffn
  7388.  
  7389. lock-mutex
  7390. @c snarfed from threads.c:112
  7391. @deffn {Scheme Procedure} lock-mutex
  7392. implemented by the C function "scm_lock_mutex"
  7393. @end deffn
  7394.  
  7395. unlock-mutex
  7396. @c snarfed from threads.c:117
  7397. @deffn {Scheme Procedure} unlock-mutex
  7398. implemented by the C function "scm_unlock_mutex"
  7399. @end deffn
  7400.  
  7401. make-condition-variable
  7402. @c snarfed from threads.c:123
  7403. @deffn {Scheme Procedure} make-condition-variable
  7404. implemented by the C function "scm_make_condition_variable"
  7405. @end deffn
  7406.  
  7407. wait-condition-variable
  7408. @c snarfed from threads.c:125
  7409. @deffn {Scheme Procedure} wait-condition-variable
  7410. implemented by the C function "scm_wait_condition_variable"
  7411. @end deffn
  7412.  
  7413. signal-condition-variable
  7414. @c snarfed from threads.c:127
  7415. @deffn {Scheme Procedure} signal-condition-variable
  7416. implemented by the C function "scm_signal_condition_variable"
  7417. @end deffn
  7418.