1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-11 14:21:10 +02:00

2000-11-04 Gary Houston <ghouston@arglist.com>

* ports.c (scm_port_p): new function, implements "port?" which
	is mentioned in R5RS.
	* ports.h: declare scm_port_p.
This commit is contained in:
Gary Houston 2000-11-04 23:24:14 +00:00
parent 53a53bd75e
commit eb5c0a2a6c
4 changed files with 22 additions and 0 deletions

5
NEWS
View file

@ -169,6 +169,11 @@ Guile.
Instead, use scm_memq, scm_memv, scm_member.
** New function: port? X
Returns a boolean indicating whether X is a port. Equivalent to
`(or (input-port? X) (output-port? X))'.
* Changes to the gh_ interface
* Changes to the scm_ interface

View file

@ -1,3 +1,9 @@
2000-11-04 Gary Houston <ghouston@arglist.com>
* ports.c (scm_port_p): new function, implements "port?" which
is mentioned in R5RS.
* ports.h: declare scm_port_p.
2000-11-01 Dirk Herrmann <D.Herrmann@tu-bs.de>
* backtrace.c (display_expression, display_error_body), fports.c

View file

@ -735,6 +735,16 @@ SCM_DEFINE (scm_output_port_p, "output-port?", 1, 0, 0,
}
#undef FUNC_NAME
SCM_DEFINE (scm_port_p, "port?", 1, 0, 0,
(SCM x),
"Returns a boolean indicating whether @var{x} is a port.\n"
"Equivalent to @code{(or (input-port? X) (output-port? X))}.")
#define FUNC_NAME s_scm_port_p
{
return SCM_BOOL (SCM_PORTP (x));
}
#undef FUNC_NAME
SCM_DEFINE (scm_port_closed_p, "port-closed?", 1, 0, 0,
(SCM port),
"Returns @code{#t} if @var{port} is closed or @code{#f} if it is open.")

View file

@ -269,6 +269,7 @@ extern SCM scm_close_port (SCM port);
extern SCM scm_close_all_ports_except (SCM ports);
extern SCM scm_input_port_p (SCM x);
extern SCM scm_output_port_p (SCM x);
extern SCM scm_port_p (SCM x);
extern SCM scm_port_closed_p (SCM port);
extern SCM scm_eof_object_p (SCM x);
extern SCM scm_force_output (SCM port);