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

Zoltan Somogyi zoltan.somogyi at runbox.com
Mon Oct 14 13:06:15 AEDT 2019



On Mon, 14 Oct 2019 03:58:18 +0200, Volker Wysk <post at volker-wysk.de> 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),
> 	...
>     )

That is actually two levels of switching: first ok vs error, then
(in the ok case) yes vs no. The fact that you can flatten that out
in the surface syntax does not change the fact that the generated
code does two nested switches.

Zoltan.


More information about the users mailing list