Skip to content

Complex Types - structs#8

Merged
mohitk05 merged 2 commits intomainfrom
structs
Mar 5, 2025
Merged

Complex Types - structs#8
mohitk05 merged 2 commits intomainfrom
structs

Conversation

@mohitk05
Copy link
Contributor

@mohitk05 mohitk05 commented Mar 5, 2025

This PR implements struct data structures in Gom. structs can be defined as:

type Point = {
  x: int,
  y: int
}

and then initialised as:

let p = Point { x: 1, y: 2 };

Structs can be nested:

type Line = {
  p1: Point,
  p2: Point
}

@mohitk05 mohitk05 merged commit a7219ce into main Mar 5, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant