Saturday, February 21, 2009

Even more whitespace sensitive languages

Michael Tschantz, on Maude: "Man, I can't believe this thing lets you overload [white]space. I mean, that's the most warped thing I've seen since C."
We all know python is whitespace sensitive, as are some more esoteric languages. I've always been annoyed by inconsistent handling of whitespace in HTML by web browsers, which impacts the styling layers. More recently, I realized that CSS uses whitespace as a combinator as part of the rule selector language: "div + li" employs two predicate combinators, "+" and " ".

More fun? Wikis peano-encode whitespace, so one whitespace looks like a space, while two might mean a code block with special formatting.

Reddit, as part of their comment system, uses different semantics for peano-encodings of sequences of one, three, and four whitespaces, and possibly more. Apparently, not all of their users get it right, either.

No comments: