Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions MIL/C07_Structures/S01_Structures.lean
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,12 @@ def myPoint1 : Point where
z := 4

def myPoint2 : Point :=
{ x := 2, y := -1, z := 4 }

def myPoint3 : Point :=
⟨2, -1, 4⟩

def myPoint3 :=
def myPoint4 :=
Point.mk 2 (-1) 4
-- QUOTE.

Expand All @@ -67,7 +70,7 @@ def myPoint3 :=

In the first example, the fields of the structure are named
explicitly.
The function ``Point.mk`` referred to in the definition of ``myPoint3``
The function ``Point.mk`` referred to in the definition of ``myPoint4``
is known as the *constructor* for the ``Point`` structure, because
it serves to construct elements.
You can specify a different name if you want, like ``build``.
Expand Down