vile / scheme / syntax_pattern_atom.v
13 lines · 12 sloc · 496 bytes · 76646891b77a3d5c6af4a1e42b122cd61dc1654b
Raw
1module scheme
2
3// equal? restricted to non-list, non-vector, non-symbol pattern data. Avoid
4// the general graph comparator's work stack for these atomic comparisons.
5@[inline]
6fn syntax_pattern_atom_equal(expected Value, actual Value) bool {
7 if expected.tag != actual.tag { return false }
8 return match expected.tag {
9 .string { expected.text() == actual.text() }
10 .bytevector { expected.bytevector_pointer().bytes == actual.bytevector_pointer().bytes }
11 else { eqv(expected, actual) }
12 }
13}
14