Programming-Idioms

This language bar is your friend. Select your favorite languages!

Idiom #220 Create a tuple value

Create t consisting of 3 values having different types.

Explain if the elements of t are strongly typed or not.

t = (a, b, c)
t := []interface{}{
	2.5,
	"hello",
	make(chan int),
}
let t = [2.5, "hello", -1];
type
  Tuple = record
    a: integer;
    b: string;
    c: boolean;
  end;
var
  t: Tuple;
begin
  t := Default(Tuple);
end.
t = (2.5, "hello", -1)
t = [2.5, "hello", -1]
let t = (2.5, "hello", -1);

Do you know the best way to do this in your language ?
New implementation...

Idiom created by

programming-idioms.org

Related idioms