Issue #275 - Return #f instead of raising error

This commit is contained in:
Justin Ethier 2018-09-05 17:41:47 -04:00
parent 9d606f9d43
commit 4cf407ebe6
2 changed files with 16 additions and 4 deletions

View file

@ -2,6 +2,10 @@
## 0.9.3 - TBD
Bug Fixes
- Fix `input-port?`, `output-port?`, `input-port-open?`, and `output-port-open?` to return `#f` instead of crashing when a non-port object is passed.
## 0.9.2 - August 26, 2018
Features

View file

@ -1360,7 +1360,9 @@
(define-c input-port?
"(void *data, int argc, closure _, object k, object port)"
" port_type *p = (port_type *)port;
Cyc_check_port(data, port);
if (boolean_f == Cyc_is_port(port)) {
return_closcall1(data, k, boolean_f);
}
return_closcall1(
data,
k,
@ -1368,7 +1370,9 @@
(define-c output-port?
"(void *data, int argc, closure _, object k, object port)"
" port_type *p = (port_type *)port;
Cyc_check_port(data, port);
if (boolean_f == Cyc_is_port(port)) {
return_closcall1(data, k, boolean_f);
}
return_closcall1(
data,
k,
@ -1376,7 +1380,9 @@
(define-c input-port-open?
"(void *data, int argc, closure _, object k, object port)"
" port_type *p = (port_type *)port;
Cyc_check_port(data, port);
if (boolean_f == Cyc_is_port(port)) {
return_closcall1(data, k, boolean_f);
}
return_closcall1(
data,
k,
@ -1384,7 +1390,9 @@
(define-c output-port-open?
"(void *data, int argc, closure _, object k, object port)"
" port_type *p = (port_type *)port;
Cyc_check_port(data, port);
if (boolean_f == Cyc_is_port(port)) {
return_closcall1(data, k, boolean_f);
}
return_closcall1(
data,
k,