This suggestion has been discussed at Slack. We have decided to use #"c" as notation because we wanted to allow `'` in the beginning of identifiers like in SML and F*. In particular, we wanted to allow users to use 'a 'b 'c for naming type parameters like in SML. However, nobody used this notation. In the Lean standard library, we are using greek letters for naming type parameters. So, there is no real motivation for the ugly #"c" syntax.
26 lines
477 B
Text
26 lines
477 B
Text
#check ({1, 2, 3} : set nat)
|
|
#check ({1} : set nat)
|
|
#check ({} : set nat)
|
|
|
|
definition s1 : set nat := {1, 2+3, 3, 4}
|
|
#print s1
|
|
|
|
definition s2 : set char := {'a', 'b', 'c'}
|
|
#print s2
|
|
|
|
definition s3 : set string := {"hello", "world"}
|
|
#print s3
|
|
|
|
#check { a ∈ s1 | a > 1 }
|
|
#check { a in s1 | a > 1 }
|
|
set_option pp.unicode false
|
|
#check { a ∈ s1 | a > 2 }
|
|
|
|
|
|
definition a := 10
|
|
|
|
#check ({a, a} : set nat)
|
|
#check ({a, 1, a} : set nat)
|
|
#check ({a} : set nat)
|
|
|
|
#check { a // a > 0 }
|