sam-fans - fans of the sam editor
 help / color / mirror / Atom feed
From: Alan Watson <alan@oldp.astro.wisc.edu>
To: sam-fans@hawkwind.utcs.toronto.edu
Subject: Re: Lines and last lines.
Date: Tue, 1 Dec 1992 14:27:59 -0500	[thread overview]
Message-ID: <9212011928.AA21580@oldp.astro.wisc.edu> (raw)

Several points.

Yes, I should have said that the undefined semantics of a final line
without a newline went somewhat against sam's philosophy that files
are arbitrary streams of TEXT.

The default for x is more subtle that I at first supposed, and is
useful not just when the final line of the FILE is not terminated by a
newline, but also when the final line of the RANGE is a partial line.

As to the behaviour of "x /RE/", clearly I misread the somewhat
contradictory documentation.  The sam paper states on page 6 that
"blanks in these examples are to improve readability; sam neither
requires nor interprets them."  The sam tutorial states on page 11 "if
x is followed immediately by a space, the pattern .*\n is assumed."
The man page states on page 5 that "if the regular expression and its
slashes are omitted /*.\n/ is assumed."  Is putting a space between
the x and the RE really an omission of the RE?  Apparently it is.

I don't like white-space to have sematic content (other than to serve
as a separator and terminator).  While I like the default for

	x ...

I think I might have prefered

	x /RE/...

to be equivalent to

	x/RE/...

but I guess one might argue that the difference is needed to
disambiguate

	x/RE/ ...

and
	x /RE/...

although the latter could have been written without ambiguity as

	x {
	/RE/...
	}

Can anyone think of a situation where one might want to use "x /RE/..."?

Many a time I too have blessed emacs for allowing me to edit binary
files.  Howevere, all is not lost with sam, due to it's superbly
flexible shell escapes.  All one needs a filter which takes a binary
file and writes out octal, and vice verse; one then uses ",<" and ",>"
to read an write binary, whilst editing the octal representation.

Alan.


             reply	other threads:[~1992-12-01 19:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1992-12-01 19:27 Alan Watson [this message]
  -- strict thread matches above, loose matches on Subject: below --
1992-12-01 19:54 Byron Rakitzis
1992-12-01  7:57 Byron Rakitzis
1992-12-01  7:11 Michael John Haertel
1992-12-01  7:01 Alan Watson
1992-12-01  5:08 Byron Rakitzis
1992-12-01  0:40 Alan Watson
1992-12-01  5:46 ` Chris Siebenmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9212011928.AA21580@oldp.astro.wisc.edu \
    --to=alan@oldp.astro.wisc.edu \
    --cc=sam-fans@hawkwind.utcs.toronto.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).