Hylang "in" operator

Viewed 76

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
3 Answers

Yes, and it has the same name:

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

Hylang seems to not have an operator that would check a list for occurences.

But there is a solution. You can use the py operator to check for list occurences via native python code.

It would look like that:

(py "0 in lst")
Related