Skip to content

index_of

Description

@index_of(x, y)

find each item from x in y:

  1. return index, if found
  2. return the length of y, if not found

Note: Indexing starts from 0

Type Rules

High-level

Real , Real -> i64
str  , str  -> i64
sym  , sym  -> i64
_    , _    -> domain error

Future Work

Support the search between three string types: char, symbol, and string

Table with details (See type alias)

index of

Shape Rules

Shape left rules

Examples

    @index_of((3,4):i32, (4,9,16):i32)
(3,0):i32