4

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

Here, there is a notion I don't understand: it is the difference between characters. What does mean the difference between characters? So if someone can explain me, I take it!

didierc
  • 14,572
  • 3
  • 32
  • 52
afk
  • 563
  • 2
  • 5
  • 12

2 Answers2

4

[ '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. More generally, foo # bar denotes the set of elements that are in foo but not in bar.

gasche
  • 31,259
  • 3
  • 78
  • 100
4

The # operator specifies the difference between two sets of characters. As a convenience you can use a single character to represent the singleton set that contains just that character. This is much more useful for the operand at the right than the one at the left. But the notation is accepted in both places for consistency.

Jeffrey Scofield
  • 65,646
  • 2
  • 72
  • 108