Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User-defined structs #13

Open
vladfaust opened this issue Feb 19, 2022 · 0 comments
Open

User-defined structs #13

vladfaust opened this issue Feb 19, 2022 · 0 comments
Labels
spec Specification conformance

Comments

@vladfaust
Copy link
Member

vladfaust commented Feb 19, 2022

struct Point {
  x, y : Float64
  length() => (x ** 2 + y ** 2).sqrt()
}

final p = Point(3, 4)
assert(p.length().~=(5, 0.01))
@vladfaust vladfaust added the spec Specification conformance label Feb 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spec Specification conformance
Projects
None yet
Development

No branches or pull requests

1 participant