bitter complaints

3 views
Skip to first unread message

Juerd

unread,
May 6, 2005, 12:46:58 PM5/6/05
to perl6-l...@perl.org
According to S03, the yada operator "complains bitterly" when used. In
#perl6, we can't agree on what that means. Please help. Does it die,
warn or fail?

18:46 < Corion> Juerd: "Complain bitterly" is "output a warning" to me.
18:46 < Juerd> It's "die" to me
18:46 < Odin-> Juerd: Hmm. I'd read it as "print a huge, ten page banner
alerting to an error, and then go on"...

And we want ??? and !!! to be aliases for ... if it dies, or to dieing
yadas if ... itself merely warns:

18:46 < Corion> Juerd: But "..." is more like "uh - I hope you know what
you're doing", where "???" is more like "WTF?", and "!!!" is more like "WTF!"
18:47 < Corion> Juerd: I see "..." as having practical use when stubbing
out code - I would want the code to warn but continue. How else would
you do that?
18:47 < Corion> sub do_magic { ... }
18:47 < Corion> looks good, and should warn "do_magic is not yet
implemented at $?LINE"
18:48 < Corion> while
18:48 < Corion> sub magic { ??? }
18:48 < Corion> should die.

Though we'd have to discuss the precise meanings of "WTF?" and "WTF!".


Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html

Luke Palmer

unread,
May 6, 2005, 12:54:30 PM5/6/05
to Juerd, perl6-l...@perl.org
On 5/6/05, Juerd <ju...@convolution.nl> wrote:
> According to S03, the yada operator "complains bitterly" when used. In
> #perl6, we can't agree on what that means. Please help. Does it die,
> warn or fail?
>
> 18:46 < Corion> Juerd: "Complain bitterly" is "output a warning" to me.
> 18:46 < Juerd> It's "die" to me
> 18:46 < Odin-> Juerd: Hmm. I'd read it as "print a huge, ten page banner
> alerting to an error, and then go on"...
>
> And we want ??? and !!! to be aliases for ... if it dies, or to dieing
> yadas if ... itself merely warns:

It dies if ever executed, IIRC. Would you want:

sub get_user_list() {...}
my @users = get_user_list;

To merely warn? I think die "get_user_list not implemented" is more
appropriate there.

I can see something like:

sub term:<etc.> { warn "You should probably put something here" }

Being useful, but not that useful.

Luke

Larry Wall

unread,
May 6, 2005, 2:36:13 PM5/6/05
to perl6-l...@perl.org
On Fri, May 06, 2005 at 06:46:58PM +0200, Juerd wrote:
: According to S03, the yada operator "complains bitterly" when used. In

: #perl6, we can't agree on what that means. Please help. Does it die,
: warn or fail?
:
: 18:46 < Corion> Juerd: "Complain bitterly" is "output a warning" to me.
: 18:46 < Juerd> It's "die" to me
: 18:46 < Odin-> Juerd: Hmm. I'd read it as "print a huge, ten page banner
: alerting to an error, and then go on"...
:
: And we want ??? and !!! to be aliases for ... if it dies, or to dieing
: yadas if ... itself merely warns:
:
: 18:46 < Corion> Juerd: But "..." is more like "uh - I hope you know what
: you're doing", where "???" is more like "WTF?", and "!!!" is more like "WTF!"
: 18:47 < Corion> Juerd: I see "..." as having practical use when stubbing
: out code - I would want the code to warn but continue. How else would
: you do that?
: 18:47 < Corion> sub do_magic { ... }
: 18:47 < Corion> looks good, and should warn "do_magic is not yet
: implemented at $?LINE"
: 18:48 < Corion> while
: 18:48 < Corion> sub magic { ??? }
: 18:48 < Corion> should die.
:
: Though we'd have to discuss the precise meanings of "WTF?" and "WTF!".

I think I'd like to see:

... fail "$?BLOCKNAME is not yet implemented"
??? warn "$?BLOCKNAME is not yet implemented"
!!! die "$?BLOCKNAME is not yet implemented"

In other words, it's okay to call an undefined function in your
prototype as long as you don't actually use the value. And then you
can force ... to !!! with use fatal.

Larry

Reply all
Reply to author
Forward
0 new messages