unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#49363: eof-object? is not exported from (ice-9 binary-ports)
@ 2021-07-03 20:24 Maxime Devos
  2021-07-04  5:54 ` Linus Björnstam
  0 siblings, 1 reply; 3+ messages in thread
From: Maxime Devos @ 2021-07-03 20:24 UTC (permalink / raw)
  To: 49363

[-- Attachment #1: Type: text/plain, Size: 1062 bytes --]

According to the manual:

6.12.2 Binary I/O
-----------------

[...]
   To use these routines, first include the binary I/O module:

     (use-modules (ice-9 binary-ports))

[...]
   The end-of-file object is unlike any other kind of object: it’s not a
pair, a symbol, or anything else.  To check if a value is the
end-of-file object, use the ‘eof-object?’ predicate.

 -- Scheme Procedure: eof-object? x
 -- C Function: scm_eof_object_p (x)
     Return ‘#t’ if X is an end-of-file object, or ‘#f’ otherwise.

However, eof-object? is not exported by (ice-9 binary-ports):

scheme@(guile-user)> (@ (ice-9 binary-ports) eof-object?)
ice-9/boot-9.scm:1685:16: In procedure raise-exception:
Unbound variable: eof-object?

But it is imported from (ice-9 ports):

scheme@(guile-user) [1]> (@ (ice-9 ports) eof-object?)
$1 = #<procedure eof-object? (_)>

Could an appropriate export be added to (ice-9 binary-ports)?
Or the manual adjusted to note you need to import (ice-9 ports)
to get eof-object?

Greetings,
Maxime

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#49363: eof-object? is not exported from (ice-9 binary-ports)
  2021-07-03 20:24 bug#49363: eof-object? is not exported from (ice-9 binary-ports) Maxime Devos
@ 2021-07-04  5:54 ` Linus Björnstam
  2021-07-04 11:48   ` Maxime Devos
  0 siblings, 1 reply; 3+ messages in thread
From: Linus Björnstam @ 2021-07-04  5:54 UTC (permalink / raw)
  To: Maxime Devos, 49363

Isn't eof-object? available in the default environment?

-- 
  Linus Björnstam

On Sat, 3 Jul 2021, at 22:24, Maxime Devos wrote:
> According to the manual:
> 
> 6.12.2 Binary I/O
> -----------------
> 
> [...]
>    To use these routines, first include the binary I/O module:
> 
>      (use-modules (ice-9 binary-ports))
> 
> [...]
>    The end-of-file object is unlike any other kind of object: it’s not a
> pair, a symbol, or anything else.  To check if a value is the
> end-of-file object, use the ‘eof-object?’ predicate.
> 
>  -- Scheme Procedure: eof-object? x
>  -- C Function: scm_eof_object_p (x)
>      Return ‘#t’ if X is an end-of-file object, or ‘#f’ otherwise.
> 
> However, eof-object? is not exported by (ice-9 binary-ports):
> 
> scheme@(guile-user)> (@ (ice-9 binary-ports) eof-object?)
> ice-9/boot-9.scm:1685:16: In procedure raise-exception:
> Unbound variable: eof-object?
> 
> But it is imported from (ice-9 ports):
> 
> scheme@(guile-user) [1]> (@ (ice-9 ports) eof-object?)
> $1 = #<procedure eof-object? (_)>
> 
> Could an appropriate export be added to (ice-9 binary-ports)?
> Or the manual adjusted to note you need to import (ice-9 ports)
> to get eof-object?
> 
> Greetings,
> Maxime
> 
> Attachments:
> * signature.asc





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#49363: eof-object? is not exported from (ice-9 binary-ports)
  2021-07-04  5:54 ` Linus Björnstam
@ 2021-07-04 11:48   ` Maxime Devos
  0 siblings, 0 replies; 3+ messages in thread
From: Maxime Devos @ 2021-07-04 11:48 UTC (permalink / raw)
  To: Linus Björnstam, 49363

[-- Attachment #1: Type: text/plain, Size: 522 bytes --]

Linus Björnstam schreef op zo 04-07-2021 om 07:54 [+0200]:
> Isn't eof-object? available in the default environment?

Yes, but I use (define-library ...) and (library ...) forms
instead of (define-module (...) ...) forms.  When using
define-library or library, the ‘default’ environment is ignored.

I suppose I should import 'eof-object?' from (rnrs io ports)
as I am using RnRS library forms.  Still, this seems a bug in
(ice-9 binary-ports) or the documentation and easy to fix. 

Greetings,
Maxime. 

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-04 11:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-03 20:24 bug#49363: eof-object? is not exported from (ice-9 binary-ports) Maxime Devos
2021-07-04  5:54 ` Linus Björnstam
2021-07-04 11:48   ` Maxime Devos

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).