Skip to content

Question: Is MetaMethod::IPairs missing for lua54? #635

Description

@jeremychone

I think I'm missing something. I'm using the lua54 feature, I have user data, and I would like to implement custom pairs and ipairs.

I can do that for pairs with MetaMethod::Pairs, but MetaMethod::IPairs is only enabled for the lua52 and luajit52 features.

Here is an example I would like to create:

methods.add_meta_method(MetaMethod::IPairs, |_, _, ()| -> Result<()> {
    Err(Error::RuntimeError("attempt to iterate over ...".into()))
});

What am I missing?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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