api-undocumented.texi 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995
  1. This file gathers entries that have been automatically generated from
  2. docstrings in libguile. They are not included in the manual, however,
  3. for various reasons, mostly because they have been deprecated. They
  4. are here in this file to give docstring.el a chance to update them
  5. automatically.
  6. - The 'environments' are only in Guile by accident and are not used at
  7. all and we don't want to advertise them.
  8. - GOOPS is documented in its own manual.
  9. @deffn {Scheme Procedure} substring-move-right!
  10. implemented by the C function "scm_substring_move_x"
  11. @end deffn
  12. @deffn {Scheme Procedure} substring-move-left!
  13. implemented by the C function "scm_substring_move_x"
  14. @end deffn
  15. @deffn {Scheme Procedure} gentemp [prefix [obarray]]
  16. @deffnx {C Function} scm_gentemp (prefix, obarray)
  17. Create a new symbol with a name unique in an obarray.
  18. The name is constructed from an optional string @var{prefix}
  19. and a counter value. The default prefix is @code{t}. The
  20. @var{obarray} is specified as a second optional argument.
  21. Default is the system obarray where all normal symbols are
  22. interned. The counter is increased by 1 at each
  23. call. There is no provision for resetting the counter.
  24. @end deffn
  25. @deffn {Scheme Procedure} symbol-set! o s v
  26. @deffnx {C Function} scm_symbol_set_x (o, s, v)
  27. Find the symbol in @var{obarray} whose name is @var{string}, and rebind
  28. it to @var{value}. An error is signalled if @var{string} is not present
  29. in @var{obarray}.
  30. @end deffn
  31. @deffn {Scheme Procedure} symbol-bound? o s
  32. @deffnx {C Function} scm_symbol_bound_p (o, s)
  33. Return @code{#t} if @var{obarray} contains a symbol with name
  34. @var{string} bound to a defined value. This differs from
  35. @var{symbol-interned?} in that the mere mention of a symbol
  36. usually causes it to be interned; @code{symbol-bound?}
  37. determines whether a symbol has been given any meaningful
  38. value.
  39. @end deffn
  40. @deffn {Scheme Procedure} symbol-binding o s
  41. @deffnx {C Function} scm_symbol_binding (o, s)
  42. Look up in @var{obarray} the symbol whose name is @var{string}, and
  43. return the value to which it is bound. If @var{obarray} is @code{#f},
  44. use the global symbol table. If @var{string} is not interned in
  45. @var{obarray}, an error is signalled.
  46. @end deffn
  47. @deffn {Scheme Procedure} unintern-symbol o s
  48. @deffnx {C Function} scm_unintern_symbol (o, s)
  49. Remove the symbol with name @var{string} from @var{obarray}. This
  50. function returns @code{#t} if the symbol was present and @code{#f}
  51. otherwise.
  52. @end deffn
  53. @deffn {Scheme Procedure} intern-symbol o s
  54. @deffnx {C Function} scm_intern_symbol (o, s)
  55. Add a new symbol to @var{obarray} with name @var{string}, bound to an
  56. unspecified initial value. The symbol table is not modified if a symbol
  57. with this name is already present.
  58. @end deffn
  59. @deffn {Scheme Procedure} string->obarray-symbol o s [softp]
  60. @deffnx {C Function} scm_string_to_obarray_symbol (o, s, softp)
  61. Intern a new symbol in @var{obarray}, a symbol table, with name
  62. @var{string}.
  63. If @var{obarray} is @code{#f}, use the default system symbol table. If
  64. @var{obarray} is @code{#t}, the symbol should not be interned in any
  65. symbol table; merely return the pair (@var{symbol}
  66. . @var{#<undefined>}).
  67. The @var{soft?} argument determines whether new symbol table entries
  68. should be created when the specified symbol is not already present in
  69. @var{obarray}. If @var{soft?} is specified and is a true value, then
  70. new entries should not be added for symbols not already present in the
  71. table; instead, simply return @code{#f}.
  72. @end deffn
  73. @deffn {Scheme Procedure} read-and-eval! [port]
  74. @deffnx {C Function} scm_read_and_eval_x (port)
  75. Read a form from @var{port} (standard input by default), and evaluate it
  76. (memoizing it in the process) in the top-level environment. If no data
  77. is left to be read from @var{port}, an @code{end-of-file} error is
  78. signalled.
  79. @end deffn
  80. @deffn {Scheme Procedure} sloppy-member x lst
  81. @deffnx {C Function} scm_sloppy_member (x, lst)
  82. This procedure behaves like @code{member}, but does no type or error checking.
  83. Its use is recommended only in writing Guile internals,
  84. not for high-level Scheme programs.
  85. @end deffn
  86. @deffn {Scheme Procedure} sloppy-memv x lst
  87. @deffnx {C Function} scm_sloppy_memv (x, lst)
  88. This procedure behaves like @code{memv}, but does no type or error checking.
  89. Its use is recommended only in writing Guile internals,
  90. not for high-level Scheme programs.
  91. @end deffn
  92. @deffn {Scheme Procedure} sloppy-memq x lst
  93. @deffnx {C Function} scm_sloppy_memq (x, lst)
  94. This procedure behaves like @code{memq}, but does no type or error checking.
  95. Its use is recommended only in writing Guile internals,
  96. not for high-level Scheme programs.
  97. @end deffn
  98. @deffn {Scheme Procedure} builtin-variable name
  99. @deffnx {C Function} scm_builtin_variable (name)
  100. Do not use this function.
  101. @end deffn
  102. @deffn {Scheme Procedure} variable-set-name-hint! var hint
  103. @deffnx {C Function} scm_variable_set_name_hint (var, hint)
  104. Do not use this function.
  105. @end deffn
  106. @deffn {Scheme Procedure} close-all-ports-except . ports
  107. @deffnx {C Function} scm_close_all_ports_except (ports)
  108. [DEPRECATED] Close all open file ports used by the interpreter
  109. except for those supplied as arguments. This procedure
  110. was intended to be used before an exec call to close file descriptors
  111. which are not needed in the new process. However it has the
  112. undesirable side effect of flushing buffers, so it's deprecated.
  113. Use port-for-each instead.
  114. @end deffn
  115. @deffn {Scheme Procedure} c-clear-registered-modules
  116. @deffnx {C Function} scm_clear_registered_modules ()
  117. Destroy the list of modules registered with the current Guile process.
  118. The return value is unspecified. @strong{Warning:} this function does
  119. not actually unlink or deallocate these modules, but only destroys the
  120. records of which modules have been loaded. It should therefore be used
  121. only by module bookkeeping operations.
  122. @end deffn
  123. @deffn {Scheme Procedure} c-registered-modules
  124. @deffnx {C Function} scm_registered_modules ()
  125. Return a list of the object code modules that have been imported into
  126. the current Guile process. Each element of the list is a pair whose
  127. car is the name of the module, and whose cdr is the function handle
  128. for that module's initializer function. The name is the string that
  129. has been passed to scm_register_module_xxx.
  130. @end deffn
  131. @deffn {Scheme Procedure} module-import-interface module sym
  132. @deffnx {C Function} scm_module_import_interface (module, sym)
  133. @end deffn
  134. @deffn {Scheme Procedure} self-evaluating? obj
  135. @deffnx {C Function} scm_self_evaluating_p (obj)
  136. Return #t for objects which Guile considers self-evaluating
  137. @end deffn
  138. @deffn {Scheme Procedure} unmemoize-expr m
  139. @deffnx {C Function} scm_i_unmemoize_expr (m)
  140. Unmemoize the memoized expression @var{m},
  141. @end deffn
  142. @deffn {Scheme Procedure} weak-key-alist-vector? obj
  143. @deffnx {Scheme Procedure} weak-value-alist-vector? obj
  144. @deffnx {Scheme Procedure} doubly-weak-alist-vector? obj
  145. @deffnx {C Function} scm_weak_key_alist_vector_p (obj)
  146. Return @code{#t} if @var{obj} is the specified weak hash
  147. table. Note that a doubly weak hash table is neither a weak key
  148. nor a weak value hash table.
  149. @end deffn
  150. @deffn {Scheme Procedure} make-weak-key-alist-vector [size]
  151. @deffnx {Scheme Procedure} make-weak-value-alist-vector size
  152. @deffnx {Scheme Procedure} make-doubly-weak-alist-vector size
  153. @deffnx {C Function} scm_make_weak_key_alist_vector (size)
  154. Return a weak hash table with @var{size} buckets. As with any
  155. hash table, choosing a good size for the table requires some
  156. caution.
  157. You can modify weak hash tables in exactly the same way you
  158. would modify regular hash tables. (@pxref{Hash Tables})
  159. @end deffn
  160. @deffn {Scheme Procedure} include-deprecated-features
  161. Return @code{#t} iff deprecated features should be included
  162. in public interfaces.
  163. @end deffn
  164. @deffn {Scheme Procedure} issue-deprecation-warning . msgs
  165. Output @var{msgs} to @code{(current-error-port)} when this
  166. is the first call to @code{issue-deprecation-warning} with
  167. this specific @var{msg}. Do nothing otherwise.
  168. The argument @var{msgs} should be a list of strings;
  169. they are printed in turn, each one followed by a newline.
  170. @end deffn
  171. @deffn {Scheme Procedure} valid-object-procedure? proc
  172. @deffnx {C Function} scm_valid_object_procedure_p (proc)
  173. 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}.
  174. @end deffn
  175. @deffn {Scheme Procedure} %get-pre-modules-obarray
  176. @deffnx {C Function} scm_get_pre_modules_obarray ()
  177. 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.
  178. @end deffn
  179. @deffn {Scheme Procedure} standard-interface-eval-closure module
  180. @deffnx {C Function} scm_standard_interface_eval_closure (module)
  181. Return a interface eval closure for the module @var{module}. Such a closure does not allow new bindings to be added.
  182. @end deffn
  183. @deffn {Scheme Procedure} env-module env
  184. @deffnx {C Function} scm_env_module (env)
  185. Return the module of @var{ENV}, a lexical environment.
  186. @end deffn
  187. @deffn {Scheme Procedure} single-active-thread?
  188. implemented by the C function "scm_single_thread_p"
  189. @end deffn
  190. @deffn {Scheme Procedure} set-debug-cell-accesses! flag
  191. @deffnx {C Function} scm_set_debug_cell_accesses_x (flag)
  192. This function is used to turn on checking for a debug version of GUILE. This version does not support this functionality
  193. @end deffn
  194. @deffn {Scheme Procedure} standard-eval-closure module
  195. @deffnx {C Function} scm_standard_eval_closure (module)
  196. Return an eval closure for the module @var{module}.
  197. @end deffn
  198. @deffn {Scheme Procedure} mask-signals
  199. @deffnx {C Function} scm_mask_signals ()
  200. Mask signals. The returned value is not specified.
  201. @end deffn
  202. @deffn {Scheme Procedure} unmask-signals
  203. @deffnx {C Function} scm_unmask_signals ()
  204. Unmask signals. The returned value is not specified.
  205. @end deffn
  206. @deffn {Scheme Procedure} noop . args
  207. @deffnx {C Function} scm_noop (args)
  208. Do nothing. When called without arguments, return @code{#f},
  209. otherwise return the first argument.
  210. @end deffn
  211. @deffn {Scheme Procedure} system-async thunk
  212. @deffnx {C Function} scm_system_async (thunk)
  213. This function is deprecated. You can use @var{thunk} directly
  214. instead of explicitely creating an async object.
  215. @end deffn
  216. @deffn {Scheme Procedure} object-address obj
  217. @deffnx {C Function} scm_object_address (obj)
  218. Return an integer that for the lifetime of @var{obj} is uniquely
  219. returned by this function for @var{obj}
  220. @end deffn
  221. @deffn {Scheme Procedure} environment? obj
  222. @deffnx {C Function} scm_environment_p (obj)
  223. Return @code{#t} if @var{obj} is an environment, or @code{#f}
  224. otherwise.
  225. @end deffn
  226. @deffn {Scheme Procedure} environment-bound? env sym
  227. @deffnx {C Function} scm_environment_bound_p (env, sym)
  228. Return @code{#t} if @var{sym} is bound in @var{env}, or
  229. @code{#f} otherwise.
  230. @end deffn
  231. @deffn {Scheme Procedure} environment-ref env sym
  232. @deffnx {C Function} scm_environment_ref (env, sym)
  233. Return the value of the location bound to @var{sym} in
  234. @var{env}. If @var{sym} is unbound in @var{env}, signal an
  235. @code{environment:unbound} error.
  236. @end deffn
  237. @deffn {Scheme Procedure} environment-fold env proc init
  238. @deffnx {C Function} scm_environment_fold (env, proc, init)
  239. Iterate over all the bindings in @var{env}, accumulating some
  240. value.
  241. For each binding in @var{env}, apply @var{proc} to the symbol
  242. bound, its value, and the result from the previous application
  243. of @var{proc}.
  244. Use @var{init} as @var{proc}'s third argument the first time
  245. @var{proc} is applied.
  246. If @var{env} contains no bindings, this function simply returns
  247. @var{init}.
  248. If @var{env} binds the symbol sym1 to the value val1, sym2 to
  249. val2, and so on, then this procedure computes:
  250. @lisp
  251. (proc sym1 val1
  252. (proc sym2 val2
  253. ...
  254. (proc symn valn
  255. init)))
  256. @end lisp
  257. Each binding in @var{env} will be processed exactly once.
  258. @code{environment-fold} makes no guarantees about the order in
  259. which the bindings are processed.
  260. Here is a function which, given an environment, constructs an
  261. association list representing that environment's bindings,
  262. using environment-fold:
  263. @lisp
  264. (define (environment->alist env)
  265. (environment-fold env
  266. (lambda (sym val tail)
  267. (cons (cons sym val) tail))
  268. '()))
  269. @end lisp
  270. @end deffn
  271. @deffn {Scheme Procedure} environment-define env sym val
  272. @deffnx {C Function} scm_environment_define (env, sym, val)
  273. Bind @var{sym} to a new location containing @var{val} in
  274. @var{env}. If @var{sym} is already bound to another location
  275. in @var{env} and the binding is mutable, that binding is
  276. replaced. The new binding and location are both mutable. The
  277. return value is unspecified.
  278. If @var{sym} is already bound in @var{env}, and the binding is
  279. immutable, signal an @code{environment:immutable-binding} error.
  280. @end deffn
  281. @deffn {Scheme Procedure} environment-undefine env sym
  282. @deffnx {C Function} scm_environment_undefine (env, sym)
  283. Remove any binding for @var{sym} from @var{env}. If @var{sym}
  284. is unbound in @var{env}, do nothing. The return value is
  285. unspecified.
  286. If @var{sym} is already bound in @var{env}, and the binding is
  287. immutable, signal an @code{environment:immutable-binding} error.
  288. @end deffn
  289. @deffn {Scheme Procedure} environment-set! env sym val
  290. @deffnx {C Function} scm_environment_set_x (env, sym, val)
  291. If @var{env} binds @var{sym} to some location, change that
  292. location's value to @var{val}. The return value is
  293. unspecified.
  294. If @var{sym} is not bound in @var{env}, signal an
  295. @code{environment:unbound} error. If @var{env} binds @var{sym}
  296. to an immutable location, signal an
  297. @code{environment:immutable-location} error.
  298. @end deffn
  299. @deffn {Scheme Procedure} environment-cell env sym for_write
  300. @deffnx {C Function} scm_environment_cell (env, sym, for_write)
  301. Return the value cell which @var{env} binds to @var{sym}, or
  302. @code{#f} if the binding does not live in a value cell.
  303. The argument @var{for-write} indicates whether the caller
  304. intends to modify the variable's value by mutating the value
  305. cell. If the variable is immutable, then
  306. @code{environment-cell} signals an
  307. @code{environment:immutable-location} error.
  308. If @var{sym} is unbound in @var{env}, signal an
  309. @code{environment:unbound} error.
  310. If you use this function, you should consider using
  311. @code{environment-observe}, to be notified when @var{sym} gets
  312. re-bound to a new value cell, or becomes undefined.
  313. @end deffn
  314. @deffn {Scheme Procedure} environment-observe env proc
  315. @deffnx {C Function} scm_environment_observe (env, proc)
  316. Whenever @var{env}'s bindings change, apply @var{proc} to
  317. @var{env}.
  318. This function returns an object, token, which you can pass to
  319. @code{environment-unobserve} to remove @var{proc} from the set
  320. of procedures observing @var{env}. The type and value of
  321. token is unspecified.
  322. @end deffn
  323. @deffn {Scheme Procedure} environment-observe-weak env proc
  324. @deffnx {C Function} scm_environment_observe_weak (env, proc)
  325. This function is the same as environment-observe, except that
  326. the reference @var{env} retains to @var{proc} is a weak
  327. reference. This means that, if there are no other live,
  328. non-weak references to @var{proc}, it will be
  329. garbage-collected, and dropped from @var{env}'s
  330. list of observing procedures.
  331. @end deffn
  332. @deffn {Scheme Procedure} environment-unobserve token
  333. @deffnx {C Function} scm_environment_unobserve (token)
  334. Cancel the observation request which returned the value
  335. @var{token}. The return value is unspecified.
  336. If a call @code{(environment-observe env proc)} returns
  337. @var{token}, then the call @code{(environment-unobserve token)}
  338. will cause @var{proc} to no longer be called when @var{env}'s
  339. bindings change.
  340. @end deffn
  341. @deffn {Scheme Procedure} make-leaf-environment
  342. @deffnx {C Function} scm_make_leaf_environment ()
  343. Create a new leaf environment, containing no bindings.
  344. All bindings and locations created in the new environment
  345. will be mutable.
  346. @end deffn
  347. @deffn {Scheme Procedure} leaf-environment? object
  348. @deffnx {C Function} scm_leaf_environment_p (object)
  349. Return @code{#t} if object is a leaf environment, or @code{#f}
  350. otherwise.
  351. @end deffn
  352. @deffn {Scheme Procedure} make-eval-environment local imported
  353. @deffnx {C Function} scm_make_eval_environment (local, imported)
  354. Return a new environment object eval whose bindings are the
  355. union of the bindings in the environments @var{local} and
  356. @var{imported}, with bindings from @var{local} taking
  357. precedence. Definitions made in eval are placed in @var{local}.
  358. Applying @code{environment-define} or
  359. @code{environment-undefine} to eval has the same effect as
  360. applying the procedure to @var{local}.
  361. Note that eval incorporates @var{local} and @var{imported} by
  362. reference:
  363. If, after creating eval, the program changes the bindings of
  364. @var{local} or @var{imported}, those changes will be visible
  365. in eval.
  366. Since most Scheme evaluation takes place in eval environments,
  367. they transparently cache the bindings received from @var{local}
  368. and @var{imported}. Thus, the first time the program looks up
  369. a symbol in eval, eval may make calls to @var{local} or
  370. @var{imported} to find their bindings, but subsequent
  371. references to that symbol will be as fast as references to
  372. bindings in finite environments.
  373. In typical use, @var{local} will be a finite environment, and
  374. @var{imported} will be an import environment
  375. @end deffn
  376. @deffn {Scheme Procedure} eval-environment? object
  377. @deffnx {C Function} scm_eval_environment_p (object)
  378. Return @code{#t} if object is an eval environment, or @code{#f}
  379. otherwise.
  380. @end deffn
  381. @deffn {Scheme Procedure} eval-environment-local env
  382. @deffnx {C Function} scm_eval_environment_local (env)
  383. Return the local environment of eval environment @var{env}.
  384. @end deffn
  385. @deffn {Scheme Procedure} eval-environment-set-local! env local
  386. @deffnx {C Function} scm_eval_environment_set_local_x (env, local)
  387. Change @var{env}'s local environment to @var{local}.
  388. @end deffn
  389. @deffn {Scheme Procedure} eval-environment-imported env
  390. @deffnx {C Function} scm_eval_environment_imported (env)
  391. Return the imported environment of eval environment @var{env}.
  392. @end deffn
  393. @deffn {Scheme Procedure} eval-environment-set-imported! env imported
  394. @deffnx {C Function} scm_eval_environment_set_imported_x (env, imported)
  395. Change @var{env}'s imported environment to @var{imported}.
  396. @end deffn
  397. @deffn {Scheme Procedure} make-import-environment imports conflict_proc
  398. @deffnx {C Function} scm_make_import_environment (imports, conflict_proc)
  399. Return a new environment @var{imp} whose bindings are the union
  400. of the bindings from the environments in @var{imports};
  401. @var{imports} must be a list of environments. That is,
  402. @var{imp} binds a symbol to a location when some element of
  403. @var{imports} does.
  404. If two different elements of @var{imports} have a binding for
  405. the same symbol, the @var{conflict-proc} is called with the
  406. following parameters: the import environment, the symbol and
  407. the list of the imported environments that bind the symbol.
  408. If the @var{conflict-proc} returns an environment @var{env},
  409. the conflict is considered as resolved and the binding from
  410. @var{env} is used. If the @var{conflict-proc} returns some
  411. non-environment object, the conflict is considered unresolved
  412. and the symbol is treated as unspecified in the import
  413. environment.
  414. The checking for conflicts may be performed lazily, i. e. at
  415. the moment when a value or binding for a certain symbol is
  416. requested instead of the moment when the environment is
  417. created or the bindings of the imports change.
  418. All bindings in @var{imp} are immutable. If you apply
  419. @code{environment-define} or @code{environment-undefine} to
  420. @var{imp}, Guile will signal an
  421. @code{environment:immutable-binding} error. However,
  422. notice that the set of bindings in @var{imp} may still change,
  423. if one of its imported environments changes.
  424. @end deffn
  425. @deffn {Scheme Procedure} import-environment? object
  426. @deffnx {C Function} scm_import_environment_p (object)
  427. Return @code{#t} if object is an import environment, or
  428. @code{#f} otherwise.
  429. @end deffn
  430. @deffn {Scheme Procedure} import-environment-imports env
  431. @deffnx {C Function} scm_import_environment_imports (env)
  432. Return the list of environments imported by the import
  433. environment @var{env}.
  434. @end deffn
  435. @deffn {Scheme Procedure} import-environment-set-imports! env imports
  436. @deffnx {C Function} scm_import_environment_set_imports_x (env, imports)
  437. Change @var{env}'s list of imported environments to
  438. @var{imports}, and check for conflicts.
  439. @end deffn
  440. @deffn {Scheme Procedure} make-export-environment private signature
  441. @deffnx {C Function} scm_make_export_environment (private, signature)
  442. Return a new environment @var{exp} containing only those
  443. bindings in private whose symbols are present in
  444. @var{signature}. The @var{private} argument must be an
  445. environment.
  446. The environment @var{exp} binds symbol to location when
  447. @var{env} does, and symbol is exported by @var{signature}.
  448. @var{signature} is a list specifying which of the bindings in
  449. @var{private} should be visible in @var{exp}. Each element of
  450. @var{signature} should be a list of the form:
  451. (symbol attribute ...)
  452. where each attribute is one of the following:
  453. @table @asis
  454. @item the symbol @code{mutable-location}
  455. @var{exp} should treat the
  456. location bound to symbol as mutable. That is, @var{exp}
  457. will pass calls to @code{environment-set!} or
  458. @code{environment-cell} directly through to private.
  459. @item the symbol @code{immutable-location}
  460. @var{exp} should treat
  461. the location bound to symbol as immutable. If the program
  462. applies @code{environment-set!} to @var{exp} and symbol, or
  463. calls @code{environment-cell} to obtain a writable value
  464. cell, @code{environment-set!} will signal an
  465. @code{environment:immutable-location} error. Note that, even
  466. if an export environment treats a location as immutable, the
  467. underlying environment may treat it as mutable, so its
  468. value may change.
  469. @end table
  470. It is an error for an element of signature to specify both
  471. @code{mutable-location} and @code{immutable-location}. If
  472. neither is specified, @code{immutable-location} is assumed.
  473. As a special case, if an element of signature is a lone
  474. symbol @var{sym}, it is equivalent to an element of the form
  475. @code{(sym)}.
  476. All bindings in @var{exp} are immutable. If you apply
  477. @code{environment-define} or @code{environment-undefine} to
  478. @var{exp}, Guile will signal an
  479. @code{environment:immutable-binding} error. However,
  480. notice that the set of bindings in @var{exp} may still change,
  481. if the bindings in private change.
  482. @end deffn
  483. @deffn {Scheme Procedure} export-environment? object
  484. @deffnx {C Function} scm_export_environment_p (object)
  485. Return @code{#t} if object is an export environment, or
  486. @code{#f} otherwise.
  487. @end deffn
  488. @deffn {Scheme Procedure} export-environment-private env
  489. @deffnx {C Function} scm_export_environment_private (env)
  490. Return the private environment of export environment @var{env}.
  491. @end deffn
  492. @deffn {Scheme Procedure} export-environment-set-private! env private
  493. @deffnx {C Function} scm_export_environment_set_private_x (env, private)
  494. Change the private environment of export environment @var{env}.
  495. @end deffn
  496. @deffn {Scheme Procedure} export-environment-signature env
  497. @deffnx {C Function} scm_export_environment_signature (env)
  498. Return the signature of export environment @var{env}.
  499. @end deffn
  500. @deffn {Scheme Procedure} export-environment-set-signature! env signature
  501. @deffnx {C Function} scm_export_environment_set_signature_x (env, signature)
  502. Change the signature of export environment @var{env}.
  503. @end deffn
  504. @deffn {Scheme Procedure} %compute-slots class
  505. @deffnx {C Function} scm_sys_compute_slots (class)
  506. Return a list consisting of the names of all slots belonging to
  507. class @var{class}, i. e. the slots of @var{class} and of all of
  508. its superclasses.
  509. @end deffn
  510. @deffn {Scheme Procedure} get-keyword key l default_value
  511. @deffnx {C Function} scm_get_keyword (key, l, default_value)
  512. Determine an associated value for the keyword @var{key} from
  513. the list @var{l}. The list @var{l} has to consist of an even
  514. number of elements, where, starting with the first, every
  515. second element is a keyword, followed by its associated value.
  516. If @var{l} does not hold a value for @var{key}, the value
  517. @var{default_value} is returned.
  518. @end deffn
  519. @deffn {Scheme Procedure} slot-ref-using-class class obj slot_name
  520. @deffnx {C Function} scm_slot_ref_using_class (class, obj, slot_name)
  521. @end deffn
  522. @deffn {Scheme Procedure} slot-set-using-class! class obj slot_name value
  523. @deffnx {C Function} scm_slot_set_using_class_x (class, obj, slot_name, value)
  524. @end deffn
  525. @deffn {Scheme Procedure} class-of x
  526. @deffnx {C Function} scm_class_of (x)
  527. Return the class of @var{x}.
  528. @end deffn
  529. @deffn {Scheme Procedure} %goops-loaded
  530. @deffnx {C Function} scm_sys_goops_loaded ()
  531. Announce that GOOPS is loaded and perform initialization
  532. on the C level which depends on the loaded GOOPS modules.
  533. @end deffn
  534. @deffn {Scheme Procedure} %method-more-specific? m1 m2 targs
  535. @deffnx {C Function} scm_sys_method_more_specific_p (m1, m2, targs)
  536. @end deffn
  537. @deffn {Scheme Procedure} find-method . l
  538. @deffnx {C Function} scm_find_method (l)
  539. @end deffn
  540. @deffn {Scheme Procedure} primitive-generic-generic subr
  541. @deffnx {C Function} scm_primitive_generic_generic (subr)
  542. @end deffn
  543. @deffn {Scheme Procedure} enable-primitive-generic! . subrs
  544. @deffnx {C Function} scm_enable_primitive_generic_x (subrs)
  545. @end deffn
  546. @deffn {Scheme Procedure} generic-capability? proc
  547. @deffnx {C Function} scm_generic_capability_p (proc)
  548. @end deffn
  549. @deffn {Scheme Procedure} %invalidate-method-cache! gf
  550. @deffnx {C Function} scm_sys_invalidate_method_cache_x (gf)
  551. @end deffn
  552. @deffn {Scheme Procedure} %invalidate-class class
  553. @deffnx {C Function} scm_sys_invalidate_class (class)
  554. @end deffn
  555. @deffn {Scheme Procedure} %modify-class old new
  556. @deffnx {C Function} scm_sys_modify_class (old, new)
  557. @end deffn
  558. @deffn {Scheme Procedure} %modify-instance old new
  559. @deffnx {C Function} scm_sys_modify_instance (old, new)
  560. @end deffn
  561. @deffn {Scheme Procedure} %set-object-setter! obj setter
  562. @deffnx {C Function} scm_sys_set_object_setter_x (obj, setter)
  563. @end deffn
  564. @deffn {Scheme Procedure} %allocate-instance class initargs
  565. @deffnx {C Function} scm_sys_allocate_instance (class, initargs)
  566. Create a new instance of class @var{class} and initialize it
  567. from the arguments @var{initargs}.
  568. @end deffn
  569. @deffn {Scheme Procedure} slot-exists? obj slot_name
  570. @deffnx {C Function} scm_slot_exists_p (obj, slot_name)
  571. Return @code{#t} if @var{obj} has a slot named @var{slot_name}.
  572. @end deffn
  573. @deffn {Scheme Procedure} slot-bound? obj slot_name
  574. @deffnx {C Function} scm_slot_bound_p (obj, slot_name)
  575. Return @code{#t} if the slot named @var{slot_name} of @var{obj}
  576. is bound.
  577. @end deffn
  578. @deffn {Scheme Procedure} slot-set! obj slot_name value
  579. @deffnx {C Function} scm_slot_set_x (obj, slot_name, value)
  580. Set the slot named @var{slot_name} of @var{obj} to @var{value}.
  581. @end deffn
  582. @deffn {Scheme Procedure} slot-exists-using-class? class obj slot_name
  583. @deffnx {C Function} scm_slot_exists_using_class_p (class, obj, slot_name)
  584. @end deffn
  585. @deffn {Scheme Procedure} slot-bound-using-class? class obj slot_name
  586. @deffnx {C Function} scm_slot_bound_using_class_p (class, obj, slot_name)
  587. @end deffn
  588. @deffn {Scheme Procedure} %fast-slot-set! obj index value
  589. @deffnx {C Function} scm_sys_fast_slot_set_x (obj, index, value)
  590. Set the slot with index @var{index} in @var{obj} to
  591. @var{value}.
  592. @end deffn
  593. @deffn {Scheme Procedure} %fast-slot-ref obj index
  594. @deffnx {C Function} scm_sys_fast_slot_ref (obj, index)
  595. Return the slot value with index @var{index} from @var{obj}.
  596. @end deffn
  597. @deffn {Scheme Procedure} @@assert-bound-ref obj index
  598. @deffnx {C Function} scm_at_assert_bound_ref (obj, index)
  599. Like @code{assert-bound}, but use @var{index} for accessing
  600. the value from @var{obj}.
  601. @end deffn
  602. @deffn {Scheme Procedure} assert-bound value obj
  603. @deffnx {C Function} scm_assert_bound (value, obj)
  604. Return @var{value} if it is bound, and invoke the
  605. @var{slot-unbound} method of @var{obj} if it is not.
  606. @end deffn
  607. @deffn {Scheme Procedure} unbound? obj
  608. @deffnx {C Function} scm_unbound_p (obj)
  609. Return @code{#t} if @var{obj} is unbound.
  610. @end deffn
  611. @deffn {Scheme Procedure} make-unbound
  612. @deffnx {C Function} scm_make_unbound ()
  613. Return the unbound value.
  614. @end deffn
  615. @deffn {Scheme Procedure} accessor-method-slot-definition obj
  616. @deffnx {C Function} scm_accessor_method_slot_definition (obj)
  617. Return the slot definition of the accessor @var{obj}.
  618. @end deffn
  619. @deffn {Scheme Procedure} method-procedure obj
  620. @deffnx {C Function} scm_method_procedure (obj)
  621. Return the procedure of the method @var{obj}.
  622. @end deffn
  623. @deffn {Scheme Procedure} method-specializers obj
  624. @deffnx {C Function} scm_method_specializers (obj)
  625. Return specializers of the method @var{obj}.
  626. @end deffn
  627. @deffn {Scheme Procedure} method-generic-function obj
  628. @deffnx {C Function} scm_method_generic_function (obj)
  629. Return the generic function for the method @var{obj}.
  630. @end deffn
  631. @deffn {Scheme Procedure} generic-function-methods obj
  632. @deffnx {C Function} scm_generic_function_methods (obj)
  633. Return the methods of the generic function @var{obj}.
  634. @end deffn
  635. @deffn {Scheme Procedure} generic-function-name obj
  636. @deffnx {C Function} scm_generic_function_name (obj)
  637. Return the name of the generic function @var{obj}.
  638. @end deffn
  639. @deffn {Scheme Procedure} class-environment obj
  640. @deffnx {C Function} scm_class_environment (obj)
  641. Return the environment of the class @var{obj}.
  642. @end deffn
  643. @deffn {Scheme Procedure} class-slots obj
  644. @deffnx {C Function} scm_class_slots (obj)
  645. Return the slot list of the class @var{obj}.
  646. @end deffn
  647. @deffn {Scheme Procedure} class-precedence-list obj
  648. @deffnx {C Function} scm_class_precedence_list (obj)
  649. Return the class precedence list of the class @var{obj}.
  650. @end deffn
  651. @deffn {Scheme Procedure} class-direct-methods obj
  652. @deffnx {C Function} scm_class_direct_methods (obj)
  653. Return the direct methods of the class @var{obj}
  654. @end deffn
  655. @deffn {Scheme Procedure} class-direct-subclasses obj
  656. @deffnx {C Function} scm_class_direct_subclasses (obj)
  657. Return the direct subclasses of the class @var{obj}.
  658. @end deffn
  659. @deffn {Scheme Procedure} class-direct-slots obj
  660. @deffnx {C Function} scm_class_direct_slots (obj)
  661. Return the direct slots of the class @var{obj}.
  662. @end deffn
  663. @deffn {Scheme Procedure} class-direct-supers obj
  664. @deffnx {C Function} scm_class_direct_supers (obj)
  665. Return the direct superclasses of the class @var{obj}.
  666. @end deffn
  667. @deffn {Scheme Procedure} class-name obj
  668. @deffnx {C Function} scm_class_name (obj)
  669. Return the class name of @var{obj}.
  670. @end deffn
  671. @deffn {Scheme Procedure} instance? obj
  672. @deffnx {C Function} scm_instance_p (obj)
  673. Return @code{#t} if @var{obj} is an instance.
  674. @end deffn
  675. @deffn {Scheme Procedure} %inherit-magic! class dsupers
  676. @deffnx {C Function} scm_sys_inherit_magic_x (class, dsupers)
  677. @end deffn
  678. @deffn {Scheme Procedure} %prep-layout! class
  679. @deffnx {C Function} scm_sys_prep_layout_x (class)
  680. @end deffn
  681. @deffn {Scheme Procedure} %initialize-object obj initargs
  682. @deffnx {C Function} scm_sys_initialize_object (obj, initargs)
  683. Initialize the object @var{obj} with the given arguments
  684. @var{initargs}.
  685. @end deffn
  686. @deffn {Scheme Procedure} make . args
  687. @deffnx {C Function} scm_make (args)
  688. Make a new object. @var{args} must contain the class and
  689. all necessary initialization information.
  690. @end deffn
  691. @deffn {Scheme Procedure} slot-ref obj slot_name
  692. @deffnx {C Function} scm_slot_ref (obj, slot_name)
  693. Return the value from @var{obj}'s slot with the name
  694. @var{slot_name}.
  695. @end deffn
  696. @deffn {Scheme Procedure} %tag-body body
  697. @deffnx {C Function} scm_sys_tag_body (body)
  698. Internal GOOPS magic---don't use this function!
  699. @end deffn
  700. @deffn {Scheme Procedure} make-keyword-from-dash-symbol symbol
  701. @deffnx {C Function} scm_make_keyword_from_dash_symbol (symbol)
  702. Make a keyword object from a @var{symbol} that starts with a dash.
  703. @end deffn
  704. @deffn {Scheme Procedure} keyword-dash-symbol keyword
  705. @deffnx {C Function} scm_keyword_dash_symbol (keyword)
  706. Return the dash symbol for @var{keyword}.
  707. This is the inverse of @code{make-keyword-from-dash-symbol}.
  708. @end deffn
  709. @deffn {Scheme Procedure} dimensions->uniform-array dims prot [fill]
  710. @deffnx {Scheme Procedure} make-uniform-vector length prototype [fill]
  711. @deffnx {C Function} scm_dimensions_to_uniform_array (dims, prot, fill)
  712. Create and return a uniform array or vector of type
  713. corresponding to @var{prototype} with dimensions @var{dims} or
  714. length @var{length}. If @var{fill} is supplied, it's used to
  715. fill the array, otherwise @var{prototype} is used.
  716. @end deffn
  717. @deffn {Scheme Procedure} list->uniform-array ndim prot lst
  718. @deffnx {C Function} scm_list_to_uniform_array (ndim, prot, lst)
  719. Return a uniform array of the type indicated by prototype
  720. @var{prot} with elements the same as those of @var{lst}.
  721. Elements must be of the appropriate type, no coercions are
  722. done.
  723. The argument @var{ndim} determines the number of dimensions
  724. of the array. It is either an exact integer, giving the
  725. number directly, or a list of exact integers, whose length
  726. specifies the number of dimensions and each element is the
  727. lower index bound of its dimension.
  728. @end deffn
  729. @deffn {Scheme Procedure} array-prototype ra
  730. @deffnx {C Function} scm_array_prototype (ra)
  731. Return an object that would produce an array of the same type
  732. as @var{array}, if used as the @var{prototype} for
  733. @code{make-uniform-array}.
  734. @end deffn
  735. @deffn {Scheme Procedure} call-with-dynamic-root thunk handler
  736. @deffnx {C Function} scm_call_with_dynamic_root (thunk, handler)
  737. Call @var{thunk} with a new dynamic state and withina continuation barrier. The @var{handler} catches allotherwise uncaught throws and executes within the samedynamic context as @var{thunk}.
  738. @end deffn
  739. @deffn {Scheme Procedure} dynamic-root
  740. @deffnx {C Function} scm_dynamic_root ()
  741. Return an object representing the current dynamic root.
  742. These objects are only useful for comparison using @code{eq?}.
  743. @end deffn
  744. @deffn {Scheme Procedure} uniform-vector? obj
  745. @deffnx {C Function} scm_uniform_vector_p (obj)
  746. Return @code{#t} if @var{obj} is a uniform vector.
  747. @end deffn
  748. @deffn {Scheme Procedure} uniform-vector-ref v idx
  749. @deffnx {C Function} scm_uniform_vector_ref (v, idx)
  750. Return the element at index @var{idx} of the
  751. homogenous numeric vector @var{v}.
  752. @end deffn
  753. @deffn {Scheme Procedure} uniform-vector-set! v idx val
  754. @deffnx {C Function} scm_uniform_vector_set_x (v, idx, val)
  755. Set the element at index @var{idx} of the
  756. homogenous numeric vector @var{v} to @var{val}.
  757. @end deffn
  758. @deffn {Scheme Procedure} uniform-vector->list uvec
  759. @deffnx {C Function} scm_uniform_vector_to_list (uvec)
  760. Convert the uniform numeric vector @var{uvec} to a list.
  761. @end deffn
  762. @deffn {Scheme Procedure} uniform-vector-length v
  763. @deffnx {C Function} scm_uniform_vector_length (v)
  764. Return the number of elements in the uniform vector @var{v}.
  765. @end deffn
  766. @deffn {Scheme Procedure} make-u8vector len [fill]
  767. @deffnx {C Function} scm_make_u8vector (len, fill)
  768. Return a newly allocated uniform numeric vector which can
  769. hold @var{len} elements. If @var{fill} is given, it is used to
  770. initialize the elements, otherwise the contents of the vector
  771. is unspecified.
  772. @end deffn
  773. @deffn {Scheme Procedure} u8vector . l
  774. @deffnx {C Function} scm_u8vector (l)
  775. Return a newly allocated uniform numeric vector containing
  776. all argument values.
  777. @end deffn
  778. @deffn {Scheme Procedure} list->u8vector l
  779. @deffnx {C Function} scm_list_to_u8vector (l)
  780. Convert the list @var{l} to a numeric uniform vector.
  781. @end deffn
  782. @deffn {Scheme Procedure} any->u8vector obj
  783. @deffnx {C Function} scm_any_to_u8vector (obj)
  784. Convert @var{obj}, which can be a list, vector, or
  785. uniform vector, to a numeric uniform vector of
  786. type u8.
  787. @end deffn
  788. @deffn {Scheme Procedure} string-any-c-code char_pred s [start [end]]
  789. @deffnx {C Function} scm_string_any (char_pred, s, start, end)
  790. Check if the predicate @var{pred} is true for any character in
  791. the string @var{s}.
  792. Calls to @var{pred} are made from left to right across @var{s}.
  793. When it returns true (ie.@: non-@code{#f}), that return value
  794. is the return from @code{string-any}.
  795. The SRFI-13 specification requires that the call to @var{pred}
  796. on the last character of @var{s} (assuming that point is
  797. reached) be a tail call, but currently in Guile this is not the
  798. case.
  799. @end deffn
  800. @deffn {Scheme Procedure} string-every-c-code char_pred s [start [end]]
  801. @deffnx {C Function} scm_string_every (char_pred, s, start, end)
  802. Check if the predicate @var{pred} is true for every character
  803. in the string @var{s}.
  804. Calls to @var{pred} are made from left to right across @var{s}.
  805. If the predicate is true for every character then the return
  806. value from the last @var{pred} call is the return from
  807. @code{string-every}.
  808. If there are no characters in @var{s} (ie.@: @var{start} equals
  809. @var{end}) then the return is @code{#t}.
  810. The SRFI-13 specification requires that the call to @var{pred}
  811. on the last character of @var{s} (assuming that point is
  812. reached) be a tail call, but currently in Guile this is not the
  813. case.
  814. @end deffn
  815. @deffn {Scheme Procedure} inf? x
  816. @deffnx {C Function} scm_inf_p (x)
  817. Return @code{#t} if @var{x} is either @samp{+inf.0}
  818. or @samp{-inf.0}, @code{#f} otherwise.
  819. @end deffn