Child pages
  • Tuples
Skip to end of metadata
Go to start of metadata

Tuples

Tuples give you a way to group related data of different types into small collection-like data structures. In MPS, tuples are available within the jetbrains.mps.baseLanguage.tuples language.

Indexed tuples

Indexed tuple is a structure, which can contain several elements of arbitrary types and elements of which can be accessed by an index. The MPS implementation represents a tuple instance by a Java object. The usual meaning of '=' and '==' operations on Java objects within MPS remains unchanged.

Named tuples

Named tuples are similar to indexed tuples, with the difference that elements are accessed by name instead of by index. To use named tuples in the model you first need to explicitly define them in your model (new ->jetbrains.mps.baseLanguage.tuples/tuple).

Declaration of Pair:

Named tuple declaration

A root node of concept NamedTupleDeclaration contains a single declaration.

declaration part

allowed contents

tupleName

any valid identifier

elementType

either a primitive type or any type that reduces to Java classifier

elementName

any valid identifier

Previous Next

  • No labels

6 Comments

  1. Anonymous

    Don't you know that it's correct time to receive the personal loans, which can realize your dreams.

  2. Anonymous

    Not long ago i came accross your website and also have been reading along. I thought I would leave my initial comment. Nice blog. I will keep visiting this web site very frequently. Many thanks
    I like Your Article about " " Perfect just what I was searching for! .
    Not long ago i came accross your website and also have been reading along. I thought I would leave my initial comment. Nice blog. I will keep visiting this web site very frequently. Many thanks

  3. Anonymous

    Hey there, I think your blog might be having browser compatibility issues. When I look at your blog in Firefox, it looks fine but when opening in Internet Explorer, it has some overlapping. I just wanted to give you a quick heads up! Other then that, superb blog!

  4. Anonymous

    I have come to my conclusion that your post head “ ” is one of the neatest, the only thing is the beginning of your post isn’t loading.
    Wow!, this was a top quality post. In theory I’d like to write like this too – taking time and real effort to make a good article… but what can I say… I keep putting it off and never seem to achieve anything.
    Do you have a link to the source where you got this article from?
    I have come to my conclusion that your post head “ ” is one of the neatest, the only thing is the beginning of your post isn’t loading.

  5. Anonymous

    Excellently written article, if only all bloggers offered the same content as you, the internet would be a much better place. Please keep it up!
    Excellently written article, if only all bloggers offered the same content as you, the internet would be a much better place. Please keep it up!

  6. Anonymous

    this post was very interesting to read for me. i like such posts on such topic. thank you for this.