Closed nick-paul closed 2 years ago
N
returnlength(list)+1
for not found
- More difficult to use
N
as a basic contains operator since the index will need to be compared with the length of the list instead of with a known constant
If you have the index-of operators return 0 list EB -
, that index will be out of bounds while still supporting N0<!
Originally brought up by @BlazingTwist here
The
N
operator returns-1
if it cannot find a value in a list. More recently, negative index support was added to Aya.-1
is no longer a good candidate for a default value since it is a valid index.Possible options:
N
returnlength(list)+1
for not foundN
as a basic contains operator since the index will need to be compared with the length of the list instead of with a known constantN0<!
N\.E@=
:N
operator for plain contains checking (return 1 if item is in list, 0 otherwise)