1 /* This file contains definitions for deprecated features. When you
2 deprecate something, move it here when that is feasible.
5 /* Copyright (C) 2003, 2004, 2006, 2008, 2009 Free Software Foundation, Inc.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public License
9 * as published by the Free Software Foundation; either version 3 of
10 * the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
27 #define SCM_BUILDING_DEPRECATED_CODE
29 #include "libguile/_scm.h"
30 #include "libguile/async.h"
31 #include "libguile/deprecated.h"
32 #include "libguile/discouraged.h"
33 #include "libguile/deprecation.h"
34 #include "libguile/snarf.h"
35 #include "libguile/validate.h"
36 #include "libguile/strings.h"
37 #include "libguile/srfi-13.h"
38 #include "libguile/modules.h"
39 #include "libguile/generalized-arrays.h"
40 #include "libguile/eval.h"
41 #include "libguile/smob.h"
42 #include "libguile/procprop.h"
43 #include "libguile/vectors.h"
44 #include "libguile/hashtab.h"
45 #include "libguile/struct.h"
46 #include "libguile/variable.h"
47 #include "libguile/fluids.h"
48 #include "libguile/ports.h"
49 #include "libguile/eq.h"
50 #include "libguile/read.h"
51 #include "libguile/strports.h"
52 #include "libguile/smob.h"
53 #include "libguile/alist.h"
54 #include "libguile/keywords.h"
55 #include "libguile/socket.h"
56 #include "libguile/feature.h"
62 #include <arpa/inet.h>
64 #if (SCM_ENABLE_DEPRECATED == 1)
66 /* From print.c: Internal symbol names of isyms. Deprecated in guile 1.7.0 on
68 char *scm_isymnames
[] =
74 SCM_REGISTER_PROC(s_substring_move_left_x
, "substring-move-left!", 5, 0, 0, scm_substring_move_x
);
76 SCM_REGISTER_PROC(s_substring_move_right_x
, "substring-move-right!", 5, 0, 0, scm_substring_move_x
);
79 scm_wta (SCM arg
, const char *pos
, const char *s_subr
)
81 if (!s_subr
|| !*s_subr
)
83 if ((~0x1fL
) & (long) pos
)
85 /* error string supplied. */
86 scm_misc_error (s_subr
, pos
, scm_list_1 (arg
));
90 /* numerical error code. */
91 scm_t_bits error
= (scm_t_bits
) pos
;
96 scm_wrong_type_arg (s_subr
, 0, arg
);
98 scm_wrong_type_arg (s_subr
, 1, arg
);
100 scm_wrong_type_arg (s_subr
, 2, arg
);
102 scm_wrong_type_arg (s_subr
, 3, arg
);
104 scm_wrong_type_arg (s_subr
, 4, arg
);
106 scm_wrong_type_arg (s_subr
, 5, arg
);
108 scm_wrong_type_arg (s_subr
, 6, arg
);
110 scm_wrong_type_arg (s_subr
, 7, arg
);
112 scm_wrong_num_args (arg
);
114 scm_out_of_range (s_subr
, arg
);
116 scm_memory_error (s_subr
);
118 /* this shouldn't happen. */
119 scm_misc_error (s_subr
, "Unknown error", SCM_EOL
);
122 return SCM_UNSPECIFIED
;
128 /* We can't use SCM objects here. One should be able to call
129 SCM_REGISTER_MODULE from a C++ constructor for a static
130 object. This happens before main and thus before libguile is
134 struct moddata
*link
;
139 static struct moddata
*registered_mods
= NULL
;
142 scm_register_module_xxx (char *module_name
, void *init_func
)
146 scm_c_issue_deprecation_warning
147 ("`scm_register_module_xxx' is deprecated. Use extensions instead.");
149 /* XXX - should we (and can we) DEFER_INTS here? */
151 for (md
= registered_mods
; md
; md
= md
->link
)
152 if (!strcmp (md
->module_name
, module_name
))
154 md
->init_func
= init_func
;
158 md
= (struct moddata
*) malloc (sizeof (struct moddata
));
162 "guile: can't register module (%s): not enough memory",
167 md
->module_name
= module_name
;
168 md
->init_func
= init_func
;
169 md
->link
= registered_mods
;
170 registered_mods
= md
;
173 SCM_DEFINE (scm_registered_modules
, "c-registered-modules", 0, 0, 0,
175 "Return a list of the object code modules that have been imported into\n"
176 "the current Guile process. Each element of the list is a pair whose\n"
177 "car is the name of the module, and whose cdr is the function handle\n"
178 "for that module's initializer function. The name is the string that\n"
179 "has been passed to scm_register_module_xxx.")
180 #define FUNC_NAME s_scm_registered_modules
186 for (md
= registered_mods
; md
; md
= md
->link
)
187 res
= scm_cons (scm_cons (scm_from_locale_string (md
->module_name
),
188 scm_from_ulong ((unsigned long) md
->init_func
)),
194 SCM_DEFINE (scm_clear_registered_modules
, "c-clear-registered-modules", 0, 0, 0,
196 "Destroy the list of modules registered with the current Guile process.\n"
197 "The return value is unspecified. @strong{Warning:} this function does\n"
198 "not actually unlink or deallocate these modules, but only destroys the\n"
199 "records of which modules have been loaded. It should therefore be used\n"
200 "only by module bookkeeping operations.")
201 #define FUNC_NAME s_scm_clear_registered_modules
203 struct moddata
*md1
, *md2
;
205 SCM_CRITICAL_SECTION_START
;
207 for (md1
= registered_mods
; md1
; md1
= md2
)
212 registered_mods
= NULL
;
214 SCM_CRITICAL_SECTION_END
;
215 return SCM_UNSPECIFIED
;
220 scm_remember (SCM
*ptr
)
222 scm_c_issue_deprecation_warning ("`scm_remember' is deprecated. "
223 "Use the `scm_remember_upto_here*' family of functions instead.");
227 scm_protect_object (SCM obj
)
229 scm_c_issue_deprecation_warning ("`scm_protect_object' is deprecated. "
230 "Use `scm_gc_protect_object' instead.");
231 return scm_gc_protect_object (obj
);
235 scm_unprotect_object (SCM obj
)
237 scm_c_issue_deprecation_warning ("`scm_unprotect_object' is deprecated. "
238 "Use `scm_gc_unprotect_object' instead.");
239 return scm_gc_unprotect_object (obj
);
242 SCM_SYMBOL (scm_sym_app
, "app");
243 SCM_SYMBOL (scm_sym_modules
, "modules");
244 static SCM module_prefix
= SCM_BOOL_F
;
245 static SCM make_modules_in_var
;
246 static SCM beautify_user_module_x_var
;
247 static SCM try_module_autoload_var
;
252 #define PERM(x) scm_permanent_object(x)
254 if (module_prefix
== SCM_BOOL_F
)
256 module_prefix
= PERM (scm_list_2 (scm_sym_app
, scm_sym_modules
));
257 make_modules_in_var
= PERM (scm_c_lookup ("make-modules-in"));
258 beautify_user_module_x_var
=
259 PERM (scm_c_lookup ("beautify-user-module!"));
260 try_module_autoload_var
= PERM (scm_c_lookup ("try-module-autoload"));
265 scm_module_full_name (SCM name
)
267 init_module_stuff ();
268 if (scm_is_eq (SCM_CAR (name
), scm_sym_app
))
271 return scm_append (scm_list_2 (module_prefix
, name
));
275 scm_make_module (SCM name
)
277 init_module_stuff ();
278 scm_c_issue_deprecation_warning ("`scm_make_module' is deprecated. "
279 "Use `scm_c_define_module instead.");
281 return scm_call_2 (SCM_VARIABLE_REF (make_modules_in_var
),
282 scm_the_root_module (),
283 scm_module_full_name (name
));
287 scm_ensure_user_module (SCM module
)
289 init_module_stuff ();
290 scm_c_issue_deprecation_warning ("`scm_ensure_user_module' is deprecated. "
291 "Use `scm_c_define_module instead.");
293 scm_call_1 (SCM_VARIABLE_REF (beautify_user_module_x_var
), module
);
294 return SCM_UNSPECIFIED
;
298 scm_load_scheme_module (SCM name
)
300 init_module_stuff ();
301 scm_c_issue_deprecation_warning ("`scm_load_scheme_module' is deprecated. "
302 "Use `scm_c_resolve_module instead.");
304 return scm_call_1 (SCM_VARIABLE_REF (try_module_autoload_var
), name
);
307 /* This is implemented in C solely for SCM_COERCE_OUTPORT ... */
310 maybe_close_port (void *data
, SCM port
)
312 SCM except_set
= (SCM
) data
;
314 while (!scm_is_null (except_set
))
316 SCM p
= SCM_COERCE_OUTPORT (SCM_CAR (except_set
));
317 if (scm_is_eq (p
, port
))
319 except_set
= SCM_CDR (except_set
);
322 scm_close_port (port
);
325 SCM_DEFINE (scm_close_all_ports_except
, "close-all-ports-except", 0, 0, 1,
327 "[DEPRECATED] Close all open file ports used by the interpreter\n"
328 "except for those supplied as arguments. This procedure\n"
329 "was intended to be used before an exec call to close file descriptors\n"
330 "which are not needed in the new process. However it has the\n"
331 "undesirable side effect of flushing buffers, so it's deprecated.\n"
332 "Use port-for-each instead.")
333 #define FUNC_NAME s_scm_close_all_ports_except
336 SCM_VALIDATE_REST_ARGUMENT (ports
);
338 for (p
= ports
; !scm_is_null (p
); p
= SCM_CDR (p
))
339 SCM_VALIDATE_OPPORT (SCM_ARG1
, SCM_COERCE_OUTPORT (SCM_CAR (p
)));
341 scm_c_port_for_each (maybe_close_port
, ports
);
343 return SCM_UNSPECIFIED
;
347 SCM_DEFINE (scm_variable_set_name_hint
, "variable-set-name-hint!", 2, 0, 0,
349 "Do not use this function.")
350 #define FUNC_NAME s_scm_variable_set_name_hint
352 SCM_VALIDATE_VARIABLE (1, var
);
353 SCM_VALIDATE_SYMBOL (2, hint
);
354 scm_c_issue_deprecation_warning
355 ("'variable-set-name-hint!' is deprecated. Do not use it.");
356 return SCM_UNSPECIFIED
;
360 SCM_DEFINE (scm_builtin_variable
, "builtin-variable", 1, 0, 0,
362 "Do not use this function.")
363 #define FUNC_NAME s_scm_builtin_variable
365 SCM_VALIDATE_SYMBOL (1,name
);
366 scm_c_issue_deprecation_warning ("`builtin-variable' is deprecated. "
367 "Use module system operations instead.");
368 return scm_sym2var (name
, SCM_BOOL_F
, SCM_BOOL_T
);
373 scm_makstr (size_t len
, int dummy
)
375 scm_c_issue_deprecation_warning
376 ("'scm_makstr' is deprecated. Use 'scm_c_make_string' instead.");
377 return scm_c_make_string (len
, SCM_UNDEFINED
);
381 scm_makfromstr (const char *src
, size_t len
, int dummy SCM_UNUSED
)
383 scm_c_issue_deprecation_warning ("`scm_makfromstr' is deprecated. "
384 "Use `scm_from_locale_stringn' instead.");
386 return scm_from_locale_stringn (src
, len
);
390 scm_internal_with_fluids (SCM fluids
, SCM values
, SCM (*cproc
) (), void *cdata
)
392 scm_c_issue_deprecation_warning ("`scm_internal_with_fluids' is deprecated. "
393 "Use `scm_c_with_fluids' instead.");
395 return scm_c_with_fluids (fluids
, values
, cproc
, cdata
);
399 scm_make_gsubr (const char *name
, int req
, int opt
, int rst
, SCM (*fcn
)())
401 scm_c_issue_deprecation_warning
402 ("`scm_make_gsubr' is deprecated. Use `scm_c_define_gsubr' instead.");
404 return scm_c_define_gsubr (name
, req
, opt
, rst
, fcn
);
408 scm_make_gsubr_with_generic (const char *name
,
409 int req
, int opt
, int rst
,
410 SCM (*fcn
)(), SCM
*gf
)
412 scm_c_issue_deprecation_warning
413 ("`scm_make_gsubr_with_generic' is deprecated. "
414 "Use `scm_c_define_gsubr_with_generic' instead.");
416 return scm_c_define_gsubr_with_generic (name
, req
, opt
, rst
, fcn
, gf
);
420 scm_create_hook (const char *name
, int n_args
)
422 scm_c_issue_deprecation_warning
423 ("'scm_create_hook' is deprecated. "
424 "Use 'scm_make_hook' and 'scm_c_define' instead.");
426 SCM hook
= scm_make_hook (scm_from_int (n_args
));
427 scm_c_define (name
, hook
);
428 return scm_permanent_object (hook
);
432 SCM_DEFINE (scm_sloppy_memq
, "sloppy-memq", 2, 0, 0,
434 "This procedure behaves like @code{memq}, but does no type or error checking.\n"
435 "Its use is recommended only in writing Guile internals,\n"
436 "not for high-level Scheme programs.")
437 #define FUNC_NAME s_scm_sloppy_memq
439 scm_c_issue_deprecation_warning
440 ("'sloppy-memq' is deprecated. Use 'memq' instead.");
442 for(; scm_is_pair (lst
); lst
= SCM_CDR(lst
))
444 if (scm_is_eq (SCM_CAR (lst
), x
))
452 SCM_DEFINE (scm_sloppy_memv
, "sloppy-memv", 2, 0, 0,
454 "This procedure behaves like @code{memv}, but does no type or error checking.\n"
455 "Its use is recommended only in writing Guile internals,\n"
456 "not for high-level Scheme programs.")
457 #define FUNC_NAME s_scm_sloppy_memv
459 scm_c_issue_deprecation_warning
460 ("'sloppy-memv' is deprecated. Use 'memv' instead.");
462 for(; scm_is_pair (lst
); lst
= SCM_CDR(lst
))
464 if (! scm_is_false (scm_eqv_p (SCM_CAR (lst
), x
)))
472 SCM_DEFINE (scm_sloppy_member
, "sloppy-member", 2, 0, 0,
474 "This procedure behaves like @code{member}, but does no type or error checking.\n"
475 "Its use is recommended only in writing Guile internals,\n"
476 "not for high-level Scheme programs.")
477 #define FUNC_NAME s_scm_sloppy_member
479 scm_c_issue_deprecation_warning
480 ("'sloppy-member' is deprecated. Use 'member' instead.");
482 for(; scm_is_pair (lst
); lst
= SCM_CDR(lst
))
484 if (! scm_is_false (scm_equal_p (SCM_CAR (lst
), x
)))
491 SCM_SYMBOL (scm_end_of_file_key
, "end-of-file");
493 SCM_DEFINE (scm_read_and_eval_x
, "read-and-eval!", 0, 1, 0,
495 "Read a form from @var{port} (standard input by default), and evaluate it\n"
496 "(memoizing it in the process) in the top-level environment. If no data\n"
497 "is left to be read from @var{port}, an @code{end-of-file} error is\n"
499 #define FUNC_NAME s_scm_read_and_eval_x
503 scm_c_issue_deprecation_warning
504 ("'read-and-eval!' is deprecated. Use 'read' and 'eval' instead.");
506 form
= scm_read (port
);
507 if (SCM_EOF_OBJECT_P (form
))
508 scm_ithrow (scm_end_of_file_key
, SCM_EOL
, 1);
509 return scm_eval_x (form
, scm_current_module ());
514 scm_make_subr_opt (const char *name
, int type
, SCM (*fcn
) (), int set
)
516 scm_c_issue_deprecation_warning
517 ("`scm_make_subr_opt' is deprecated. Use `scm_c_make_subr' or "
518 "`scm_c_define_subr' instead.");
521 return scm_c_define_subr (name
, type
, fcn
);
523 return scm_c_make_subr (name
, type
, fcn
);
527 scm_make_subr (const char *name
, int type
, SCM (*fcn
) ())
529 scm_c_issue_deprecation_warning
530 ("`scm_make_subr' is deprecated. Use `scm_c_define_subr' instead.");
532 return scm_c_define_subr (name
, type
, fcn
);
536 scm_make_subr_with_generic (const char *name
, int type
, SCM (*fcn
) (), SCM
*gf
)
538 scm_c_issue_deprecation_warning
539 ("`scm_make_subr_with_generic' is deprecated. Use "
540 "`scm_c_define_subr_with_generic' instead.");
542 return scm_c_define_subr_with_generic (name
, type
, fcn
, gf
);
545 /* Call thunk(closure) underneath a top-level error handler.
546 * If an error occurs, pass the exitval through err_filter and return it.
547 * If no error occurs, return the value of thunk.
551 typedef int setjmp_type
;
553 typedef long setjmp_type
;
556 struct cce_handler_data
{
557 SCM (*err_filter
) ();
562 invoke_err_filter (void *d
, SCM tag
, SCM args
)
564 struct cce_handler_data
*data
= (struct cce_handler_data
*)d
;
565 return data
->err_filter (SCM_BOOL_F
, data
->closure
);
569 scm_call_catching_errors (SCM (*thunk
)(), SCM (*err_filter
)(), void *closure
)
571 scm_c_issue_deprecation_warning
572 ("'scm_call_catching_errors' is deprecated. "
573 "Use 'scm_internal_catch' instead.");
576 struct cce_handler_data data
;
577 data
.err_filter
= err_filter
;
578 data
.closure
= closure
;
579 return scm_internal_catch (SCM_BOOL_T
,
580 (scm_t_catch_body
)thunk
, closure
,
581 (scm_t_catch_handler
)invoke_err_filter
, &data
);
586 scm_make_smob_type_mfpe (char *name
, size_t size
,
588 size_t (*free
) (SCM
),
589 int (*print
) (SCM
, SCM
, scm_print_state
*),
590 SCM (*equalp
) (SCM
, SCM
))
592 scm_c_issue_deprecation_warning
593 ("'scm_make_smob_type_mfpe' is deprecated. "
594 "Use 'scm_make_smob_type' plus 'scm_set_smob_*' instead.");
597 long answer
= scm_make_smob_type (name
, size
);
598 scm_set_smob_mfpe (answer
, mark
, free
, print
, equalp
);
604 scm_set_smob_mfpe (long tc
,
606 size_t (*free
) (SCM
),
607 int (*print
) (SCM
, SCM
, scm_print_state
*),
608 SCM (*equalp
) (SCM
, SCM
))
610 scm_c_issue_deprecation_warning
611 ("'scm_set_smob_mfpe' is deprecated. "
612 "Use 'scm_set_smob_mark' instead, for example.");
614 if (mark
) scm_set_smob_mark (tc
, mark
);
615 if (free
) scm_set_smob_free (tc
, free
);
616 if (print
) scm_set_smob_print (tc
, print
);
617 if (equalp
) scm_set_smob_equalp (tc
, equalp
);
621 scm_smob_free (SCM obj
)
623 long n
= SCM_SMOBNUM (obj
);
625 scm_c_issue_deprecation_warning
626 ("`scm_smob_free' is deprecated. "
627 "It is no longer needed.");
629 if (scm_smobs
[n
].size
> 0)
630 scm_gc_free ((void *) SCM_CELL_WORD_1 (obj
),
631 scm_smobs
[n
].size
, SCM_SMOBNAME (n
));
636 scm_read_0str (char *expr
)
638 scm_c_issue_deprecation_warning
639 ("scm_read_0str is deprecated. Use scm_c_read_string instead.");
641 return scm_c_read_string (expr
);
645 scm_eval_0str (const char *expr
)
647 scm_c_issue_deprecation_warning
648 ("scm_eval_0str is deprecated. Use scm_c_eval_string instead.");
650 return scm_c_eval_string (expr
);
654 scm_strprint_obj (SCM obj
)
656 scm_c_issue_deprecation_warning
657 ("scm_strprint_obj is deprecated. Use scm_object_to_string instead.");
658 return scm_object_to_string (obj
, SCM_UNDEFINED
);
662 scm_i_object_chars (SCM obj
)
664 scm_c_issue_deprecation_warning
665 ("SCM_CHARS is deprecated. See the manual for alternatives.");
666 if (SCM_STRINGP (obj
))
667 return SCM_STRING_CHARS (obj
);
668 if (SCM_SYMBOLP (obj
))
669 return SCM_SYMBOL_CHARS (obj
);
674 scm_i_object_length (SCM obj
)
676 scm_c_issue_deprecation_warning
677 ("SCM_LENGTH is deprecated. "
678 "Use scm_c_string_length instead, for example, or see the manual.");
679 if (SCM_STRINGP (obj
))
680 return SCM_STRING_LENGTH (obj
);
681 if (SCM_SYMBOLP (obj
))
682 return SCM_SYMBOL_LENGTH (obj
);
683 if (SCM_VECTORP (obj
))
684 return SCM_VECTOR_LENGTH (obj
);
689 scm_sym2ovcell_soft (SCM sym
, SCM obarray
)
692 size_t hash
= scm_i_symbol_hash (sym
) % SCM_VECTOR_LENGTH (obarray
);
694 scm_c_issue_deprecation_warning ("`scm_sym2ovcell_soft' is deprecated. "
695 "Use hashtables instead.");
697 SCM_CRITICAL_SECTION_START
;
698 for (lsym
= SCM_VECTOR_REF (obarray
, hash
);
700 lsym
= SCM_CDR (lsym
))
703 if (scm_is_eq (SCM_CAR (z
), sym
))
705 SCM_CRITICAL_SECTION_END
;
709 SCM_CRITICAL_SECTION_END
;
715 scm_sym2ovcell (SCM sym
, SCM obarray
)
716 #define FUNC_NAME "scm_sym2ovcell"
720 scm_c_issue_deprecation_warning ("`scm_sym2ovcell' is deprecated. "
721 "Use hashtables instead.");
723 answer
= scm_sym2ovcell_soft (sym
, obarray
);
724 if (scm_is_true (answer
))
726 SCM_MISC_ERROR ("uninterned symbol: ~S", scm_list_1 (sym
));
727 return SCM_UNSPECIFIED
; /* not reached */
732 /* Intern a symbol whose name is the LEN characters at NAME in OBARRAY.
734 OBARRAY should be a vector of lists, indexed by the name's hash
735 value, modulo OBARRAY's length. Each list has the form
736 ((SYMBOL . VALUE) ...), where SYMBOL is a symbol, and VALUE is the
737 value associated with that symbol (in the current module? in the
740 To "intern" a symbol means: if OBARRAY already contains a symbol by
741 that name, return its (SYMBOL . VALUE) pair; otherwise, create a
742 new symbol, add the pair (SYMBOL . SCM_UNDEFINED) to the
743 appropriate list of the OBARRAY, and return the pair.
745 If softness is non-zero, don't create a symbol if it isn't already
746 in OBARRAY; instead, just return #f.
748 If OBARRAY is SCM_BOOL_F, create a symbol listed in no obarray and
749 return (SYMBOL . SCM_UNDEFINED). */
753 intern_obarray_soft (SCM symbol
, SCM obarray
, unsigned int softness
)
755 size_t raw_hash
= scm_i_symbol_hash (symbol
);
759 if (scm_is_false (obarray
))
764 return scm_cons (symbol
, SCM_UNDEFINED
);
767 hash
= raw_hash
% SCM_VECTOR_LENGTH (obarray
);
769 for (lsym
= SCM_VECTOR_REF(obarray
, hash
);
770 SCM_NIMP (lsym
); lsym
= SCM_CDR (lsym
))
772 SCM a
= SCM_CAR (lsym
);
774 if (scm_is_eq (z
, symbol
))
784 SCM cell
= scm_cons (symbol
, SCM_UNDEFINED
);
785 SCM slot
= SCM_VECTOR_REF (obarray
, hash
);
787 SCM_VECTOR_SET (obarray
, hash
, scm_cons (cell
, slot
));
795 scm_intern_obarray_soft (const char *name
, size_t len
, SCM obarray
,
796 unsigned int softness
)
798 SCM symbol
= scm_from_locale_symboln (name
, len
);
800 scm_c_issue_deprecation_warning ("`scm_intern_obarray_soft' is deprecated. "
801 "Use hashtables instead.");
803 return intern_obarray_soft (symbol
, obarray
, softness
);
807 scm_intern_obarray (const char *name
,size_t len
,SCM obarray
)
809 scm_c_issue_deprecation_warning ("`scm_intern_obarray' is deprecated. "
810 "Use hashtables instead.");
812 return scm_intern_obarray_soft (name
, len
, obarray
, 0);
815 /* Lookup the value of the symbol named by the nul-terminated string
816 NAME in the current module. */
818 scm_symbol_value0 (const char *name
)
820 scm_c_issue_deprecation_warning ("`scm_symbol_value0' is deprecated. "
821 "Use `scm_lookup' instead.");
823 return scm_variable_ref (scm_c_lookup (name
));
826 SCM_DEFINE (scm_string_to_obarray_symbol
, "string->obarray-symbol", 2, 1, 0,
827 (SCM o
, SCM s
, SCM softp
),
828 "Intern a new symbol in @var{obarray}, a symbol table, with name\n"
830 "If @var{obarray} is @code{#f}, use the default system symbol table. If\n"
831 "@var{obarray} is @code{#t}, the symbol should not be interned in any\n"
832 "symbol table; merely return the pair (@var{symbol}\n"
833 ". @var{#<undefined>}).\n\n"
834 "The @var{soft?} argument determines whether new symbol table entries\n"
835 "should be created when the specified symbol is not already present in\n"
836 "@var{obarray}. If @var{soft?} is specified and is a true value, then\n"
837 "new entries should not be added for symbols not already present in the\n"
838 "table; instead, simply return @code{#f}.")
839 #define FUNC_NAME s_scm_string_to_obarray_symbol
845 SCM_VALIDATE_STRING (2, s
);
846 SCM_ASSERT (scm_is_bool (o
) || SCM_VECTORP (o
), o
, SCM_ARG1
, FUNC_NAME
);
848 scm_c_issue_deprecation_warning ("`string->obarray-symbol' is deprecated. "
849 "Use hashtables instead.");
851 softness
= (!SCM_UNBNDP (softp
) && scm_is_true(softp
));
852 /* iron out some screwy calling conventions */
853 if (scm_is_false (o
))
855 /* nothing interesting to do here. */
856 return scm_string_to_symbol (s
);
858 else if (scm_is_eq (o
, SCM_BOOL_T
))
861 vcell
= intern_obarray_soft (scm_string_to_symbol (s
), o
, softness
);
862 if (scm_is_false (vcell
))
864 answer
= SCM_CAR (vcell
);
869 SCM_DEFINE (scm_intern_symbol
, "intern-symbol", 2, 0, 0,
871 "Add a new symbol to @var{obarray} with name @var{string}, bound to an\n"
872 "unspecified initial value. The symbol table is not modified if a symbol\n"
873 "with this name is already present.")
874 #define FUNC_NAME s_scm_intern_symbol
877 SCM_VALIDATE_SYMBOL (2,s
);
878 if (scm_is_false (o
))
879 return SCM_UNSPECIFIED
;
881 scm_c_issue_deprecation_warning ("`intern-symbol' is deprecated. "
882 "Use hashtables instead.");
884 SCM_VALIDATE_VECTOR (1,o
);
885 hval
= scm_i_symbol_hash (s
) % SCM_VECTOR_LENGTH (o
);
886 /* If the symbol is already interned, simply return. */
887 SCM_CRITICAL_SECTION_START
;
891 for (lsym
= SCM_VECTOR_REF (o
, hval
);
893 lsym
= SCM_CDR (lsym
))
895 sym
= SCM_CAR (lsym
);
896 if (scm_is_eq (SCM_CAR (sym
), s
))
898 SCM_CRITICAL_SECTION_END
;
899 return SCM_UNSPECIFIED
;
902 SCM_VECTOR_SET (o
, hval
,
903 scm_acons (s
, SCM_UNDEFINED
,
904 SCM_VECTOR_REF (o
, hval
)));
906 SCM_CRITICAL_SECTION_END
;
907 return SCM_UNSPECIFIED
;
911 SCM_DEFINE (scm_unintern_symbol
, "unintern-symbol", 2, 0, 0,
913 "Remove the symbol with name @var{string} from @var{obarray}. This\n"
914 "function returns @code{#t} if the symbol was present and @code{#f}\n"
916 #define FUNC_NAME s_scm_unintern_symbol
920 scm_c_issue_deprecation_warning ("`unintern-symbol' is deprecated. "
921 "Use hashtables instead.");
923 SCM_VALIDATE_SYMBOL (2,s
);
924 if (scm_is_false (o
))
926 SCM_VALIDATE_VECTOR (1,o
);
927 hval
= scm_i_symbol_hash (s
) % SCM_VECTOR_LENGTH (o
);
928 SCM_CRITICAL_SECTION_START
;
933 for (lsym
= SCM_VECTOR_REF (o
, hval
), lsym_follow
= SCM_BOOL_F
;
935 lsym_follow
= lsym
, lsym
= SCM_CDR (lsym
))
937 sym
= SCM_CAR (lsym
);
938 if (scm_is_eq (SCM_CAR (sym
), s
))
940 /* Found the symbol to unintern. */
941 if (scm_is_false (lsym_follow
))
942 SCM_VECTOR_SET (o
, hval
, lsym
);
944 SCM_SETCDR (lsym_follow
, SCM_CDR(lsym
));
945 SCM_CRITICAL_SECTION_END
;
950 SCM_CRITICAL_SECTION_END
;
955 SCM_DEFINE (scm_symbol_binding
, "symbol-binding", 2, 0, 0,
957 "Look up in @var{obarray} the symbol whose name is @var{string}, and\n"
958 "return the value to which it is bound. If @var{obarray} is @code{#f},\n"
959 "use the global symbol table. If @var{string} is not interned in\n"
960 "@var{obarray}, an error is signalled.")
961 #define FUNC_NAME s_scm_symbol_binding
965 scm_c_issue_deprecation_warning ("`symbol-binding' is deprecated. "
966 "Use hashtables instead.");
968 SCM_VALIDATE_SYMBOL (2,s
);
969 if (scm_is_false (o
))
970 return scm_variable_ref (scm_lookup (s
));
971 SCM_VALIDATE_VECTOR (1,o
);
972 vcell
= scm_sym2ovcell (s
, o
);
973 return SCM_CDR(vcell
);
978 SCM_DEFINE (scm_symbol_interned_p
, "symbol-interned?", 2, 0, 0,
980 "Return @code{#t} if @var{obarray} contains a symbol with name\n"
981 "@var{string}, and @code{#f} otherwise.")
982 #define FUNC_NAME s_scm_symbol_interned_p
986 scm_c_issue_deprecation_warning ("`symbol-interned?' is deprecated. "
987 "Use hashtables instead.");
989 SCM_VALIDATE_SYMBOL (2,s
);
990 if (scm_is_false (o
))
992 SCM var
= scm_sym2var (s
, SCM_BOOL_F
, SCM_BOOL_F
);
993 if (var
!= SCM_BOOL_F
)
997 SCM_VALIDATE_VECTOR (1,o
);
998 vcell
= scm_sym2ovcell_soft (s
, o
);
999 return (SCM_NIMP(vcell
)
1006 SCM_DEFINE (scm_symbol_bound_p
, "symbol-bound?", 2, 0, 0,
1008 "Return @code{#t} if @var{obarray} contains a symbol with name\n"
1009 "@var{string} bound to a defined value. This differs from\n"
1010 "@var{symbol-interned?} in that the mere mention of a symbol\n"
1011 "usually causes it to be interned; @code{symbol-bound?}\n"
1012 "determines whether a symbol has been given any meaningful\n"
1014 #define FUNC_NAME s_scm_symbol_bound_p
1018 scm_c_issue_deprecation_warning ("`symbol-bound?' is deprecated. "
1019 "Use hashtables instead.");
1021 SCM_VALIDATE_SYMBOL (2,s
);
1022 if (scm_is_false (o
))
1024 SCM var
= scm_sym2var (s
, SCM_BOOL_F
, SCM_BOOL_F
);
1025 if (SCM_VARIABLEP(var
) && !SCM_UNBNDP(SCM_VARIABLE_REF(var
)))
1029 SCM_VALIDATE_VECTOR (1,o
);
1030 vcell
= scm_sym2ovcell_soft (s
, o
);
1031 return scm_from_bool (SCM_NIMP (vcell
) && !SCM_UNBNDP (SCM_CDR (vcell
)));
1036 SCM_DEFINE (scm_symbol_set_x
, "symbol-set!", 3, 0, 0,
1037 (SCM o
, SCM s
, SCM v
),
1038 "Find the symbol in @var{obarray} whose name is @var{string}, and rebind\n"
1039 "it to @var{value}. An error is signalled if @var{string} is not present\n"
1040 "in @var{obarray}.")
1041 #define FUNC_NAME s_scm_symbol_set_x
1045 scm_c_issue_deprecation_warning ("`symbol-set!' is deprecated. "
1046 "Use the module system instead.");
1048 SCM_VALIDATE_SYMBOL (2,s
);
1049 if (scm_is_false (o
))
1052 return SCM_UNSPECIFIED
;
1054 SCM_VALIDATE_VECTOR (1,o
);
1055 vcell
= scm_sym2ovcell (s
, o
);
1056 SCM_SETCDR (vcell
, v
);
1057 return SCM_UNSPECIFIED
;
1061 #define MAX_PREFIX_LENGTH 30
1063 static int gentemp_counter
;
1065 SCM_DEFINE (scm_gentemp
, "gentemp", 0, 2, 0,
1066 (SCM prefix
, SCM obarray
),
1067 "Create a new symbol with a name unique in an obarray.\n"
1068 "The name is constructed from an optional string @var{prefix}\n"
1069 "and a counter value. The default prefix is @code{t}. The\n"
1070 "@var{obarray} is specified as a second optional argument.\n"
1071 "Default is the system obarray where all normal symbols are\n"
1072 "interned. The counter is increased by 1 at each\n"
1073 "call. There is no provision for resetting the counter.")
1074 #define FUNC_NAME s_scm_gentemp
1076 char buf
[MAX_PREFIX_LENGTH
+ SCM_INTBUFLEN
];
1081 scm_c_issue_deprecation_warning ("`gentemp' is deprecated. "
1082 "Use `gensym' instead.");
1084 if (SCM_UNBNDP (prefix
))
1091 SCM_VALIDATE_STRING (1, prefix
);
1092 len
= scm_i_string_length (prefix
);
1093 name
= scm_to_locale_stringn (prefix
, &len
);
1094 name
= scm_realloc (name
, len
+ SCM_INTBUFLEN
);
1097 if (SCM_UNBNDP (obarray
))
1098 return scm_gensym (prefix
);
1100 SCM_ASSERT ((scm_is_vector (obarray
) || SCM_I_WVECTP (obarray
)),
1105 n_digits
= scm_iint2str (gentemp_counter
++, 10, &name
[len
]);
1106 while (scm_is_true (scm_intern_obarray_soft (name
,
1111 SCM vcell
= scm_intern_obarray_soft (name
,
1117 return SCM_CAR (vcell
);
1123 scm_i_makinum (scm_t_signed_bits val
)
1125 scm_c_issue_deprecation_warning
1126 ("SCM_MAKINUM is deprecated. Use scm_from_int or similar instead.");
1127 return SCM_I_MAKINUM (val
);
1131 scm_i_inump (SCM obj
)
1133 scm_c_issue_deprecation_warning
1134 ("SCM_INUMP is deprecated. Use scm_is_integer or similar instead.");
1135 return SCM_I_INUMP (obj
);
1139 scm_i_inum (SCM obj
)
1141 scm_c_issue_deprecation_warning
1142 ("SCM_INUM is deprecated. Use scm_to_int or similar instead.");
1143 return scm_to_intmax (obj
);
1147 scm_c_string2str (SCM obj
, char *str
, size_t *lenp
)
1149 scm_c_issue_deprecation_warning
1150 ("scm_c_string2str is deprecated. Use scm_to_locale_stringbuf or similar instead.");
1154 char *result
= scm_to_locale_string (obj
);
1156 *lenp
= scm_i_string_length (obj
);
1161 /* Pray that STR is large enough.
1163 size_t len
= scm_to_locale_stringbuf (obj
, str
, SCM_I_SIZE_MAX
);
1172 scm_c_substring2str (SCM obj
, char *str
, size_t start
, size_t len
)
1174 scm_c_issue_deprecation_warning
1175 ("scm_c_substring2str is deprecated. Use scm_substring plus scm_to_locale_stringbuf instead.");
1178 obj
= scm_substring (obj
, scm_from_size_t (start
), SCM_UNDEFINED
);
1180 scm_to_locale_stringbuf (obj
, str
, len
);
1184 /* Converts the given Scheme symbol OBJ into a C string, containing a copy
1185 of OBJ's content with a trailing null byte. If LENP is non-NULL, set
1186 *LENP to the string's length.
1188 When STR is non-NULL it receives the copy and is returned by the function,
1189 otherwise new memory is allocated and the caller is responsible for
1190 freeing it via free(). If out of memory, NULL is returned.
1192 Note that Scheme symbols may contain arbitrary data, including null
1193 characters. This means that null termination is not a reliable way to
1194 determine the length of the returned value. However, the function always
1195 copies the complete contents of OBJ, and sets *LENP to the length of the
1196 scheme symbol (if LENP is non-null). */
1198 scm_c_symbol2str (SCM obj
, char *str
, size_t *lenp
)
1200 return scm_c_string2str (scm_symbol_to_string (obj
), str
, lenp
);
1204 scm_truncate (double x
)
1206 scm_c_issue_deprecation_warning
1207 ("scm_truncate is deprecated. Use scm_c_truncate instead.");
1208 return scm_c_truncate (x
);
1212 scm_round (double x
)
1214 scm_c_issue_deprecation_warning
1215 ("scm_round is deprecated. Use scm_c_round instead.");
1216 return scm_c_round (x
);
1220 scm_sys_expt (SCM x
, SCM y
)
1222 scm_c_issue_deprecation_warning
1223 ("scm_sys_expt is deprecated. Use scm_expt instead.");
1224 return scm_expt (x
, y
);
1228 scm_asinh (double x
)
1230 scm_c_issue_deprecation_warning
1231 ("scm_asinh is deprecated. Use asinh instead.");
1235 return log (x
+ sqrt (x
* x
+ 1));
1240 scm_acosh (double x
)
1242 scm_c_issue_deprecation_warning
1243 ("scm_acosh is deprecated. Use acosh instead.");
1247 return log (x
+ sqrt (x
* x
- 1));
1252 scm_atanh (double x
)
1254 scm_c_issue_deprecation_warning
1255 ("scm_atanh is deprecated. Use atanh instead.");
1259 return 0.5 * log ((1 + x
) / (1 - x
));
1264 scm_sys_atan2 (SCM z1
, SCM z2
)
1266 scm_c_issue_deprecation_warning
1267 ("scm_sys_atan2 is deprecated. Use scm_atan instead.");
1268 return scm_atan (z1
, z2
);
1272 scm_i_deprecated_symbol_chars (SCM sym
)
1274 scm_c_issue_deprecation_warning
1275 ("SCM_SYMBOL_CHARS is deprecated. Use scm_symbol_to_string.");
1277 return (char *)scm_i_symbol_chars (sym
);
1281 scm_i_deprecated_symbol_length (SCM sym
)
1283 scm_c_issue_deprecation_warning
1284 ("SCM_SYMBOL_LENGTH is deprecated. Use scm_symbol_to_string.");
1285 return scm_i_symbol_length (sym
);
1289 scm_i_keywordp (SCM obj
)
1291 scm_c_issue_deprecation_warning
1292 ("SCM_KEYWORDP is deprecated. Use scm_is_keyword instead.");
1293 return scm_is_keyword (obj
);
1297 scm_i_keywordsym (SCM keyword
)
1299 scm_c_issue_deprecation_warning
1300 ("SCM_KEYWORDSYM is deprecated. See scm_keyword_to_symbol instead.");
1301 return scm_keyword_dash_symbol (keyword
);
1305 scm_i_vectorp (SCM x
)
1307 scm_c_issue_deprecation_warning
1308 ("SCM_VECTORP is deprecated. Use scm_is_vector instead.");
1309 return SCM_I_IS_VECTOR (x
);
1313 scm_i_vector_length (SCM x
)
1315 scm_c_issue_deprecation_warning
1316 ("SCM_VECTOR_LENGTH is deprecated. Use scm_c_vector_length instead.");
1317 return SCM_I_VECTOR_LENGTH (x
);
1323 scm_c_issue_deprecation_warning
1324 ("SCM_VELTS is deprecated. Use scm_vector_elements instead.");
1325 return SCM_I_VECTOR_ELTS (x
);
1329 scm_i_writable_velts (SCM x
)
1331 scm_c_issue_deprecation_warning
1332 ("SCM_WRITABLE_VELTS is deprecated. "
1333 "Use scm_vector_writable_elements instead.");
1334 return SCM_I_VECTOR_WELTS (x
);
1338 scm_i_vector_ref (SCM x
, size_t idx
)
1340 scm_c_issue_deprecation_warning
1341 ("SCM_VECTOR_REF is deprecated. "
1342 "Use scm_c_vector_ref or scm_vector_elements instead.");
1343 return scm_c_vector_ref (x
, idx
);
1347 scm_i_vector_set (SCM x
, size_t idx
, SCM val
)
1349 scm_c_issue_deprecation_warning
1350 ("SCM_VECTOR_SET is deprecated. "
1351 "Use scm_c_vector_set_x or scm_vector_writable_elements instead.");
1352 scm_c_vector_set_x (x
, idx
, val
);
1356 scm_vector_equal_p (SCM x
, SCM y
)
1358 scm_c_issue_deprecation_warning
1359 ("scm_vector_euqal_p is deprecated. "
1360 "Use scm_equal_p instead.");
1361 return scm_equal_p (x
, y
);
1365 scm_i_arrayp (SCM a
)
1367 scm_c_issue_deprecation_warning
1368 ("SCM_ARRAYP is deprecated. Use scm_is_array instead.");
1369 return SCM_I_ARRAYP(a
);
1373 scm_i_array_ndim (SCM a
)
1375 scm_c_issue_deprecation_warning
1376 ("SCM_ARRAY_NDIM is deprecated. "
1377 "Use scm_c_array_rank or scm_array_handle_rank instead.");
1378 return scm_c_array_rank (a
);
1382 scm_i_array_contp (SCM a
)
1384 scm_c_issue_deprecation_warning
1385 ("SCM_ARRAY_CONTP is deprecated. Do not use it.");
1386 return SCM_I_ARRAY_CONTP (a
);
1390 scm_i_array_mem (SCM a
)
1392 scm_c_issue_deprecation_warning
1393 ("SCM_ARRAY_MEM is deprecated. Do not use it.");
1394 return (scm_t_array
*)SCM_I_ARRAY_MEM (a
);
1398 scm_i_array_v (SCM a
)
1400 /* We could use scm_shared_array_root here, but it is better to move
1401 them away from expecting vectors as the basic storage for arrays.
1403 scm_c_issue_deprecation_warning
1404 ("SCM_ARRAY_V is deprecated. Do not use it.");
1405 return SCM_I_ARRAY_V (a
);
1409 scm_i_array_base (SCM a
)
1411 scm_c_issue_deprecation_warning
1412 ("SCM_ARRAY_BASE is deprecated. Do not use it.");
1413 return SCM_I_ARRAY_BASE (a
);
1417 scm_i_array_dims (SCM a
)
1419 scm_c_issue_deprecation_warning
1420 ("SCM_ARRAY_DIMS is deprecated. Use scm_array_handle_dims instead.");
1421 return SCM_I_ARRAY_DIMS (a
);
1425 scm_i_cur_inp (void)
1427 scm_c_issue_deprecation_warning
1428 ("scm_cur_inp is deprecated. Use scm_current_input_port instead.");
1429 return scm_current_input_port ();
1433 scm_i_cur_outp (void)
1435 scm_c_issue_deprecation_warning
1436 ("scm_cur_outp is deprecated. Use scm_current_output_port instead.");
1437 return scm_current_output_port ();
1441 scm_i_cur_errp (void)
1443 scm_c_issue_deprecation_warning
1444 ("scm_cur_errp is deprecated. Use scm_current_error_port instead.");
1445 return scm_current_error_port ();
1449 scm_i_cur_loadp (void)
1451 scm_c_issue_deprecation_warning
1452 ("scm_cur_loadp is deprecated. Use scm_current_load_port instead.");
1453 return scm_current_load_port ();
1457 scm_i_progargs (void)
1459 scm_c_issue_deprecation_warning
1460 ("scm_progargs is deprecated. Use scm_program_arguments instead.");
1461 return scm_program_arguments ();
1465 scm_i_deprecated_dynwinds (void)
1467 scm_c_issue_deprecation_warning
1468 ("scm_dynwinds is deprecated. Do not use it.");
1469 return scm_i_dynwinds ();
1473 scm_i_stack_base (void)
1475 scm_c_issue_deprecation_warning
1476 ("scm_stack_base is deprecated. Do not use it.");
1477 return SCM_I_CURRENT_THREAD
->base
;
1481 scm_i_fluidp (SCM x
)
1483 scm_c_issue_deprecation_warning
1484 ("SCM_FLUIDP is deprecated. Use scm_is_fluid instead.");
1485 return scm_is_fluid (x
);
1491 #ifdef HAVE_NETWORKING
1493 SCM_DEFINE (scm_inet_aton
, "inet-aton", 1, 0, 0,
1495 "Convert an IPv4 Internet address from printable string\n"
1496 "(dotted decimal notation) to an integer. E.g.,\n\n"
1498 "(inet-aton \"127.0.0.1\") @result{} 2130706433\n"
1500 #define FUNC_NAME s_scm_inet_aton
1502 scm_c_issue_deprecation_warning
1503 ("`inet-aton' is deprecated. Use `inet-pton' instead.");
1505 return scm_inet_pton (scm_from_int (AF_INET
), address
);
1510 SCM_DEFINE (scm_inet_ntoa
, "inet-ntoa", 1, 0, 0,
1512 "Convert an IPv4 Internet address to a printable\n"
1513 "(dotted decimal notation) string. E.g.,\n\n"
1515 "(inet-ntoa 2130706433) @result{} \"127.0.0.1\"\n"
1517 #define FUNC_NAME s_scm_inet_ntoa
1519 scm_c_issue_deprecation_warning
1520 ("`inet-ntoa' is deprecated. Use `inet-ntop' instead.");
1522 return scm_inet_ntop (scm_from_int (AF_INET
), inetid
);
1526 #endif /* HAVE_NETWORKING */
1530 scm_i_defer_ints_etc ()
1532 scm_c_issue_deprecation_warning
1533 ("SCM_DEFER_INTS etc are deprecated. "
1534 "Use a mutex instead if appropriate.");
1538 scm_i_mask_ints (void)
1540 scm_c_issue_deprecation_warning ("`scm_mask_ints' is deprecated.");
1541 return (SCM_I_CURRENT_THREAD
->block_asyncs
!= 0);
1546 scm_guard (SCM guardian
, SCM obj
, int throw_p
)
1548 scm_c_issue_deprecation_warning
1549 ("scm_guard is deprecated. Use scm_call_1 instead.");
1551 return scm_call_1 (guardian
, obj
);
1555 scm_get_one_zombie (SCM guardian
)
1557 scm_c_issue_deprecation_warning
1558 ("scm_guard is deprecated. Use scm_call_0 instead.");
1560 return scm_call_0 (guardian
);
1563 SCM_DEFINE (scm_guardian_destroyed_p
, "guardian-destroyed?", 1, 0, 0,
1565 "Return @code{#t} if @var{guardian} has been destroyed, otherwise @code{#f}.")
1566 #define FUNC_NAME s_scm_guardian_destroyed_p
1568 scm_c_issue_deprecation_warning
1569 ("'guardian-destroyed?' is deprecated.");
1574 SCM_DEFINE (scm_guardian_greedy_p
, "guardian-greedy?", 1, 0, 0,
1576 "Return @code{#t} if @var{guardian} is a greedy guardian, otherwise @code{#f}.")
1577 #define FUNC_NAME s_scm_guardian_greedy_p
1579 scm_c_issue_deprecation_warning
1580 ("'guardian-greedy?' is deprecated.");
1585 SCM_DEFINE (scm_destroy_guardian_x
, "destroy-guardian!", 1, 0, 0,
1587 "Destroys @var{guardian}, by making it impossible to put any more\n"
1588 "objects in it or get any objects from it. It also unguards any\n"
1589 "objects guarded by @var{guardian}.")
1590 #define FUNC_NAME s_scm_destroy_guardian_x
1592 scm_c_issue_deprecation_warning
1593 ("'destroy-guardian!' is deprecated and ineffective.");
1594 return SCM_UNSPECIFIED
;
1599 /* GC-related things. */
1601 unsigned long scm_mallocated
, scm_mtrigger
;
1602 size_t scm_max_segment_size
;
1604 #if defined (GUILE_DEBUG) || defined (GUILE_DEBUG_FREELIST)
1606 scm_map_free_list (void)
1612 #if defined (GUILE_DEBUG_FREELIST)
1614 scm_gc_set_debug_check_freelist_x (SCM flag
)
1616 return SCM_UNSPECIFIED
;
1623 * Trampolines were an intent to speed up calling the same Scheme procedure many
1626 * However, this was the wrong thing to optimize; if you really know what you're
1627 * calling, call its function directly, otherwise you're in Scheme-land, and we
1628 * have many better tricks there (inlining, for example, which can remove the
1629 * need for closures and free variables).
1631 * Also, in the normal debugging case, trampolines were being computed but not
1636 scm_trampoline_0 (SCM proc
)
1638 scm_c_issue_deprecation_warning
1639 ("`scm_trampoline_0' is deprecated. Just use `scm_call_0' instead.");
1644 scm_trampoline_1 (SCM proc
)
1646 scm_c_issue_deprecation_warning
1647 ("`scm_trampoline_1' is deprecated. Just use `scm_call_1' instead.");
1652 scm_trampoline_2 (SCM proc
)
1654 scm_c_issue_deprecation_warning
1655 ("`scm_trampoline_2' is deprecated. Just use `scm_call_2' instead.");
1661 scm_i_init_deprecated ()
1663 #include "libguile/deprecated.x"