lua-users home
lua-l archive

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


On 1/18/06, Chris Marrin <chris@marrin.com> wrote:
> Since Lua is single threaded and coroutines do not implicitly yield, we
> could just have an errno property in the osex package variable. But then
> you have to think about dealing with errors if you ever need to yield
> and it does not allow for hooks that implicitly yield, like has been
> discussed here.

Here is a problem. Consider two OS threads with two Lua VMs.
On some OSs errno is not threadsafe.
I would not have errno as a property. Drop it from the osex, it
gains very little.

>
> Ignoring the existing io package issues for a second, returning an error
> for most of the osex functions proposed is easy. But what object could
> be used to hold the error for the files() iterator? Any syggestions?

nil, errorstring - error
nil,nil  - ok termination


>
> --
> chris marrin              ,""$, "As a general rule,don't solve puzzles
> chris@marrin.com        b`    $  that open portals to Hell" ,,.
>          ,.`           ,b`    ,`                            , 1$'
>       ,|`             mP    ,`                              :$$'     ,mm
>     ,b"              b"   ,`            ,mm      m$$    ,m         ,`P$$
>    m$`             ,b`  .` ,mm        ,'|$P   ,|"1$`  ,b$P       ,`  :$1
>   b$`             ,$: :,`` |$$      ,`   $$` ,|` ,$$,,`"$$     .`    :$|
> b$|            _m$`,:`    :$1   ,`     ,$Pm|`    `    :$$,..;"'     |$:
> P$b,      _;b$$b$1"       |$$ ,`      ,$$"             ``'          $$
>   ```"```'"    `"`         `""`        ""`                          ,P`
>