Skip to content

Making sets Sets #2467

Open
Open
@jchen419

Description

@jchen419

Currently, the set method is only defined on VisibleLists. Trying to turn a Set into a Set gives an error:

i1 : methods set

o1 = {0 => (set, VisibleList)}

o1 : NumberedVerticalList

i2 : set set{1,2}
stdio:2:1:(3): error: expected a visible list

It seems sensible for set to act as the identity on a Set (which is how e.g. sequence and toList behave). Can this be done at top-level?

i3 : set Set := Set => identity

o3 = Set => identity

o3 : Option

i4 : methods set

o4 = {0 => (set, Set)        }
     {1 => (set, VisibleList)}

o4 : NumberedVerticalList

i5 : set set{1,2}
stdio:5:1:(3): error: expected a visible list

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions