I would return 0 (the integer zero) or a negative number for entries that are not found. This way, the return type of the function is still Int. This is relevant for type stability, i.e. performance.
-erik On Wed, Jan 6, 2016 at 5:01 PM, Alex <[email protected]> wrote: > Hello, > > Let's say I write a function which checks if a given array/vector > contains a certain value and returns it's index. > > What should the function return if array doesn't contain the value? > > I read carefully the section "Nothingness and missing values": > http://docs.julialang.org/en/latest/manual/faq/#nothingness-and-missing-values > > > but I don't get from it what would be a correct "julian" solution. > > -- Alex -- Erik Schnetter <[email protected]> http://www.perimeterinstitute.ca/personal/eschnetter/
