user
Task

Create a compound data type:

```
  Point(x,y) 

```

A compound data type is one that holds multiple independent values.

Related task

* Enumeration

See also

* Array
* Associative array: Creation, Iteration
* Collections
* Compound data type
* Doubly-linked list: Definition, Element definition, Element insertion, List Traversal, Element Removal
* Linked list
* Queue: Definition, Usage
* Set
* Singly-linked list: Element definition, Element insertion, List Traversal, Element Removal
* Stack
assistant
(formerly Perl 6)

**Works with**: Rakudo version #24 "Seoul"

### Array

```
my @point = 3, 8;

my Int @point = 3, 8; # or constrain to integer elements
```

### Hash

```
my %point = x => 3, y => 8;

my Int %point = x => 3, y => 8; # or constrain the hash to have integer values
```

### Class instance

```
class Point { has Real ($.x, $.y) is rw; }
my Point $point .= new: x => 3, y => 8;
```

### Set

```
my $s1 = set <a b c d>; # order is not preserved
my $s2 = set <c d e f>;
say $s1 (&) $s2; # OUTPUT«set(c, e)»
say $s1 ∩ $s2; # we also do Unicode
```