Skip to content

Commit 003891a

Browse files
committed
Explication of lazy warnings
Lazy warning are to be used for +, ~ and ? conversions, as well as for the ??? stub.
1 parent 76c977a commit 003891a

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

S02-bits.pod

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Synopsis 2: Bits and Pieces
1414
Created: 10 Aug 2004
1515

1616
Last Modified: 28 Jul 2012
17-
Version: 267
17+
Version: 268
1818

1919
This document summarizes Apocalypse 2, which covers small-scale
2020
lexical items and typological issues. (These Synopses also contain
@@ -2264,8 +2264,9 @@ Since method calls are performed directly on any object, C<Nil>
22642264
can respond to certain method calls. C<Nil.defined> returns
22652265
C<False> (whereas C<().defined> returns C<True>). C<Nil.so> also
22662266
returns C<False>. C<Nil.ACCEPTS> matches only a C<Nil> value. C<Nil.perl> and
2267-
C<Nil.gist> return C<'Nil'>. C<Nil.Stringy> and C<Nil.Str> return '' with a warning.
2268-
C<Nil.Numeric> returns 0 with a warning. Any undefined method call
2267+
C<Nil.gist> return C<'Nil'>. C<Nil.Stringy> and C<Nil.Str> fail with a resumable warning
2268+
that returns a value of C<''> on resumption. C<Nil.Numeric> likewise fails
2269+
with resumable warning that returns 0 on resumption. Any undefined method call
22692270
on C<Nil> returns C<Nil>, so that C<Nil> propagates down method
22702271
call chains.
22712272

S04-control.pod

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Synopsis 4: Blocks and Statements
1414
Created: 19 Aug 2004
1515

1616
Last Modified: 28 Jul 2012
17-
Version: 117
17+
Version: 118
1818

1919
This document summarizes Apocalypse 4, which covers the block and
2020
statement syntax of Perl.
@@ -1216,6 +1216,15 @@ separate from the catch lambda, though an implementation is allowed
12161216
to combine them if it is careful to retain separate semantics for
12171217
catch and control exceptions.
12181218

1219+
One additional level of control is the notion of I<lazy warnings>.
1220+
If, instead of throwing a warning directly, the program calls C<fail()>
1221+
with a resumable exception, the throwing of the warning is delayed
1222+
until first use (or the caller's policy) requires it to be thrown.
1223+
If the warning exception supports the C<.resume_value> method, that
1224+
will be the value of the failure after it has resumed. Otherwise the
1225+
value will be the null string. The C<+>, C<~>, and C<?> coercions
1226+
use these lazy warnings to allow (but not require) failsoft semantics.
1227+
12191228
=head1 The goto statement
12201229
X<goto>
12211230

S06-routines.pod

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ Synopsis 6: Subroutines
1616

1717
Created: 21 Mar 2003
1818

19-
Last Modified: 23 Jan 2012
20-
Version: 154
19+
Last Modified: 28 Jul 2012
20+
Version: 155
2121

2222
This document summarizes Apocalypse 6, which covers subroutines and the
2323
new type system.
@@ -448,7 +448,8 @@ you must explicitly use the "C<supersede>" declarator. (The compiler may
448448
refuse to do this if it has already committed to the previous definition.)
449449

450450
The C<...> is the "yadayadayada" operator, which is executable but
451-
returns a failure. You can also use C<???> to produce a warning,
451+
returns a failure. You can also use C<???> to fail with a warning
452+
(a lazy one, to be issued only if the the value is actually used),
452453
or C<!!!> to always die. These also officially define stub blocks.
453454
Any of these yada operators will be taken as a stub if used as the main
454455
operator of the first statement in the block. (Statement modifiers

0 commit comments

Comments
 (0)