gracelang / language

Design of the Grace language and its libraries
GNU General Public License v2.0
6 stars 1 forks source link

Should true and false be patterns? #187

Closed apblack closed 4 years ago

apblack commented 4 years ago

At present, numbers and strings are patterns, but true and false are not. Should they be?

Uniformity suggest yes. Practicality suggest no. Why the latter? Well, that would give meaning to

So, for example, true & false will match nothing, while true && false will match false ... I think. In any case, this would create plenty of room for confusion.

apblack commented 4 years ago

The OP (i.e., me) was wrong: true and false are actually patterns, but were missing some of the operations that patterns should have.