Re: 3 kinds of yadda

2018-09-10 Thread Trey Harris
When executed:

   - ??? is warn.- ... is fail.
   - !!! is ‘die`.

Otherwise, they’re identical (notably, when *not* executed, which is the
usual case). You’d use ??? when you’re not implementing something yet but
it needs to be callable (say, a debugging function).

Given the difference in behavior between fail and die (fail is an unthrown
exception which is suppressed unless called in Sink context or used in an
expression as anything but a Failure or to test truth or definedness), I’d
suggest that !!! be used in a block that’s being used for its return value
(unless “always false and undefined” is an acceptable return value until
you get around to implementing it and you want to be able to call it in the
meantime), and ... elsewhere.

sub warner() { ??? }

my $x = warner(); # "Stub code executed" warning here
say "Hi!"; # Hi! is printed.

vs.

sub failer() { ... }

my $x = failer(); # nothing happens yet
say "Hi!"; # Hi! will be printed
say $x; # "Stub code executed" will be thrown here.

vs.

sub dier() { !!! }

my $x = dier(); # code will stop execution here with a "Stub code
executed" exception
say "Hi!"; # never gets here

​

On Mon, Sep 10, 2018 at 4:22 PM yary  wrote:

> Semantically
>  !!! is "if control flow hits here, it's an error"
>  ... is "The implementation is elsewhere, or this is not yet implemented"
>
> at least that's my impression
>
> -y
>
> On Mon, Sep 10, 2018 at 12:04 PM, Parrot Raiser <1parr...@gmail.com>
> wrote:
>
>> There are 3 kinds of yadda, yadda operator:
>>
>> !!! dies with a message: Stub code executed
>>   in block  at yad1 line 2
>>
>> ... dies with an identical message
>>
>> ??? produces the message, but continues operating.
>>
>> The only difference I can find between !!! and ... is that !!!
>> produces bizarre behaviour  when run from the command line. (Bash
>> appears to be editing the code before P6 sees it.)
>>
>> What is supposed to be the difference between !!! and ...? (And bonus
>> points if you can explain what bash is doing.)
>>
>
>


Re: 3 kinds of yadda

2018-09-10 Thread yary
Semantically
 !!! is "if control flow hits here, it's an error"
 ... is "The implementation is elsewhere, or this is not yet implemented"

at least that's my impression

-y

On Mon, Sep 10, 2018 at 12:04 PM, Parrot Raiser <1parr...@gmail.com> wrote:

> There are 3 kinds of yadda, yadda operator:
>
> !!! dies with a message: Stub code executed
>   in block  at yad1 line 2
>
> ... dies with an identical message
>
> ??? produces the message, but continues operating.
>
> The only difference I can find between !!! and ... is that !!!
> produces bizarre behaviour  when run from the command line. (Bash
> appears to be editing the code before P6 sees it.)
>
> What is supposed to be the difference between !!! and ...? (And bonus
> points if you can explain what bash is doing.)
>


Re: 3 kinds of yadda

2018-09-10 Thread Parrot Raiser
> Bash is treating ! as the history substitution character, and either erroring 
> out or substituting a previous command line.

Thanks; that struck me between the time I hit send and got confirmation. :-)*


3 kinds of yadda

2018-09-10 Thread Parrot Raiser
There are 3 kinds of yadda, yadda operator:

!!! dies with a message: Stub code executed
  in block  at yad1 line 2

... dies with an identical message

??? produces the message, but continues operating.

The only difference I can find between !!! and ... is that !!!
produces bizarre behaviour  when run from the command line.
(Bash appears to be interpreting !! as "rerun the previous command",
even when quoted.)

What is supposed to be the difference between !!! and ...?


Re: 3 kinds of yadda

2018-09-10 Thread Brandon Allbery
Bash is treating ! as the history substitution character, and either
erroring out or substituting a previous command line. ^ has related
behavior at the start of a line.

... is specially recognized by the compiler, for example treating a class
stubbed with ... as a forward declaration. I don't know if !!! is similar.

On Mon, Sep 10, 2018 at 3:05 PM Parrot Raiser <1parr...@gmail.com> wrote:

> There are 3 kinds of yadda, yadda operator:
>
> !!! dies with a message: Stub code executed
>   in block  at yad1 line 2
>
> ... dies with an identical message
>
> ??? produces the message, but continues operating.
>
> The only difference I can find between !!! and ... is that !!!
> produces bizarre behaviour  when run from the command line. (Bash
> appears to be editing the code before P6 sees it.)
>
> What is supposed to be the difference between !!! and ...? (And bonus
> points if you can explain what bash is doing.)
>


-- 
brandon s allbery kf8nh
allber...@gmail.com


3 kinds of yadda

2018-09-10 Thread Parrot Raiser
There are 3 kinds of yadda, yadda operator:

!!! dies with a message: Stub code executed
  in block  at yad1 line 2

... dies with an identical message

??? produces the message, but continues operating.

The only difference I can find between !!! and ... is that !!!
produces bizarre behaviour  when run from the command line. (Bash
appears to be editing the code before P6 sees it.)

What is supposed to be the difference between !!! and ...? (And bonus
points if you can explain what bash is doing.)