mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 21:59:17 +02:00
port predicates can be called on any object
This commit is contained in:
parent
0c9297d0d6
commit
16b71a1f22
1 changed files with 6 additions and 9 deletions
15
sexp.c
15
sexp.c
|
@ -1631,19 +1631,16 @@ sexp sexp_make_non_null_input_output_port (sexp ctx, FILE* io, sexp name) {
|
|||
#define sexp_make_non_null_input_output_port sexp_make_non_null_input_port
|
||||
#endif
|
||||
|
||||
sexp sexp_port_outputp_op (sexp ctx, sexp self, sexp_sint_t n, sexp port) {
|
||||
sexp_assert_type(ctx, sexp_portp, SEXP_OPORT, port);
|
||||
return sexp_make_boolean(sexp_oportp(port));
|
||||
sexp sexp_port_outputp_op (sexp ctx, sexp self, sexp_sint_t n, sexp obj) {
|
||||
return sexp_make_boolean(sexp_oportp(obj));
|
||||
}
|
||||
|
||||
sexp sexp_port_binaryp_op (sexp ctx, sexp self, sexp_sint_t n, sexp port) {
|
||||
sexp_assert_type(ctx, sexp_portp, SEXP_IPORT, port);
|
||||
return sexp_make_boolean(sexp_port_binaryp(port));
|
||||
sexp sexp_port_binaryp_op (sexp ctx, sexp self, sexp_sint_t n, sexp obj) {
|
||||
return sexp_make_boolean(sexp_portp(obj) && sexp_port_binaryp(obj));
|
||||
}
|
||||
|
||||
sexp sexp_port_openp_op (sexp ctx, sexp self, sexp_sint_t n, sexp port) {
|
||||
sexp_assert_type(ctx, sexp_portp, SEXP_IPORT, port);
|
||||
return sexp_make_boolean(sexp_port_openp(port));
|
||||
sexp sexp_port_openp_op (sexp ctx, sexp self, sexp_sint_t n, sexp obj) {
|
||||
return sexp_make_boolean(sexp_portp(obj) && sexp_port_openp(obj));
|
||||
}
|
||||
|
||||
#if SEXP_USE_FOLD_CASE_SYMS
|
||||
|
|
Loading…
Add table
Reference in a new issue