mirror of
https://github.com/janet-lang/janet
synced 2025-02-03 10:49:09 +00:00
Remove try from contains?, allowing type errors
> Remove the try. In dynamic languages, the usual idea is garbage in, garbage out. You misunderstood my point about the type error. “Test” functions are not special in that regard. > - @bakpakin
This commit is contained in:
parent
f778e8bbd1
commit
a20612478e
@ -1236,10 +1236,7 @@
|
||||
|
||||
Note that tables or structs (dictionaries) never contain null values```
|
||||
[collection val]
|
||||
# NOTE: index-of throws excpetion if `collection` is not iterable
|
||||
#
|
||||
# We want to guard against that
|
||||
(try (not (nil? (index-of val collection))) [[_] false]))
|
||||
(not (nil? (index-of val collection))))
|
||||
|
||||
|
||||
(defdyn *defdyn-prefix* ``Optional namespace prefix to add to keywords declared with `defdyn`.
|
||||
|
Loading…
Reference in New Issue
Block a user