new-docstrings.texi 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. @c module-for-docstring (guile)
  2. @deffn {Scheme Procedure} uniform-array->bytevector array
  3. @deffnx {C Function} scm_uniform_array_to_bytevector (array)
  4. Return a newly allocated bytevector whose contents
  5. will be copied from the uniform array @var{array}.
  6. @end deffn
  7. @deffn {Scheme Procedure} %start-stack id thunk
  8. @deffnx {C Function} scm_sys_start_stack (id, thunk)
  9. Call @var{thunk} on an evaluator stack tagged with @var{id}.
  10. @end deffn
  11. @deffn {Scheme Procedure} guardian-destroyed? guardian
  12. @deffnx {C Function} scm_guardian_destroyed_p (guardian)
  13. Return @code{#t} if @var{guardian} has been destroyed, otherwise @code{#f}.
  14. @end deffn
  15. @deffn {Scheme Procedure} guardian-greedy? guardian
  16. @deffnx {C Function} scm_guardian_greedy_p (guardian)
  17. Return @code{#t} if @var{guardian} is a greedy guardian, otherwise @code{#f}.
  18. @end deffn
  19. @deffn {Scheme Procedure} destroy-guardian! guardian
  20. @deffnx {C Function} scm_destroy_guardian_x (guardian)
  21. Destroys @var{guardian}, by making it impossible to put any more
  22. objects in it or get any objects from it. It also unguards any
  23. objects guarded by @var{guardian}.
  24. @end deffn
  25. @deffn {Scheme Procedure} gc-dump
  26. @deffnx {C Function} scm_gc_dump ()
  27. Dump information about the garbage collector's internal data structures and memory usage to the standard output.
  28. @end deffn
  29. @deffn {Scheme Procedure} gc-disable
  30. @deffnx {C Function} scm_gc_disable ()
  31. Disables the garbage collector. Nested calls are permitted. GC is re-enabled once @code{gc-enable} has been called the same number of times @code{gc-disable} was called.
  32. @end deffn
  33. @deffn {Scheme Procedure} gc-enable
  34. @deffnx {C Function} scm_gc_enable ()
  35. Enables the garbage collector.
  36. @end deffn
  37. @deffn {Scheme Procedure} make-generalized-vector type len [fill]
  38. @deffnx {C Function} scm_make_generalized_vector (type, len, fill)
  39. Make a generalized vector
  40. @end deffn
  41. @deffn {Scheme Procedure} set-primitive-generic! subr generic
  42. @deffnx {C Function} scm_set_primitive_generic_x (subr, generic)
  43. @end deffn
  44. @deffn {Scheme Procedure} nl-langinfo item [locale]
  45. @deffnx {C Function} scm_nl_langinfo (item, locale)
  46. Return a string denoting locale information for @var{item} in the current locale or that specified by @var{locale}. The semantics and arguments are the same as those of the X/Open @code{nl_langinfo} function (@pxref{The Elegant and Fast Way, @code{nl_langinfo},, libc, The GNU C Library Reference Manual}).
  47. @end deffn
  48. @deffn {Scheme Procedure} %warn-autocompilation-enabled
  49. @deffnx {C Function} scm_sys_warn_autocompilation_enabled ()
  50. @end deffn
  51. @deffn {Scheme Procedure} make-syncase-macro type binding
  52. @deffnx {C Function} scm_make_syncase_macro (type, binding)
  53. Return a @dfn{macro} that requires expansion by syntax-case.
  54. While users should not call this function, it is useful to know
  55. that syntax-case macros are represented as Guile primitive macros.
  56. @end deffn
  57. @deffn {Scheme Procedure} make-extended-syncase-macro m type binding
  58. @deffnx {C Function} scm_make_extended_syncase_macro (m, type, binding)
  59. Extend a core macro @var{m} with a syntax-case binding.
  60. @end deffn
  61. @deffn {Scheme Procedure} syncase-macro-type m
  62. @deffnx {C Function} scm_syncase_macro_type (m)
  63. Return the type of the macro @var{m}.
  64. @end deffn
  65. @deffn {Scheme Procedure} syncase-macro-binding m
  66. @deffnx {C Function} scm_syncase_macro_binding (m)
  67. Return the binding of the macro @var{m}.
  68. @end deffn
  69. @deffn {Scheme Procedure} memoize-expression exp
  70. @deffnx {C Function} scm_memoize_expression (exp)
  71. Memoize the expression @var{exp}.
  72. @end deffn
  73. @deffn {Scheme Procedure} unmemoize-expression m
  74. @deffnx {C Function} scm_unmemoize_expression (m)
  75. Unmemoize the memoized expression @var{m}.
  76. @end deffn
  77. @deffn {Scheme Procedure} memoized-expression-typecode m
  78. @deffnx {C Function} scm_memoized_expression_typecode (m)
  79. Return the typecode from the memoized expression @var{m}.
  80. @end deffn
  81. @deffn {Scheme Procedure} memoized-expression-data m
  82. @deffnx {C Function} scm_memoized_expression_data (m)
  83. Return the data from the memoized expression @var{m}.
  84. @end deffn
  85. @deffn {Scheme Procedure} memoized-typecode sym
  86. @deffnx {C Function} scm_memoized_typecode (sym)
  87. Return the memoized typecode corresponding to the symbol @var{sym}.
  88. @end deffn
  89. @deffn {Scheme Procedure} memoize-variable-access! m mod
  90. @deffnx {C Function} scm_memoize_variable_access_x (m, mod)
  91. Look up and cache the variable that @var{m} will access, returning the variable.
  92. @end deffn
  93. @deffn {Scheme Procedure} module-local-variable module sym
  94. @deffnx {C Function} scm_module_local_variable (module, sym)
  95. Return the variable bound to @var{sym} in @var{module}. Return @code{#f} is @var{sym} is not bound locally in @var{module}.
  96. @end deffn
  97. @deffn {Scheme Procedure} module-variable module sym
  98. @deffnx {C Function} scm_module_variable (module, sym)
  99. Return the variable bound to @var{sym} in @var{module}. This may be both a local variable or an imported variable. Return @code{#f} is @var{sym} is not bound in @var{module}.
  100. @end deffn
  101. @deffn {Scheme Procedure} eval-closure-module eval_closure
  102. @deffnx {C Function} scm_eval_closure_module (eval_closure)
  103. Return the module associated with this eval closure.
  104. @end deffn
  105. @deffn {Scheme Procedure} module-transformer module
  106. @deffnx {C Function} scm_module_transformer (module)
  107. Returns the syntax expander for the given module.
  108. @end deffn
  109. @deffn {Scheme Procedure} module-public-interface module
  110. @deffnx {C Function} scm_module_public_interface (module)
  111. Return the public interface of @var{module}.
  112. If @var{module} has no public interface, @code{#f} is returned.
  113. @end deffn
  114. @deffn {Scheme Procedure} define! sym value
  115. @deffnx {C Function} scm_define (sym, value)
  116. Define @var{sym} to be @var{value} in the current module.Returns the variable itself. Note that this is a procedure, not a macro.
  117. @end deffn
  118. @deffn {Scheme Procedure} module-reverse-lookup module variable
  119. @deffnx {C Function} scm_module_reverse_lookup (module, variable)
  120. Return the symbol under which @var{variable} is bound in @var{module} or @var{#f} if @var{variable} is not visible from @var{module}. If @var{module} is @code{#f}, then the pre-module obarray is used.
  121. @end deffn
  122. @deffn {Scheme Procedure} cddr x
  123. @deffnx {C Function} scm_cddr (x)
  124. @end deffn
  125. @deffn {Scheme Procedure} make-promise thunk
  126. @deffnx {C Function} scm_make_promise (thunk)
  127. Create a new promise object.
  128. @code{make-promise} is a procedural form of @code{delay}.
  129. These two expressions are equivalent:
  130. @lisp
  131. (delay @var{exp})
  132. (make-promise (lambda () @var{exp}))
  133. @end lisp
  134. @end deffn
  135. @deffn {Scheme Procedure} %get-stack-size
  136. @deffnx {C Function} scm_sys_get_stack_size ()
  137. Return the current thread's C stack size (in Scheme objects).
  138. @end deffn
  139. @deffn {Scheme Procedure} %string-dump str
  140. @deffnx {C Function} scm_sys_string_dump (str)
  141. Returns an association list containing debugging information
  142. for @var{str}. The association list has the following entries.@table @code
  143. @item string
  144. The string itself.
  145. @item start
  146. The start index of the string into its stringbuf
  147. @item length
  148. The length of the string
  149. @item shared
  150. If this string is a substring, it returns its parent string.
  151. Otherwise, it returns @code{#f}
  152. @item read-only
  153. @code{#t} if the string is read-only
  154. @item stringbuf-chars
  155. A new string containing this string's stringbuf's characters
  156. @item stringbuf-length
  157. The number of characters in this stringbuf
  158. @item stringbuf-shared
  159. @code{#t} if this stringbuf is shared
  160. @item stringbuf-wide
  161. @code{#t} if this stringbuf's characters are stored in a
  162. 32-bit buffer, or @code{#f} if they are stored in an 8-bit
  163. buffer
  164. @end table
  165. @end deffn
  166. @deffn {Scheme Procedure} %symbol-dump sym
  167. @deffnx {C Function} scm_sys_symbol_dump (sym)
  168. Returns an association list containing debugging information
  169. for @var{sym}. The association list has the following entries.@table @code
  170. @item symbol
  171. The symbol itself
  172. @item hash
  173. Its hash value
  174. @item interned
  175. @code{#t} if it is an interned symbol
  176. @item stringbuf-chars
  177. A new string containing this symbols's stringbuf's characters
  178. @item stringbuf-length
  179. The number of characters in this stringbuf
  180. @item stringbuf-shared
  181. @code{#t} if this stringbuf is shared
  182. @item stringbuf-wide
  183. @code{#t} if this stringbuf's characters are stored in a
  184. 32-bit buffer, or @code{#f} if they are stored in an 8-bit
  185. buffer
  186. @end table
  187. @end deffn
  188. @deffn {Scheme Procedure} string-bytes-per-char string
  189. @deffnx {C Function} scm_string_bytes_per_char (string)
  190. Return the bytes used to represent a character in @var{string}.This will return 1 or 4.
  191. @end deffn
  192. @deffn {Scheme Procedure} uniform-vector-element-type v
  193. @deffnx {C Function} scm_uniform_vector_element_type (v)
  194. Return the type of the elements in the uniform vector, @var{v}.
  195. @end deffn
  196. @deffn {Scheme Procedure} uniform-vector-element-size v
  197. @deffnx {C Function} scm_uniform_vector_element_size (v)
  198. Return the number of bytes allocated to each element in the
  199. uniform vector, @var{v}.
  200. @end deffn
  201. @deffn {Scheme Procedure} canonicalize-path path
  202. @deffnx {C Function} scm_canonicalize_path (path)
  203. Return the canonical path of @var{path}. A canonical path has
  204. no @code{.} or @code{..} components, nor any repeated path
  205. separators (@code{/}) nor symlinks.
  206. Raises an error if any component of @var{path} does not exist.
  207. @end deffn
  208. @deffn {Scheme Procedure} getrlimit resource
  209. @deffnx {C Function} scm_getrlimit (resource)
  210. Get a resource limit for this process. @var{resource} identifies the resource,
  211. either as an integer or as a symbol. For example, @code{(getrlimit 'stack)}
  212. gets the limits associated with @code{RLIMIT_STACK}.
  213. @code{getrlimit} returns two values, the soft and the hard limit. If no
  214. limit is set for the resource in question, the returned limit will be @code{#f}.
  215. @end deffn
  216. @deffn {Scheme Procedure} setrlimit resource soft hard
  217. @deffnx {C Function} scm_setrlimit (resource, soft, hard)
  218. Set a resource limit for this process. @var{resource} identifies the resource,
  219. either as an integer or as a symbol. @var{soft} and @var{hard} should be integers,
  220. or @code{#f} to indicate no limit (i.e., @code{RLIM_INFINITY}).
  221. For example, @code{(setrlimit 'stack 150000 300000)} sets the @code{RLIMIT_STACK}
  222. limit to 150 kilobytes, with a hard limit of 300 kB.
  223. @end deffn