1 /* utilities2 - basic utility functions */
2 /* XLISP-STAT 2.1 Copyright (c) 1990, by Luke Tierney */
3 /* Additions to Xlisp 2.1, Copyright (c) 1989 by David Michael Betz */
4 /* You may give out copies of this software; for conditions see the */
5 /* file COPYING included with this distribution. */
10 /* external variables */
11 extern LVAL s_in_callback
;
13 /**************************************************************************/
15 /** Utility Functions **/
17 /**************************************************************************/
19 LVAL integer_list_2
P2C(int, a
, int, b
)
26 temp
= cvfixnum((FIXTYPE
) b
); list
= consa(temp
);
27 temp
= cvfixnum((FIXTYPE
) a
); list
= cons(temp
, list
);
32 LVAL integer_list_3
P3C(int, a
, int, b
, int, c
)
39 temp
= cvfixnum((FIXTYPE
) c
); list
= consa(temp
);
40 temp
= cvfixnum((FIXTYPE
) b
); list
= cons(temp
, list
);
41 temp
= cvfixnum((FIXTYPE
) a
); list
= cons(temp
, list
);
46 LVAL integer_list_4
P4C(int, a
, int, b
, int, c
, int, d
)
53 temp
= cvfixnum((FIXTYPE
) d
); list
= consa(temp
);
54 temp
= cvfixnum((FIXTYPE
) c
); list
= cons(temp
, list
);
55 temp
= cvfixnum((FIXTYPE
) b
); list
= cons(temp
, list
);
56 temp
= cvfixnum((FIXTYPE
) a
); list
= cons(temp
, list
);
61 LVAL send_message
P2C(LVAL
, object
, LVAL
, msg
)
67 return(xscallsubrvec(xmsend
, 2, argv
));
70 LVAL send_callback_message
P2C(LVAL
, object
, LVAL
, msg
)
75 xldbind(s_in_callback
, s_true
);
76 val
= send_message(object
, msg
);
81 LVAL send_message1
P3C(LVAL
, object
, LVAL
, msg
, int, a
)
83 LVAL La
, result
, argv
[3];
86 La
= cvfixnum((FIXTYPE
) a
);
90 result
= xscallsubrvec(xmsend
, 3, argv
);
95 LVAL send_callback_message1
P3C(LVAL
, object
, LVAL
, msg
, int, a
)
100 xldbind(s_in_callback
, s_true
);
101 val
= send_message1(object
, msg
, a
);
106 LVAL send_message_1L
P3C(LVAL
, object
, LVAL
, symbol
, LVAL
, value
)
113 return(xscallsubrvec(xmsend
, 3, argv
));
116 LVAL send_callback_message_1L
P3C(LVAL
, object
, LVAL
, msg
, LVAL
, value
)
121 xldbind(s_in_callback
, s_true
);
122 val
= send_message_1L(object
, msg
, value
);
127 LVAL apply_send
P3C(LVAL
, object
, LVAL
, symbol
, LVAL
, args
)
132 args
= cons(symbol
, args
);
133 args
= cons(object
, args
);
134 result
= xsapplysubr(xmsend
, args
);
139 LVAL double_list_2
P2C(double, a
, double, b
)
146 temp
= cvflonum((FLOTYPE
) b
); list
= consa(temp
);
147 temp
= cvflonum((FLOTYPE
) a
); list
= cons(temp
, list
);
155 if (moreargs()) count
= getfixnum(xlgafixnum());