2008-09-13 15:35:27 +02:00
|
|
|
|
/* Copyright (C) 1995,1996,2000,2001, 2004, 2005, 2006, 2008 Free Software Foundation, Inc.
|
1996-07-25 22:56:11 +00:00
|
|
|
|
*
|
2003-04-05 19:15:35 +00:00
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
1996-07-25 22:56:11 +00:00
|
|
|
|
*
|
2003-04-05 19:15:35 +00:00
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
|
* Lesser General Public License for more details.
|
1996-07-25 22:56:11 +00:00
|
|
|
|
*
|
2003-04-05 19:15:35 +00:00
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2005-05-23 19:57:22 +00:00
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
2003-04-05 19:15:35 +00:00
|
|
|
|
*/
|
1999-12-12 02:36:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
2008-09-13 15:35:27 +02:00
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
|
|
# include <config.h>
|
|
|
|
|
|
#endif
|
2000-05-05 16:19:30 +00:00
|
|
|
|
|
2000-04-21 14:16:44 +00:00
|
|
|
|
#include "libguile/_scm.h"
|
|
|
|
|
|
#include "libguile/validate.h"
|
1999-12-12 02:36:16 +00:00
|
|
|
|
|
2000-05-05 16:19:30 +00:00
|
|
|
|
#include "libguile/pairs.h"
|
|
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* {Pairs}
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
2001-06-07 21:12:19 +00:00
|
|
|
|
#if (SCM_DEBUG_PAIR_ACCESSES == 1)
|
|
|
|
|
|
|
2002-08-05 23:04:44 +00:00
|
|
|
|
#include "libguile/ports.h"
|
2001-06-07 21:12:19 +00:00
|
|
|
|
#include "libguile/strings.h"
|
|
|
|
|
|
|
|
|
|
|
|
void scm_error_pair_access (SCM non_pair)
|
|
|
|
|
|
{
|
2001-06-08 10:02:33 +00:00
|
|
|
|
static unsigned int running = 0;
|
2005-07-11 23:55:17 +00:00
|
|
|
|
SCM message = scm_from_locale_string ("Non-pair accessed with SCM_C[AD]R: `~S'\n");
|
2001-06-08 10:02:33 +00:00
|
|
|
|
|
|
|
|
|
|
if (!running)
|
|
|
|
|
|
{
|
|
|
|
|
|
running = 1;
|
|
|
|
|
|
scm_simple_format (scm_current_error_port (),
|
* list.h (scm_list_1, scm_list_2, scm_list_3, scm_list_4, scm_list_5,
scm_list_n): New functions.
(SCM_LIST0, SCM_LIST1, SCM_LIST2, SCM_LIST3, SCM_LIST4, SCM_LIST5,
SCM_LIST6, SCM_LIST7, SCM_LIST8, SCM_LIST9, scm_listify): Deprecated.
(lots of files): Use the new functions.
* goops.c (CALL_GF1, CALL_GF2, CALL_GF3, CALL_GF4): Use scm_call_N.
* strings.c: #include "libguile/deprecation.h".
2001-06-28 01:11:59 +00:00
|
|
|
|
message, scm_list_1 (non_pair));
|
2001-06-08 10:02:33 +00:00
|
|
|
|
abort ();
|
|
|
|
|
|
}
|
2001-06-07 21:12:19 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
2000-01-05 19:25:37 +00:00
|
|
|
|
SCM_DEFINE (scm_cons, "cons", 2, 0, 0,
|
2000-05-05 16:19:30 +00:00
|
|
|
|
(SCM x, SCM y),
|
2001-04-03 13:19:05 +00:00
|
|
|
|
"Return a newly allocated pair whose car is @var{x} and whose\n"
|
|
|
|
|
|
"cdr is @var{y}. The pair is guaranteed to be different (in the\n"
|
|
|
|
|
|
"sense of @code{eq?}) from every previously existing object.")
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#define FUNC_NAME s_scm_cons
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
Changes in doc/ref:
* api.txt, data-rep.texi: Renamed the struct scm_cell to
scm_t_cell.
* data-rep.texi: Renamed scm_alloc_cell to scm_cell and
scm_alloc_double_cell to scm_double_cell.
Changes in libguile:
* gc.c (SCM_HEAP_SEG_SIZE, CELL_UP, CELL_DN, NEXT_DATA_CELL,
init_heap_seg, alloc_some_heap), gc.h (struct scm_cell, struct
scm_t_cell, SCM_CELLPTR, SCM_GC_CARD_SIZE,
SCM_GC_IN_CARD_HEADERP), tags.h (SCM_CELLP): Renamed the struct
scm_cell and all its uses to scm_t_cell in accordance to Guile's
naming scheme for types.
* alist.c (scm_acons), convert.i.c (CTYPES2UVECT,
CTYPES2UVECT_OPTIONAL), coop-threads.c (scm_call_with_new_thread,
scm_spawn_thread), debug.c (scm_make_debugobj), environments.c
(scm_make_environment), eval.c (scm_closure), fports.c
(scm_fdes_to_port), gc.c (scm_deprecated_newcell,
scm_deprecated_newcell2), inline.h (scm_alloc_cell, scm_cell),
list.c (SCM_I_CONS), numbers.c (scm_i_mkbig), pairs.c (scm_cons),
ports.c (scm_void_port), procs.c (scm_c_make_subr, scm_makcclo),
smob.c (scm_make_smob), smob.h (SCM_NEWSMOB), strings.c
(scm_take_str, scm_allocate_string), strports.c (scm_mkstrport),
unif.c (scm_make_uve), variable.c (make_variable), vectors.c
(scm_c_make_vector), vports.c (scm_make_soft_port): Renamed
scm_alloc_cell to scm_cell.
* environments.c (core_environments_observe), gc.c
(scm_deprecated_newcell2), goops.c (wrap_init, scm_wrap_object),
inline.h (scm_alloc_double_cell, scm_double_cell), num2float.i.c
(FLOAT2NUM), numbers.c (scm_make_real), procs.c
(scm_make_procedure_with_setter), smob.h (SCM_NEWSMOB2,
SCM_NEWSMOB3), struct.c (scm_make_struct, scm_make_vtable_vtable),
symbols.c (scm_mem2symbol, scm_mem2uninterned_symbol), weaks.c
(allocate_weak_vector): Renamed scm_alloc_double_cell to
scm_double_cell.
2002-03-01 00:19:20 +00:00
|
|
|
|
return scm_cell (SCM_UNPACK (x), SCM_UNPACK (y));
|
1996-07-25 22:56:11 +00:00
|
|
|
|
}
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#undef FUNC_NAME
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
1999-12-12 02:36:16 +00:00
|
|
|
|
scm_cons2 (SCM w, SCM x, SCM y)
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
2001-11-25 15:21:07 +00:00
|
|
|
|
return scm_cons (w, scm_cons (x, y));
|
1996-07-25 22:56:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2000-01-05 19:05:23 +00:00
|
|
|
|
SCM_DEFINE (scm_pair_p, "pair?", 1, 0, 0,
|
1999-12-12 02:36:16 +00:00
|
|
|
|
(SCM x),
|
2001-04-03 13:19:05 +00:00
|
|
|
|
"Return @code{#t} if @var{x} is a pair; otherwise return\n"
|
|
|
|
|
|
"@code{#f}.")
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#define FUNC_NAME s_scm_pair_p
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
* discouraged.h, tags.h (SCM_CONSP, SCM_NCONSP): Moved to
discouraged.h. Replaced all uses with scm_is_pair.
(SCM_I_CONSP): New name for SCM_CONSP.
* pairs.h, pairs.c (scm_is_pair, scm_is_null, scm_car, scm_cdr,
scm_i_chase_pairs, SCM_I_A_PAT, SCM_I_D_PAT, etc, scm_caar,
scm_cadr, etc): New.
(SCM_NULLP, SCM_NNULLP): Moved to discouraged.h. Replaced all
uses with scm_is_null.
2004-09-22 17:37:01 +00:00
|
|
|
|
return scm_from_bool (scm_is_pair (x));
|
1996-07-25 22:56:11 +00:00
|
|
|
|
}
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#undef FUNC_NAME
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
* discouraged.h, tags.h (SCM_CONSP, SCM_NCONSP): Moved to
discouraged.h. Replaced all uses with scm_is_pair.
(SCM_I_CONSP): New name for SCM_CONSP.
* pairs.h, pairs.c (scm_is_pair, scm_is_null, scm_car, scm_cdr,
scm_i_chase_pairs, SCM_I_A_PAT, SCM_I_D_PAT, etc, scm_caar,
scm_cadr, etc): New.
(SCM_NULLP, SCM_NNULLP): Moved to discouraged.h. Replaced all
uses with scm_is_null.
2004-09-22 17:37:01 +00:00
|
|
|
|
SCM
|
|
|
|
|
|
scm_car (SCM pair)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!scm_is_pair (pair))
|
|
|
|
|
|
scm_wrong_type_arg_msg (NULL, 0, pair, "pair");
|
|
|
|
|
|
return SCM_CAR (pair);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SCM
|
|
|
|
|
|
scm_cdr (SCM pair)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!scm_is_pair (pair))
|
|
|
|
|
|
scm_wrong_type_arg_msg (NULL, 0, pair, "pair");
|
|
|
|
|
|
return SCM_CDR (pair);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SCM
|
2004-11-02 22:47:14 +00:00
|
|
|
|
scm_i_chase_pairs (SCM tree, scm_t_uint32 pattern)
|
* discouraged.h, tags.h (SCM_CONSP, SCM_NCONSP): Moved to
discouraged.h. Replaced all uses with scm_is_pair.
(SCM_I_CONSP): New name for SCM_CONSP.
* pairs.h, pairs.c (scm_is_pair, scm_is_null, scm_car, scm_cdr,
scm_i_chase_pairs, SCM_I_A_PAT, SCM_I_D_PAT, etc, scm_caar,
scm_cadr, etc): New.
(SCM_NULLP, SCM_NNULLP): Moved to discouraged.h. Replaced all
uses with scm_is_null.
2004-09-22 17:37:01 +00:00
|
|
|
|
{
|
|
|
|
|
|
do
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!scm_is_pair (tree))
|
|
|
|
|
|
scm_wrong_type_arg_msg (NULL, 0, tree, "pair");
|
|
|
|
|
|
tree = (pattern & 1) ? SCM_CAR (tree) : SCM_CDR (tree);
|
|
|
|
|
|
pattern >>= 2;
|
|
|
|
|
|
}
|
|
|
|
|
|
while (pattern);
|
|
|
|
|
|
return tree;
|
|
|
|
|
|
}
|
2000-05-05 16:19:30 +00:00
|
|
|
|
|
2000-01-05 19:05:23 +00:00
|
|
|
|
SCM_DEFINE (scm_set_car_x, "set-car!", 2, 0, 0,
|
1999-12-12 02:36:16 +00:00
|
|
|
|
(SCM pair, SCM value),
|
2000-02-07 04:30:17 +00:00
|
|
|
|
"Stores @var{value} in the car field of @var{pair}. The value returned\n"
|
|
|
|
|
|
"by @code{set-car!} is unspecified.")
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#define FUNC_NAME s_scm_set_car_x
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
2000-05-05 16:19:30 +00:00
|
|
|
|
SCM_VALIDATE_CONS (1, pair);
|
1999-01-13 08:28:52 +00:00
|
|
|
|
SCM_SETCAR (pair, value);
|
1999-03-22 01:22:04 +00:00
|
|
|
|
return SCM_UNSPECIFIED;
|
1996-07-25 22:56:11 +00:00
|
|
|
|
}
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#undef FUNC_NAME
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
2000-05-05 16:19:30 +00:00
|
|
|
|
|
2000-01-05 19:05:23 +00:00
|
|
|
|
SCM_DEFINE (scm_set_cdr_x, "set-cdr!", 2, 0, 0,
|
1999-12-12 02:36:16 +00:00
|
|
|
|
(SCM pair, SCM value),
|
2000-02-07 04:30:17 +00:00
|
|
|
|
"Stores @var{value} in the cdr field of @var{pair}. The value returned\n"
|
|
|
|
|
|
"by @code{set-cdr!} is unspecified.")
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#define FUNC_NAME s_scm_set_cdr_x
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
2000-05-05 16:19:30 +00:00
|
|
|
|
SCM_VALIDATE_CONS (1, pair);
|
1999-01-13 08:28:52 +00:00
|
|
|
|
SCM_SETCDR (pair, value);
|
1999-03-22 01:22:04 +00:00
|
|
|
|
return SCM_UNSPECIFIED;
|
1996-07-25 22:56:11 +00:00
|
|
|
|
}
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#undef FUNC_NAME
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This set of patches separates the representation of the cxr family
of functions (car, cdr etc.) from the dsubr family of functions
(i. e. functions that take a double precision floating point
argument). Further, the algorithm for handling the cxr function
is improved.
* eval.c (SCM_CEVAL, SCM_APPLY, scm_trampoline_1), numbers.c
(scm_asinh, scm_acosh, scm_atanh, scm_truncate, scm_round, floor,
ceil, sqrt, fabs, exp, log, sin, cos, tan, asin, acos, atan, sinh,
cosh, tanh), objects.c (scm_class_of), procprop.c
(scm_i_procedure_arity), ramap.c (scm_array_map_x), tags.h
(scm_tc7_dsubr, scm_tcs_subrs): Introduce scm_tc7_dsubr as new
typecode for the dsubr family of functions.
* ramap.c (ramap_cxr, ramap_dsubr): Renamed ramap_cxr to
ramap_dsubr.
* eval.c (SCM_CEVAL, SCM_APPLY, call_cxr_1), pairs.c
(scm_init_pairs): Make use of the (now usable) second cell element
of a scm_tc7_cxr function to implement the cxr family of functions
more efficiently.
2003-06-01 13:58:42 +00:00
|
|
|
|
/* Every cxr-pattern is made up of pairs of bits, starting with the two least
|
|
|
|
|
|
* significant bits. If in a pair of bits the least significant of the two
|
|
|
|
|
|
* bits is 0, this means CDR, otherwise CAR. The most significant bits of the
|
|
|
|
|
|
* two bits is only needed to indicate when cxr-ing is ready. This is the
|
|
|
|
|
|
* case, when all remaining pairs of bits equal 00. */
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
const char *name;
|
|
|
|
|
|
unsigned char pattern;
|
|
|
|
|
|
} t_cxr;
|
|
|
|
|
|
|
|
|
|
|
|
static const t_cxr cxrs[] =
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
This set of patches separates the representation of the cxr family
of functions (car, cdr etc.) from the dsubr family of functions
(i. e. functions that take a double precision floating point
argument). Further, the algorithm for handling the cxr function
is improved.
* eval.c (SCM_CEVAL, SCM_APPLY, scm_trampoline_1), numbers.c
(scm_asinh, scm_acosh, scm_atanh, scm_truncate, scm_round, floor,
ceil, sqrt, fabs, exp, log, sin, cos, tan, asin, acos, atan, sinh,
cosh, tanh), objects.c (scm_class_of), procprop.c
(scm_i_procedure_arity), ramap.c (scm_array_map_x), tags.h
(scm_tc7_dsubr, scm_tcs_subrs): Introduce scm_tc7_dsubr as new
typecode for the dsubr family of functions.
* ramap.c (ramap_cxr, ramap_dsubr): Renamed ramap_cxr to
ramap_dsubr.
* eval.c (SCM_CEVAL, SCM_APPLY, call_cxr_1), pairs.c
(scm_init_pairs): Make use of the (now usable) second cell element
of a scm_tc7_cxr function to implement the cxr family of functions
more efficiently.
2003-06-01 13:58:42 +00:00
|
|
|
|
{"cdr", 0x02}, /* 00000010 */
|
|
|
|
|
|
{"car", 0x03}, /* 00000011 */
|
|
|
|
|
|
{"cddr", 0x0a}, /* 00001010 */
|
|
|
|
|
|
{"cdar", 0x0b}, /* 00001011 */
|
|
|
|
|
|
{"cadr", 0x0e}, /* 00001110 */
|
|
|
|
|
|
{"caar", 0x0f}, /* 00001111 */
|
|
|
|
|
|
{"cdddr", 0x2a}, /* 00101010 */
|
|
|
|
|
|
{"cddar", 0x2b}, /* 00101011 */
|
|
|
|
|
|
{"cdadr", 0x2e}, /* 00101110 */
|
|
|
|
|
|
{"cdaar", 0x2f}, /* 00101111 */
|
|
|
|
|
|
{"caddr", 0x3a}, /* 00111010 */
|
|
|
|
|
|
{"cadar", 0x3b}, /* 00111011 */
|
|
|
|
|
|
{"caadr", 0x3e}, /* 00111110 */
|
|
|
|
|
|
{"caaar", 0x3f}, /* 00111111 */
|
|
|
|
|
|
{"cddddr", 0xaa}, /* 10101010 */
|
|
|
|
|
|
{"cdddar", 0xab}, /* 10101011 */
|
|
|
|
|
|
{"cddadr", 0xae}, /* 10101110 */
|
|
|
|
|
|
{"cddaar", 0xaf}, /* 10101111 */
|
|
|
|
|
|
{"cdaddr", 0xba}, /* 10111010 */
|
|
|
|
|
|
{"cdadar", 0xbb}, /* 10111011 */
|
|
|
|
|
|
{"cdaadr", 0xbe}, /* 10111110 */
|
|
|
|
|
|
{"cdaaar", 0xbf}, /* 10111111 */
|
|
|
|
|
|
{"cadddr", 0xea}, /* 11101010 */
|
|
|
|
|
|
{"caddar", 0xeb}, /* 11101011 */
|
|
|
|
|
|
{"cadadr", 0xee}, /* 11101110 */
|
|
|
|
|
|
{"cadaar", 0xef}, /* 11101111 */
|
|
|
|
|
|
{"caaddr", 0xfa}, /* 11111010 */
|
|
|
|
|
|
{"caadar", 0xfb}, /* 11111011 */
|
|
|
|
|
|
{"caaadr", 0xfe}, /* 11111110 */
|
|
|
|
|
|
{"caaaar", 0xff}, /* 11111111 */
|
|
|
|
|
|
{0, 0}
|
1996-07-25 22:56:11 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
void
|
|
|
|
|
|
scm_init_pairs ()
|
|
|
|
|
|
{
|
2000-04-25 09:45:16 +00:00
|
|
|
|
unsigned int subnr = 0;
|
|
|
|
|
|
|
This set of patches separates the representation of the cxr family
of functions (car, cdr etc.) from the dsubr family of functions
(i. e. functions that take a double precision floating point
argument). Further, the algorithm for handling the cxr function
is improved.
* eval.c (SCM_CEVAL, SCM_APPLY, scm_trampoline_1), numbers.c
(scm_asinh, scm_acosh, scm_atanh, scm_truncate, scm_round, floor,
ceil, sqrt, fabs, exp, log, sin, cos, tan, asin, acos, atan, sinh,
cosh, tanh), objects.c (scm_class_of), procprop.c
(scm_i_procedure_arity), ramap.c (scm_array_map_x), tags.h
(scm_tc7_dsubr, scm_tcs_subrs): Introduce scm_tc7_dsubr as new
typecode for the dsubr family of functions.
* ramap.c (ramap_cxr, ramap_dsubr): Renamed ramap_cxr to
ramap_dsubr.
* eval.c (SCM_CEVAL, SCM_APPLY, call_cxr_1), pairs.c
(scm_init_pairs): Make use of the (now usable) second cell element
of a scm_tc7_cxr function to implement the cxr family of functions
more efficiently.
2003-06-01 13:58:42 +00:00
|
|
|
|
for (subnr = 0; cxrs[subnr].name; subnr++)
|
|
|
|
|
|
{
|
|
|
|
|
|
SCM (*pattern) () = (SCM (*) ()) (scm_t_bits) cxrs[subnr].pattern;
|
|
|
|
|
|
scm_c_define_subr (cxrs[subnr].name, scm_tc7_cxr, pattern);
|
|
|
|
|
|
}
|
2000-04-25 09:45:16 +00:00
|
|
|
|
|
2000-04-21 14:16:44 +00:00
|
|
|
|
#include "libguile/pairs.x"
|
1996-07-25 22:56:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2000-03-19 19:01:16 +00:00
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
Local Variables:
|
|
|
|
|
|
c-file-style: "gnu"
|
|
|
|
|
|
End:
|
|
|
|
|
|
*/
|