I have the following two functions:
find(list, closure) := block(
filter: sublist(list, closure),
if length(filter) > 0 then filter[1] else null)$
find_index(list, closure) := block(
filter: sublist_indices(list, closure),
if length(filter) > 0 then filter[1] else null)$
In other languages I would return null
or nil
here, if the element that is searched can't be found. But I think this keyword doesn't exist in maxima. What is the common convention in maxima for what to return in this case? Maybe false
?