Permalink
Browse files

Add Any.exists($key) and Any.delete($key)

This feels like a hack, but it seems the best way to handle cases such as

  my %h; say %h<a><b>:exists; say %h<a><b>:!k   # False, "b"

without having to add a large number of candidates for Any:U: in combination
with all possible adverbial pairs and combination of adverbial pairs.
  • Loading branch information...
1 parent fe289bf commit 789db4ff6ea69df7d9bf0c8b8a9b260035bf6896 @lizmat lizmat committed Aug 26, 2013
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/core/Any.pm
View
@@ -14,7 +14,9 @@ my class Any { # declared in BOOTSTRAP
########
# primitives
- method infinite() { Nil }
+ method infinite() { Nil }
+ method exists($key) { False }
+ method delete($key) { Nil }
method list() {
nqp::p6list(
self.DEFINITE ?? nqp::list(self) !! nqp::list(), List, Mu

0 comments on commit 789db4f

Please sign in to comment.