IEnumerable???

About Monkey 2 Forums Monkey 2 Development IEnumerable???

This topic contains 2 replies, has 2 voices, and was last updated by  cocon 1 week, 1 day ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #14316

    cocon
    Participant

    Is there any base-interface for connecting the Array<T> with a collection type IContainer<T>? For example if there are very useful functions that you could not decide whether to implement them using arrays or lists or stacks, that base type would do.

    #14318

    nerobot
    Participant

    Look at %monkey2%\modules\std\collections\container.monkey2.

    There are base types, but they are fake – have no methods. So we cant use them as usual.

    Also Array struct don’t implement IContainer.

    So I don’t know how to achive universal processing of any collection.

    #14322

    cocon
    Participant

    Oh, also I see this message:

    IContainer is not a ‘real’ interface because Monkey2 does not yet support generic interface methods. This feature is planned for a future version of monkey2.

    The interface is unimplemented now, we’ll see about it in the future.

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

You must be logged in to reply to this topic.