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, 2010, 2011, 2012, 2013 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/deprecation.h"
32 #if (SCM_ENABLE_DEPRECATED == 1)
37 scm_internal_dynamic_wind (scm_t_guard before
,
45 scm_c_issue_deprecation_warning
46 ("`scm_internal_dynamic_wind' is deprecated. "
47 "Use the `scm_dynwind_begin' / `scm_dynwind_end' API instead.");
49 scm_dynwind_begin (SCM_F_DYNWIND_REWINDABLE
);
50 scm_dynwind_rewind_handler (before
, guard_data
, SCM_F_WIND_EXPLICITLY
);
51 scm_dynwind_unwind_handler (after
, guard_data
, SCM_F_WIND_EXPLICITLY
);
52 ans
= inner (inner_data
);
60 scm_immutable_cell (scm_t_bits car
, scm_t_bits cdr
)
62 scm_c_issue_deprecation_warning
63 ("scm_immutable_cell is deprecated. Use scm_cell instead.");
65 return scm_cell (car
, cdr
);
69 scm_immutable_double_cell (scm_t_bits car
, scm_t_bits cbr
,
70 scm_t_bits ccr
, scm_t_bits cdr
)
72 scm_c_issue_deprecation_warning
73 ("scm_immutable_double_cell is deprecated. Use scm_double_cell instead.");
75 return scm_double_cell (car
, cbr
, ccr
, cdr
);
82 SCM_DEFINE (scm_generalized_vector_p
, "generalized-vector?", 1, 0, 0,
84 "Return @code{#t} if @var{obj} is a vector, string,\n"
85 "bitvector, or uniform numeric vector.")
86 #define FUNC_NAME s_scm_generalized_vector_p
88 scm_c_issue_deprecation_warning
89 ("generalized-vector? is deprecated. Use array? and check the "
90 "array-rank instead.");
91 return scm_from_bool (scm_is_generalized_vector (obj
));
95 SCM_DEFINE (scm_generalized_vector_length
, "generalized-vector-length", 1, 0, 0,
97 "Return the length of the generalized vector @var{v}.")
98 #define FUNC_NAME s_scm_generalized_vector_length
100 scm_c_issue_deprecation_warning
101 ("generalized-vector-length is deprecated. Use array-length instead.");
102 return scm_from_size_t (scm_c_generalized_vector_length (v
));
106 SCM_DEFINE (scm_generalized_vector_ref
, "generalized-vector-ref", 2, 0, 0,
108 "Return the element at index @var{idx} of the\n"
109 "generalized vector @var{v}.")
110 #define FUNC_NAME s_scm_generalized_vector_ref
112 scm_c_issue_deprecation_warning
113 ("generalized-vector-ref is deprecated. Use array-ref instead.");
114 return scm_c_generalized_vector_ref (v
, scm_to_size_t (idx
));
118 SCM_DEFINE (scm_generalized_vector_set_x
, "generalized-vector-set!", 3, 0, 0,
119 (SCM v
, SCM idx
, SCM val
),
120 "Set the element at index @var{idx} of the\n"
121 "generalized vector @var{v} to @var{val}.")
122 #define FUNC_NAME s_scm_generalized_vector_set_x
124 scm_c_issue_deprecation_warning
125 ("generalized-vector-set! is deprecated. Use array-set! instead. "
126 "Note the change in argument order!");
127 scm_c_generalized_vector_set_x (v
, scm_to_size_t (idx
), val
);
128 return SCM_UNSPECIFIED
;
132 SCM_DEFINE (scm_generalized_vector_to_list
, "generalized-vector->list", 1, 0, 0,
134 "Return a new list whose elements are the elements of the\n"
135 "generalized vector @var{v}.")
136 #define FUNC_NAME s_scm_generalized_vector_to_list
138 /* FIXME: This duplicates `array_to_list'. */
142 scm_t_array_handle h
;
144 scm_c_issue_deprecation_warning
145 ("generalized-vector->list is deprecated. Use array->list instead.");
147 scm_generalized_vector_get_handle (v
, &h
);
149 i
= h
.dims
[0].ubnd
- h
.dims
[0].lbnd
+ 1;
153 for (; i
> 0; i
--, pos
-= inc
)
154 ret
= scm_cons (h
.impl
->vref (&h
, h
.base
+ pos
), ret
);
156 scm_array_handle_release (&h
);
165 scm_i_init_deprecated ()
167 #include "libguile/deprecated.x"