Navigation
Synopsis Join two relation values.
Syntax Exp1 join Exp2
Types
Exp1 Exp2 Exp1 join Exp2
rel[ T11, T12, T13, ... ] rel[ T21, T22, T23, ... ] rel[ T11, T12, T13, ..., T21, T22, T23, ... ]
Description Relation resulting from the natural join of the relation values of the two arguments. This relation contains tuples that are the result from concatenating the elements from both arguments.
Examples
rascal>{<1,2>, <10,20>} join {<2,3>};
rel[int,int,int,int]: {
  <10,20,2,3>,
  <1,2,2,3>
}
rascal>{<1,2>} join {3, 4};
rel[int,int,int]: {
  <1,2,4>,
  <1,2,3>
}
rascal>{<1,2>, <10,20>} join {<2,3>, <20,30>};
rel[int,int,int,int]: {
  <10,20,20,30>,
  <10,20,2,3>,
  <1,2,20,30>,
  <1,2,2,3>
}

Questions
Question [1].
The type of {<5, "O">, <4, "Y">} join {<"Lavender", 0>, <"Ginger", 17>, <"Wasabi", -8>, <"Ernie", -17>} is

Question [2].
{<14, "Blueberry">, <4, "Slimey the Worm">} join {<"Ernie", -15>, <"R2-D2", 4>} == 



Is this page unclear, or have you spotted an error? Please add a comment below and help us to improve it. For all other questions and remarks, visit ask.rascal-mpl.org.