lua-users home
lua-l archive

Re: A Batteries API specification (was Re: LuaDEAL - Lua DEad Alive Libraries)

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


It was thus said that the Great Thorkil Naur once stated:
> Hello Sean,
> 
> On Wed, Jan 22, 2020 at 06:46:32PM -0500, Sean Conner wrote:
> > ...
> > Usage: for entry in glist([name]) do ... end
> > Desc: Return an iterator for traversing a directory; if not given,
> > traverse the current directory.
> > Input: name (string/optional) name of directory, defaults to current directory
> > Return: (iterator function)
> > (iterator state)
> > (iterator var) (string) filename
> 
> What happens when glist(name) is called with a name that would cause
> list(name) to fail?
 There's no iteration (or rather, the loop is immediately exited). Are you
expecting perhaps error() be called? 
> And similarly, what happens when gexpand(pattern) is called with a
> pattern that would cause expand(pattern) to fail?
 Same here. No iteration.
 -spc

AltStyle によって変換されたページ (->オリジナル) /