Re: [code] [textadept] Proposed API Changes

From: Mitchell <>
Date: Thu, 21 Mar 2013 09:13:09 -0400 (Eastern Daylight Time)


On Wed, 20 Mar 2013, Robert wrote:

> Hi.
> On Wed, Mar 20, 2013 at 2:32 AM, Mitchell <> wrote:
>>>> A very useful function. How about not attaching this to the `lfs`
>>>> module but the `io` module? The `lfs` module feels more "third-party"
>>>> to me and it could be confusing.
>> I had given a lot of thought to `io`, but iterating over directories without
>> reading or writing to files doesn't feel like `io`. I also don't feel like
>> it fits when looking at the current `io` API.
> I was reluctant to suggest `io` for the same reason.
>> What about `os.dir_foreach()`? But that doesn't exactly feel right either...
> If none of the options (`lfs`, `os`, `io`) feel quite right, how about
> something else?

To me, `lfs.dir_foreach` "feels" right. Extending existing libraries is
nothing new in the documentation. The `io` module states "Extends Lua's io
library with Textadept functions for working with files" and `string`
states "Extends Lua¢s string library to provide character set
conversions". Similarly a new `lfs` page would state "Extends the lfs
library to find files in directories".

You said it might be confusing. What do you mean? How would it be worse
than 'string.iconv()' or 'io.close_all()'?

> Could `dir_foreach` be put somewhere else? Could there be a general
> `foreach` or `each` filtering function that could be used elsewhere as
> well?

I cannot think of any...


You are subscribed to
To change subscription settings, send an e-mail to
To unsubscribe, send an e-mail to
Received on Thu 21 Mar 2013 - 09:13:09 EDT

This archive was generated by hypermail 2.2.0 : Fri 22 Mar 2013 - 06:32:25 EDT