summaryrefslogtreecommitdiff
path: root/op.h
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-08-25 18:48:46 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-08-25 23:02:06 -0700
commitc8fe3bdf72b0df1c0b68f180001f0a3dde206992 (patch)
treee7b45c4208072ce5f7f584998768df0f720d4623 /op.h
parent721670045d5263bd28b147533785fbbf36671316 (diff)
downloadperl-c8fe3bdf72b0df1c0b68f180001f0a3dde206992.tar.gz
Banish boolkeys
Since 6ea72b3a1, rv2hv and padhv have had the ability to return boo- leans in scalar context, instead of bucket stats, if flagged the right way. sub { %hash || ... } is optimised to take advantage of this. If the || is in unknown context at compile time, the %hash is flagged as being maybe a true boolean. When flagged that way, it returns a bool- ean if block_gimme() returns G_VOID. If rv2hv and padhv can already do this, then we don’t need the boolkeys op any more. We can just flag the rv2hv to return a boolean. In all the cases where boolkeys was used, we know at compile time that it is true boolean context, so we add a new flag for that.
Diffstat (limited to 'op.h')
-rw-r--r--op.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/op.h b/op.h
index d977e5720e..60af704d2d 100644
--- a/op.h
+++ b/op.h
@@ -222,6 +222,8 @@ Deprecated. Use C<GIMME_V> instead.
OP_R?KEYS, OP_SUBSTR, OP_POS, OP_VEC */
#define OPpMAYBE_LVSUB 8 /* We might be an lvalue to return */
/* OP_RV2HV and OP_PADHV */
+#define OPpTRUEBOOL 32 /* %hash in (%hash || $foo) in
+ void context */
#define OpMAYBE_TRUEBOOL 64 /* %hash in (%hash || $foo) where
cx is not known till run time */