1
0
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:
Techcable 2022-08-26 20:36:17 -07:00
parent f778e8bbd1
commit a20612478e
No known key found for this signature in database
GPG Key ID: D7B98ADFF827CD17

View File

@ -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`.