Ocamllex - What is the Difference Between Characters? (#)

They have an operator with ocamllex, which is # : the difference between two characters or character sets.

There is a concept here that I do not understand: this is the difference between the characters. What does the difference between characters mean? Therefore, if someone can explain to me, I understand!

+4
source share
2 answers

[ 'a' - 'z' ] # [ 'a' 'e' 'i' 'o' 'u' ] denotes the set of all characters between a and z that are not a , e , i , o or u . In the general case, foo # bar denotes a set of elements that are in foo , but not in bar .

+4
source

The # operator indicates the difference between two character sets. As a convenience, you can use a single character to represent a singleton set that contains only that character. This is much more useful for the operand on the right than on the left. But the designation is accepted in both places for consistency.

+4
source

All Articles