Re:The Text Editor Sam by Rob Pike
by bediger4000 on Wednesday July 05, 2023 @01:27PM
(#36603733)
My memory is slightly hazy, but...
Sam certainly rendered text as lines, like you'd expect, respecting newlines as line breaks.
But it had a different idea about lines of text when it came to regular expressions. There was a metacharacter that matched newlines as if they were just another character, so that regular expressions could match blocks of text spanning multiple lines. A separate metacharacter matched newlines the way vim does.
This and other consequences of treating newline characters as just another character gave Sam a different feel, where lines weren't as important.
Sam certainly rendered text as lines, like you'd expect, respecting newlines as line breaks.
But it had a different idea about lines of text when it came to regular expressions. There was a metacharacter that matched newlines as if they were just another character, so that regular expressions could match blocks of text spanning multiple lines. A separate metacharacter matched newlines the way vim does.
This and other consequences of treating newline characters as just another character gave Sam a different feel, where lines weren't as important.