Skip to content

Add missing link to "pattern" in the document #88

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion hackett-doc/scribblings/hackett/guide.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ enumeration, we would like to be able to @emph{do something} with its values. Fo
wish to write a function that determines if a weekday is a weekend—that is, if it is @racket[sunday]
or @racket[saturday]. To do this, we need some way to check if a weekday is a particular value.

We can do this by using @italic{pattern matching}, which makes it possible to make a decision based on
We can do this by using @deftech[#:key "pattern"]{pattern matching}, which makes it possible to make a decision based on
the different values of an enumeration. Here’s one way to write our @racket[is-weekend?] function:

@(hackett-interaction
Expand Down
2 changes: 1 addition & 1 deletion hackett-doc/scribblings/hackett/reference.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ contains the provided values.
(Foo2 "hello")
Foo3)

Additionally, the bound @racket[value-id]s and @racket[data-constructor-id]s serve as @tech{patterns}
Additionally, the bound @racket[value-id]s and @racket[data-constructor-id]s serve as @tech[#:key "pattern"]{patterns}
that match against different values of the defined type. The pattern associated with each
@racket[data-constuctor-id] accepts patterns that match against the contained values, so
pattern-matching allows extracting values stored “inside” data constructors.
Expand Down