Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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
lizmat committed Aug 26, 2013
1 parent fe289bf commit 789db4f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/Any.pm
Expand Up @@ -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
Expand Down

0 comments on commit 789db4f

Please sign in to comment.