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