Search code examples
hy

Hylang "in" operator


Is there an in operator in Hylang? In python, for example, this would allow for the following test:

lst = [1, 2, 3, 4]
print(0 in lst)
# => False

Solution

  • Yes, and it has the same name:

    => (setv lst [1 2 3 4])
    => (in 0 lst)
    False