lua-users home
lua-l archive

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


On Tue, Jul 13, 2010 at 01:37, Hisham <hisham.hm@gmail.com> wrote:
> On Mon, Jul 12, 2010 at 6:27 PM, Alexander Gladysh <agladysh@gmail.com> wrote:
>> BTW. Perhaps I've missed it in the earlier discussion, but why do we
>> write calls in reverse?

>> Isn't this better? It would allow some fancier chaining if we need one:

>>  if sh.find("/etc", {name="*rc", ctime="+30"}).ok() then ...

> This would take over the entire namespace of sh.*.

Perhaps it is OK? A bit non-orthodoxal, but what if we keep other,
utility APIs in other namespace?

> Also, if we ever
> manage to implement piping like grep().sort(), special functions in
> the end like ok() could clash with program names.

   sh. find("/etc", {name="*rc", ctime="+30"}) .I. sort ().out

(That is capital "I", not vertical slash.)

Starts to look a bit perlish though...

Alexander.