Skip to content

Implement Base.propertynames for Complement #21

Description

@TheLostLambda

I was (pleasantly) surprised that the code Locus("complement(2258..2449)").position actually worked, when Locus("complement(2258..2449)") |> typeof |> fieldnames showed only (:loc,)!

That's when I learned that the dot syntax is actually lowered to getproperty and not getfield! With that being said, the default implementation of Base.propertynames (used for the REPL autocomplete, among other things) doesn't know about the implementation you added that made .position work!

In fact, currently running Locus("complement(2258..2449)") |> typeof |> propertynames not only doesn't return position or loc, but it returns a number of things that I can't access with the dot operator at all: (:name, :super, :parameters, :types, :instance, :layout, :hash, :flags).

I think this could be solved with an implementation of Base.propertynames for Complement (and friends)!

Let me know if you agree / would like me to put in a PR!

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