Why there is LinkedListType but no ArrayListType?

These are not practical questions, but why in baseLanguage there is LinkedListType but no ArrayListType and why

linkedlist<int> l = new linkedlist<int>; doesn't work?

Thanks.

3 comments
Comment actions Permalink

Linkedlist type was created to mirror the Java's LinkedList. That is to say a linkedlist is a subtype of deque and stack, whereas list is not. Having "arraylist" type doesn't make much sense, since arraylist is an implementation.

I just checked, the construction linkedlist<int> l = new linkedlist<int>; works, although MPS reports an error (not applicable in the context). If that's what you meant by "doesn't work", it's fixed. Thanks for reporting!

0
Comment actions Permalink

Dmity,

linkedlist<int> l = new linkedlist<int> can't be generated because there is no generator for linkedlist as a type. I've created an issue for that (http://youtrack.jetbrains.net/issue/MPS-8174)

Regards,

Mihail

P.S.: sorry, haven't seen Fedor's answer before I wrote mine :-)



Attachment(s):
Screen shot 2010-03-26 at 3.52.38 PM.png
0
Comment actions Permalink

Yeah, I noticed that too, albeit a little too late.

Which makes Dmitry's feedback even more valuable.


0

Please sign in to leave a comment.