> @generated function m(array, index)
>   index == :last && return :(array[length(array)])
>   index == :first && return :(array[1])
>   isa(index, Int)  && return :(array[index])
> end
>
> This won't work? Why?

>> :first, :end won't work either since they are of the same type.

Just try it.

As others mentioned, you probably want to have a slightly better
understanding of the schematics of different features first.

Reply via email to