port predicates can be called on any object

This commit is contained in:
Alex Shinn 2012-07-17 07:46:32 +09:00
parent 0c9297d0d6
commit 16b71a1f22

15
sexp.c
View file

@ -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 #define sexp_make_non_null_input_output_port sexp_make_non_null_input_port
#endif #endif
sexp sexp_port_outputp_op (sexp ctx, sexp self, sexp_sint_t n, sexp port) { sexp sexp_port_outputp_op (sexp ctx, sexp self, sexp_sint_t n, sexp obj) {
sexp_assert_type(ctx, sexp_portp, SEXP_OPORT, port); return sexp_make_boolean(sexp_oportp(obj));
return sexp_make_boolean(sexp_oportp(port));
} }
sexp sexp_port_binaryp_op (sexp ctx, sexp self, sexp_sint_t n, sexp port) { sexp sexp_port_binaryp_op (sexp ctx, sexp self, sexp_sint_t n, sexp obj) {
sexp_assert_type(ctx, sexp_portp, SEXP_IPORT, port); return sexp_make_boolean(sexp_portp(obj) && sexp_port_binaryp(obj));
return sexp_make_boolean(sexp_port_binaryp(port));
} }
sexp sexp_port_openp_op (sexp ctx, sexp self, sexp_sint_t n, sexp port) { sexp sexp_port_openp_op (sexp ctx, sexp self, sexp_sint_t n, sexp obj) {
sexp_assert_type(ctx, sexp_portp, SEXP_IPORT, port); return sexp_make_boolean(sexp_portp(obj) && sexp_port_openp(obj));
return sexp_make_boolean(sexp_port_openp(port));
} }
#if SEXP_USE_FOLD_CASE_SYMS #if SEXP_USE_FOLD_CASE_SYMS