-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
FEMBasis does some "puns" on Base functions, for example:
function Base.size(::Type{$name})
return ($D, $N)
end
function Base.size(::Type{$name}, j::Int)
j == 1 && return $D
j == 2 && return $N
end
function Base.length(::Type{$name})
return $N
end
length is typically defined for collections (or at least when the instance of the type is a collection). AbstractBasis is not iterable and it probably shouldn't be. Instead of defining these functions I think they should have their own names ndim, nbasis.
Overloading Base functions are typically meant so you can write generic code but there is no way to write generic code with puns like this.
ahojukka5
Metadata
Metadata
Assignees
Labels
No labels