[m-users.] Bug in posix.readdir (fixed)

Julien Fischer jfischer at opturion.com
Mon Oct 14 13:09:19 AEDT 2019


On Mon, 14 Oct 2019, Volker Wysk wrote:

> Not sure if I understand correctly, but wouldn't it just be one level
> of switching:
>
>    readdir(Dir, Res, !IO),
>    (
>        Res = ok(yes(File)),
> 	...
>    ;
> 	Res = ok(no),
> 	...
>    ;
> 	Res = error(Err),
> 	...
>    )

Zoltan's already beaten me to the punch with the explanation.
The other reason for preferring this output type is that it is
more consistent with how the standard library handles such
result types (e.g. in the io and stream modules).

Julien.


More information about the users mailing list