emacs-devel
[Top][All Lists]
Advanced

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

Re: empty-directory predicate, native implementation


From: Arthur Miller
Subject: Re: empty-directory predicate, native implementation
Date: Wed, 14 Oct 2020 17:07:18 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Michael Albinus <michael.albinus@gmx.de> writes:

> Arthur Miller <arthur.miller@live.com> writes:
>
> Hi Arthur,
>
>>>>I have chosen not to deal with it all, I check for zer set
>>>> explicit limit for count to be [1,COUNT]. I am not sure if that is best
>>>> thing to do; maybe just to return Qnil? I am probably doing something
>>>> else wrong, advice apprecaiated.
>>>
>>> Returning Qnil seems to be OK, when count is 0.
>>>
>> What about return the length, number of the files in that case?
>
> No, this would be another signature of the response (number instead of
> list of strings).
>
>> In order to get number of the files currently we would get list of files
>> and get length of the list afterwards; if we asked to get 0 files, it
>> could return the length; I thought of it afterwards.
>
> I cannot imagine that this information is needed somewhere. Why do you
> need to know, how many files are in a directory?
>
> Berst regards, Michael.
No idea :-).

It was just to test if empty; but now empty is better served with asking
just for one file and testing for null; and I was also thinking what to
do with 0 count if asked for after I sent patch yesterday; it seemed
like a bit more useful then just return nil early.

I can send tomorrow one that just returns nil and exits.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]