Skip to content

missing name-not-defined error? #96

Closed Answered by ice1000
nobodxbodon asked this question in Q&A
Discussion options

You must be logged in to vote

Do you know how pattern matching works?

A little surprised to see the 'true' in line 3 doesn't trigger the error first

Yes, because it's a valid pattern. In fact, you can write

def not (b : Bool) : Bool
 | true => false

This is also a valid function, which returns false whatever the input is.

I hope this clarifies whatever confuses you.

Replies: 4 comments 15 replies

Comment options

You must be logged in to vote
1 reply
@ice1000
Comment options

Answer selected by ice1000
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@ice1000
Comment options

Comment options

You must be logged in to vote
13 replies
@ice1000
Comment options

@ice1000
Comment options

@nobodxbodon
Comment options

@ice1000
Comment options

@imkiva
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants