GOOPS: Deprecate "using-class" procs like slot-ref-using-class
[bpt/guile.git] / libguile / deprecated.h
1 /* This file contains definitions for deprecated features. When you
2 deprecate something, move it here when that is feasible.
3 */
4
5 #ifndef SCM_DEPRECATED_H
6 #define SCM_DEPRECATED_H
7
8 /* Copyright (C) 2003,2004, 2005, 2006, 2007, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Free Software Foundation, Inc.
9 *
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public License
12 * as published by the Free Software Foundation; either version 3 of
13 * the License, or (at your option) any later version.
14 *
15 * This library is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23 * 02110-1301 USA
24 */
25
26 #include "libguile/__scm.h"
27 #include "libguile/strings.h"
28 #include "libguile/eval.h"
29 #include "libguile/throw.h"
30 #include "libguile/iselect.h"
31
32 #if (SCM_ENABLE_DEPRECATED == 1)
33
34 /* Deprecated 13-05-2011 because it's better just to scm_dynwind_begin.
35 That also avoids the temptation to stuff pointers in an SCM. */
36
37 typedef SCM (*scm_t_inner) (void *);
38 SCM_DEPRECATED SCM scm_internal_dynamic_wind (scm_t_guard before,
39 scm_t_inner inner,
40 scm_t_guard after,
41 void *inner_data,
42 void *guard_data);
43
44
45 /* Deprecated 15-05-2011 because it's better to be explicit with the
46 `return'. Code is more readable that way. */
47 #define SCM_WTA_DISPATCH_0(gf, subr) \
48 return scm_wta_dispatch_0 ((gf), (subr))
49 #define SCM_WTA_DISPATCH_1(gf, a1, pos, subr) \
50 return scm_wta_dispatch_1 ((gf), (a1), (pos), (subr))
51 #define SCM_WTA_DISPATCH_2(gf, a1, a2, pos, subr) \
52 return scm_wta_dispatch_2 ((gf), (a1), (a2), (pos), (subr))
53 #define SCM_WTA_DISPATCH_N(gf, args, pos, subr) \
54 return scm_wta_dispatch_n ((gf), (args), (pos), (subr))
55
56 /* Deprecated 15-05-2011 because this idiom is not very readable. */
57 #define SCM_GASSERT0(cond, gf, subr) \
58 if (SCM_UNLIKELY (!(cond))) \
59 return scm_wta_dispatch_0 ((gf), (subr))
60 #define SCM_GASSERT1(cond, gf, a1, pos, subr) \
61 if (SCM_UNLIKELY (!(cond))) \
62 return scm_wta_dispatch_1 ((gf), (a1), (pos), (subr))
63 #define SCM_GASSERT2(cond, gf, a1, a2, pos, subr) \
64 if (SCM_UNLIKELY (!(cond))) \
65 return scm_wta_dispatch_2 ((gf), (a1), (a2), (pos), (subr))
66 #define SCM_GASSERTn(cond, gf, args, pos, subr) \
67 if (SCM_UNLIKELY (!(cond))) \
68 return scm_wta_dispatch_n ((gf), (args), (pos), (subr))
69
70 /* Deprecated 15-05-2011 because this is a one-off macro that does
71 strange things. */
72 #define SCM_WTA_DISPATCH_1_SUBR(subr, a1, pos) \
73 return (SCM_UNPACK ((*SCM_SUBR_GENERIC (subr))) \
74 ? scm_call_1 ((*SCM_SUBR_GENERIC (subr)), (a1)) \
75 : (scm_i_wrong_type_arg_symbol (SCM_SUBR_NAME (subr), (pos), (a1)), SCM_UNSPECIFIED))
76
77 #define SCM_LIST0 SCM_EOL
78 #define SCM_LIST1(e0) scm_cons ((e0), SCM_EOL)
79 #define SCM_LIST2(e0, e1) scm_cons2 ((e0), (e1), SCM_EOL)
80 #define SCM_LIST3(e0, e1, e2) scm_cons ((e0), SCM_LIST2 ((e1), (e2)))
81 #define SCM_LIST4(e0, e1, e2, e3)\
82 scm_cons2 ((e0), (e1), SCM_LIST2 ((e2), (e3)))
83 #define SCM_LIST5(e0, e1, e2, e3, e4)\
84 scm_cons ((e0), SCM_LIST4 ((e1), (e2), (e3), (e4)))
85 #define SCM_LIST6(e0, e1, e2, e3, e4, e5)\
86 scm_cons2 ((e0), (e1), SCM_LIST4 ((e2), (e3), (e4), (e5)))
87 #define SCM_LIST7(e0, e1, e2, e3, e4, e5, e6)\
88 scm_cons ((e0), SCM_LIST6 ((e1), (e2), (e3), (e4), (e5), (e6)))
89 #define SCM_LIST8(e0, e1, e2, e3, e4, e5, e6, e7)\
90 scm_cons2 ((e0), (e1), SCM_LIST6 ((e2), (e3), (e4), (e5), (e6), (e7)))
91 #define SCM_LIST9(e0, e1, e2, e3, e4, e5, e6, e7, e8)\
92 scm_cons ((e0),\
93 SCM_LIST8 ((e1), (e2), (e3), (e4), (e5), (e6), (e7), (e8)))
94
95 #define SCM_CHAR_CODE_LIMIT SCM_CHAR_CODE_LIMIT__GONE__REPLACE_WITH__256L
96 #define SCM_OPDIRP SCM_OPDIRP__GONE__REPLACE_WITH__SCM_DIRP_and_SCM_DIR_OPEN_P
97 #define SCM_PROCEDURE SCM_PROCEDURE__GONE__REPLACE_WITH__scm_procedure
98 #define SCM_PROCEDURE_WITH_SETTER_P SCM_PROCEDURE_WITH_SETTER_P__GONE__REPLACE_WITH__scm_is_true__scm_procedure_with_setter_p
99 #define SCM_SETTER SCM_SETTER__GONE__REPLACE_WITH__scm_setter
100 #define SCM_THREAD_SWITCHING_CODE SCM_THREAD_SWITCHING_CODE__GONE__REMOVE_FROM_YOUR_CODE
101 #define SCM_VALIDATE_NUMBER_COPY SCM_VALIDATE_NUMBER_COPY__GONE__REPLACE_WITH__SCM_VALIDATE_DOUBLE_COPY
102 #define SCM_VALIDATE_NUMBER_DEF_COPY SCM_VALIDATE_NUMBER_DEF_COPY__GONE__REPLACE_WITH__SCM_UNBNDP_and_SCM_VALIDATE_DOUBLE_COPY
103 #define SCM_VALIDATE_OPDIR SCM_VALIDATE_OPDIR__GONE
104 #define SCM_VALIDATE_STRING_COPY SCM_VALIDATE_STRING_COPY__GONE
105 #define SCM_VALIDATE_SUBSTRING_SPEC_COPY SCM_VALIDATE_SUBSTRING_SPEC_COPY__GONE
106 #define scm_array scm_array__GONE__REPLACE_WITH__scm_t_array
107 #define scm_array_dim scm_array_dim__GONE__REPLACE_WITH__scm_t_array_dim
108 #define scm_async_click scm_async_click__GONE__REPLACE_WITH__scm_async_tick
109 #define scm_call_generic_0 scm_call_generic_0__GONE__REPLACE_WITH__scm_call_0
110 #define scm_call_generic_1 scm_call_generic_1__GONE__REPLACE_WITH__scm_call_1
111 #define scm_call_generic_2 scm_call_generic_2__GONE__REPLACE_WITH__scm_call_2
112 #define scm_call_generic_3 scm_call_generic_3__GONE__REPLACE_WITH__scm_call_3
113 #define scm_apply_generic scm_apply_generic__GONE__REPLACE_WITH__scm_apply_0
114 #define scm_fport scm_fport__GONE__REPLACE_WITH__scm_t_fport
115 #define scm_listify scm_listify__GONE__REPLACE_WITH__scm_list_n
116 #define scm_option scm_option__GONE__REPLACE_WITH__scm_t_option
117 #define scm_port scm_port__GONE__REPLACE_WITH__scm_t_port
118 #define scm_port_rw_active scm_port_rw_active__GONE__REPLACE_WITH__scm_t_port_rw_active
119 #define scm_ptob_descriptor scm_ptob_descriptor__GONE__REPLACE_WITH__scm_t_ptob_descriptor
120 #define scm_rng scm_rng__GONE__REPLACE_WITH__scm_t_rng
121 #define scm_rstate scm_rstate__GONE__REPLACE_WITH__scm_t_rstate
122 #define scm_sizet scm_sizet__GONE__REPLACE_WITH__size_t
123 #define scm_srcprops scm_srcprops__GONE__REPLACE_WITH__scm_t_srcprops
124 #define scm_srcprops_chunk scm_srcprops_chunk__GONE__REPLACE_WITH__scm_t_srcprops_chunk
125 #define scm_struct_i_flags scm_struct_i_flags__GONE__REPLACE_WITH__scm_vtable_index_flags
126 #define scm_struct_i_free scm_struct_i_free__GONE__REPLACE_WITH__scm_vtable_index_instance_finalize
127 #define scm_subr_entry scm_subr_entry__GONE__REPLACE_WITH__scm_t_subr_entry
128 #define scm_substring_move_left_x scm_substring_move_left_x__GONE__REPLACE_WITH__scm_substring_move_x
129 #define scm_substring_move_right_x scm_substring_move_right_x__GONE__REPLACE_WITH__scm_substring_move_x
130 #define scm_vtable_index_printer scm_vtable_index_printer__GONE__REPLACE_WITH__scm_vtable_index_instance_printer
131 #define scm_vtable_index_vtable scm_vtable_index_vtable__GONE__REPLACE_WITH__scm_vtable_index_self
132
133 #ifndef BUILDING_LIBGUILE
134 #define SCM_ASYNC_TICK SCM_ASYNC_TICK__GONE__REPLACE_WITH__scm_async_tick
135 #endif
136
137
138 \f
139
140 /* Deprecated 26-05-2011, as the GC_STUBBORN API doesn't do anything any
141 more. */
142 SCM_DEPRECATED SCM scm_immutable_cell (scm_t_bits car, scm_t_bits cdr);
143 SCM_DEPRECATED SCM scm_immutable_double_cell (scm_t_bits car, scm_t_bits cbr,
144 scm_t_bits ccr, scm_t_bits cdr);
145
146 \f
147
148 SCM_DEPRECATED SCM scm_memory_alloc_key;
149 SCM_DEPRECATED void scm_memory_error (const char *subr) SCM_NORETURN;
150
151 \f
152
153 SCM_DEPRECATED SCM scm_no_applicable_method;
154
155 SCM_DEPRECATED SCM scm_class_boolean;
156 SCM_DEPRECATED SCM scm_class_char;
157 SCM_DEPRECATED SCM scm_class_pair;
158 SCM_DEPRECATED SCM scm_class_procedure;
159 SCM_DEPRECATED SCM scm_class_string;
160 SCM_DEPRECATED SCM scm_class_symbol;
161 SCM_DEPRECATED SCM scm_class_primitive_generic;
162 SCM_DEPRECATED SCM scm_class_vector;
163 SCM_DEPRECATED SCM scm_class_null;
164 SCM_DEPRECATED SCM scm_class_real;
165 SCM_DEPRECATED SCM scm_class_complex;
166 SCM_DEPRECATED SCM scm_class_integer;
167 SCM_DEPRECATED SCM scm_class_fraction;
168 SCM_DEPRECATED SCM scm_class_unknown;
169 SCM_DEPRECATED SCM scm_class_top;
170 SCM_DEPRECATED SCM scm_class_object;
171 SCM_DEPRECATED SCM scm_class_class;
172 SCM_DEPRECATED SCM scm_class_applicable;
173 SCM_DEPRECATED SCM scm_class_applicable_struct;
174 SCM_DEPRECATED SCM scm_class_applicable_struct_with_setter;
175 SCM_DEPRECATED SCM scm_class_generic;
176 SCM_DEPRECATED SCM scm_class_generic_with_setter;
177 SCM_DEPRECATED SCM scm_class_accessor;
178 SCM_DEPRECATED SCM scm_class_extended_generic;
179 SCM_DEPRECATED SCM scm_class_extended_generic_with_setter;
180 SCM_DEPRECATED SCM scm_class_extended_accessor;
181 SCM_DEPRECATED SCM scm_class_method;
182 SCM_DEPRECATED SCM scm_class_accessor_method;
183 SCM_DEPRECATED SCM scm_class_procedure_class;
184 SCM_DEPRECATED SCM scm_class_applicable_struct_class;
185 SCM_DEPRECATED SCM scm_class_number;
186 SCM_DEPRECATED SCM scm_class_list;
187 SCM_DEPRECATED SCM scm_class_keyword;
188 SCM_DEPRECATED SCM scm_class_port;
189 SCM_DEPRECATED SCM scm_class_input_output_port;
190 SCM_DEPRECATED SCM scm_class_input_port;
191 SCM_DEPRECATED SCM scm_class_output_port;
192 SCM_DEPRECATED SCM scm_class_foreign_slot;
193 SCM_DEPRECATED SCM scm_class_self;
194 SCM_DEPRECATED SCM scm_class_protected;
195 SCM_DEPRECATED SCM scm_class_hidden;
196 SCM_DEPRECATED SCM scm_class_opaque;
197 SCM_DEPRECATED SCM scm_class_read_only;
198 SCM_DEPRECATED SCM scm_class_protected_hidden;
199 SCM_DEPRECATED SCM scm_class_protected_opaque;
200 SCM_DEPRECATED SCM scm_class_protected_read_only;
201 SCM_DEPRECATED SCM scm_class_scm;
202 SCM_DEPRECATED SCM scm_class_int;
203 SCM_DEPRECATED SCM scm_class_float;
204 SCM_DEPRECATED SCM scm_class_double;
205
206 SCM_DEPRECATED SCM *scm_port_class;
207 SCM_DEPRECATED SCM *scm_smob_class;
208
209 SCM_INTERNAL void scm_init_deprecated_goops (void);
210
211 SCM_DEPRECATED SCM scm_compute_applicable_methods (SCM gf, SCM args, long len, int scm_find_method);
212 SCM_DEPRECATED SCM scm_find_method (SCM l);
213 SCM_DEPRECATED SCM scm_basic_make_class (SCM c, SCM name, SCM dsupers, SCM dslots);
214 SCM_DEPRECATED SCM scm_get_keyword (SCM kw, SCM initargs, SCM default_value);
215 SCM_DEPRECATED SCM scm_slot_ref_using_class (SCM cls, SCM obj, SCM slot_name);
216 SCM_DEPRECATED SCM scm_slot_set_using_class_x (SCM cls, SCM obj, SCM slot_name, SCM value);
217 SCM_DEPRECATED SCM scm_slot_bound_using_class_p (SCM cls, SCM obj, SCM slot_name);
218 SCM_DEPRECATED SCM scm_slot_exists_using_class_p (SCM cls, SCM obj, SCM slot_name);
219
220 \f
221
222 void scm_i_init_deprecated (void);
223
224 #endif
225
226 #endif /* SCM_DEPRECATED_H */