On Mon, Nov 26, 2018 at 6:26 PM Trey Harris wrote:
>
>
>
> On Mon, Nov 26, 2018 at 04:56 Fernando Santagata
> wrote:
>>
>> On Sun, Nov 25, 2018 at 5:34 PM Brad Gilbert wrote:
>>>
>>> The reason `dir('a', test => { .IO.d })` doesn't work like you expect
>>> is that it is passed strings.
>>
>>
I can only argue that since the function's name 'dir' reminds a shell level
command, and 'ls a' and 'dir a' work in a certain way, I was expecting that
the function 'dir' worked in the same way, following the Principle of Least
Surprise :-)
On Tue, Nov 27, 2018 at 1:37 AM Trey Harris wrote:
>
>
On Mon, Nov 26, 2018 at 19:26 Trey Harris wrote:
>
>
> On Mon, Nov 26, 2018 at 04:56 Fernando Santagata <
> nando.santag...@gmail.com> wrote:
>
>> On Sun, Nov 25, 2018 at 5:34 PM Brad Gilbert wrote:
>>
>>> The reason `dir('a', test => { .IO.d })` doesn't work like you expect
>>> is that it is
On Mon, Nov 26, 2018 at 04:56 Fernando Santagata
wrote:
> On Sun, Nov 25, 2018 at 5:34 PM Brad Gilbert wrote:
>
>> The reason `dir('a', test => { .IO.d })` doesn't work like you expect
>> is that it is passed strings.
>>
>
> Thank you!
> I could have inferred that from the declaration of the
On Sun, Nov 25, 2018 at 5:34 PM Brad Gilbert wrote:
> The reason `dir('a', test => { .IO.d })` doesn't work like you expect
> is that it is passed strings.
>
Thank you!
I could have inferred that from the declaration of the 'test' argument here
https://docs.perl6.org/routine/dir where the test
The reason `dir('a', test => { .IO.d })` doesn't work like you expect
is that it is passed strings.
> dir('a', test => {.say});
.
c
b
..
("a/.".IO "a/c".IO "a/b".IO "a/..".IO)
So `.IO.d` is looking to see if the CWD directory had a directory of
that name, not the `a`
To further clarify, what I did to prepare this test is:
mkdir -p test/a/b
cd test
echo > a/c
On Sun, Nov 25, 2018 at 11:11 AM Fernando Santagata <
nando.santag...@gmail.com> wrote:
> Here's output of 'a/b'.IO.d from the REPL:
>
> > 'a/b'.IO.d
> True
>
> On Sun, Nov 25, 2018 at 1:52 AM Timo
Here's output of 'a/b'.IO.d from the REPL:
> 'a/b'.IO.d
True
On Sun, Nov 25, 2018 at 1:52 AM Timo Paulssen wrote:
> The dir method gives you entries in the directory you pass. If you don't
> pass a test it'll use the default test which is none(".", ".."), i.e.
> "anything except . and ..".
>
>
The dir method gives you entries in the directory you pass. If you don't
pass a test it'll use the default test which is none(".", ".."), i.e.
"anything except . and ..".
I'm not sure why using { .IO.d } as the test would not give you b,
though. Can you check what "a/b".IO.d outputs? Maybe that