Skip to content

How to use 0, 1, 2, 3,... as alias of objects by @objectnames? #45

Description

@Chenqitrg

Hi developers,

The

@objectnames PMFC{2,1,0,1,0,0} 0 1 # without category name

support using integer labels in @objectnames. However, when I try to use it, I cannot figure out how to achieve this goal. For example:

@objectnames PMFC{2,1,0,1,0,0} 0 1

Then directly write

julia> Object{PMFC{2,1,0,1,0,0}}(0)
ERROR: ArgumentError: Unknown PMFC{2, 1, 0, 1, 0, 0} Object 0.

won't work. The following does not work also:

julia> Object{PMFC{2,1,0,1,0,0}}(Symbol(0))
ERROR: ArgumentError: Unknown PMFC{2, 1, 0, 1, 0, 0} Object 0.

When I try to output them:

julia> @show collect(values(Object{PMFC{2,1,0,1,0,0}}))
collect(values(Object{PMFC{2, 1, 0, 1, 0, 0}})) = Object{PMFC{2, 1, 0, 1, 0, 0}}[$(QuoteNode(0)), $(QuoteNode(1))]
2-element Vector{Object{PMFC{2, 1, 0, 1, 0, 0}}}:
 $(QuoteNode(0))
 $(QuoteNode(1))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions