Skip to content

[ENHANCEMENT] Define default parameters one at a time based on parameter names #27

@mtfishman

Description

@mtfishman

Right now, we define default parameters like this:

default_type_parameters(::Type{<:Array}) = (Float64, 1)

i.e. as a list, which is expected to be the length of the number of parameters and also follow the positional ordering of the parameters of the type. That is a bit clunky, relies on too many low level details of the type, etc.

A better approach would be:

default_type_parameter(::Type{<:Array}, ::typeof(eltype)) = Float64
default_type_parameter(::Type{<:Array}, ::typeof(ndims)) = 1

which was actually one of the original designs but we found it was difficult to make type stable. But it would be good to revisit that design and get it working.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions