Extern method generics

About Monkey 2 Forums Monkey 2 Development Extern method generics

This topic contains 3 replies, has 2 voices, and was last updated by  Mark Sibly 2 years, 7 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #3620

    Samah
    Participant
    [/crayon]

    Is this possible?

    #3621

    Mark Sibly
    Keymaster

    Probably not, but it could possibly be made to work in some situations.

    If it’s just a plain ‘infer type from params’ generic method that ends up looking like a plain method call in use, it might be doable.

    But if you are wanting to explicitly specify the type via eg: blah<Int>() there’s currently no way.

    Monkey2 generates it’s own generic instances, so by the time everything hits the translator there is not a lot of generic info left. The translator doesn’t use any of it anyway.

    #3622

    Samah
    Participant

    I’ll be honest here, I’m trying to add some lambda stuff to bbArray. Since there are no extensions/categories (yet), it’s going to have to be externed and a PR into the core std library.

    [/crayon]

    And so on.

    #3639

    Mark Sibly
    Keymaster

    Extensions are ‘getting there’ (there’s a first attempt in the next release) but it’ll be a while yet before you can use them with Array<T>. Should ultimately be doable though.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.