Skip to content

User-defined structs #13

@vladfaust

Description

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

final p = Point(3, 4)
assert(p.length().~=(5, 0.01))

Metadata

Metadata

Assignees

No one assigned

    Labels

    specSpecification conformance

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions