From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <3aaafc130906271117h333de206xd746efe8474e6f35@mail.gmail.com> References: <138575260906260250hca23acbi34aed21566004bad@mail.gmail.com> <3aaafc130906271117h333de206xd746efe8474e6f35@mail.gmail.com> From: Rob Pike Date: Sat, 27 Jun 2009 12:20:06 -0700 Message-ID: <7359f0490906271220q4773f616k7d1a6ec79a3a30bc@mail.gmail.com> To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [9fans] Sam commands in acme Topicbox-Message-UUID: 0fcd1b70-ead5-11e9-9d60-3106f5b1d025 On Sat, Jun 27, 2009 at 11:17 AM, J.R. Mauro wrote: > On Fri, Jun 26, 2009 at 6:57 AM, roger peppe wrote: >> you need (.|\n) instead of . >> >> sam originally used @ as a "match everything" character >> but it was removed, presumably because it was rarely used. > > That's a stupid reason to remove a good feature. By that token, maybe > we should remove structural regular expressions since they're "rarely > used" and just go back to using ed. Indeed, but it's an excellent reason to remove a bad feature. @ was a bad feature. It was hard to use well because @* or @+ would consume the whole file. Plus it was barely a feature, just a convenience entirely equivalent to (.|\n), which, by the way, you almost never see. It went in when we didn't yet know how the all-one-string model of sam would turn out. It turned out just fine and didn't need the @ feature, so out it went. After several years went by without my using it once, while @ simultaneously became useful as a real character so annoying as a metacharacter, out it went. Deletion is the greatest tool of software design. -rob