From mboxrd@z Thu Jan 1 00:00:00 1970 Subject: Re: [9fans] sam command language Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v552) From: Rob Pike To: 9fans@cse.psu.edu Content-Transfer-Encoding: 7bit In-Reply-To: <8956812abe51c0fe7669680d4d907d9a@vitanuova.com> Message-Id: Date: Mon, 6 Oct 2003 08:08:45 -0700 Topicbox-Message-UUID: 623b784c-eacc-11e9-9e20-41e7f4b1d025 > for instance, suppose i've got a little sam expression that nicely > isolates particular subregions of text. i can't work out a way to > match only characters which appear at the very beginning (or end) of > "dot". kind of similar to ^ and $ except with respect to the > boundaries of the current selection. long ago, i considered making ^ and $ mean this in sam. they clearly need to mean beginning and end of line at the top level, but when we x down, maybe they should mean beginning and end of the substring. i think i even tried to implement it. in any case, i decided against it; i think it was a combination of not liking the shift in meaning and the fact that ^ and $ meaning bol and eol at the top level meant that they required special handling already, since sam really doesn't know much about lines, unlike ed. if the whole file is just one long string, which is exactly how sam works, shouldn't ^ and $ then mean beginning of file and end of file? that's not very useful. and then, in the end, i felt the need for the modified version of ^ and $ so rarely that i don't really mind not having them. unlike in the modern world, back then adding a feature was considered something to consider carefully, rather than just adding it in case someone might conceivably want it one day. -rob