sam-fans - fans of the sam editor
 help / color / mirror / Atom feed
From: John (For the colours are many, but the light is one.) Mackin <john@ civil.su.oz.au>
To: Sam Fans <sam-fans@hawkwind.utcs.toronto.edu>
Subject: good move Chris
Date: Wed, 18 Nov 1992 21:12:05 -0500	[thread overview]
Message-ID: <199211191312.1153.sam.babaf@civil.su.oz.au> (raw)
In-Reply-To: <92Nov18.204207est.2795@hawkwind.utcs.toronto.edu>

Thanks for creating this list.  One day perhaps I will have time to
do something with the new sam.  If anyone _does_ do scrolling menus
please let me know, else I will have to do it myself, in my copious
spare time.

Should an article advertising the existence of this list be posted
to comp.editors?

Now, finally, I have an audience to ask a question that has been
bothering me for YEARS.  Historical background: I first used sam
on a Jerq in 1989, hosted by a VAX-11/780 running Eighth Edition.
That version of sam (the `Pike original') didn't have what I call
`tagged REs'; you could use parentheses as you liked as grouping
operators in REs, but that was _all_ they did.  You could not use
\<digit> on the right hand side of an s command to represent `what
the n'th paren part matched.'

I have always wanted to believe that Pike designed the command language
of sam (composition of structural REs) with great precision, and I was
disturbed to find, in the V8 days, that there appeared to be absolutely
no way to accomplish the standard two-column interchange of ed: suppose
you have a file with two words per line separated by one space, and
you want to exchange them on each line, you

[[NOTE, this is an _ed_ command]]

1,$s/\(.*\) \(.*\)/\2 \1/

I found that literally _impossible_ in the Pike original sam.  I tried
hard, but always ended up with the dread "changes out of sequence".

The further history of this is that my friend and colleague Noel Hunt
(you on this list, Noel?  If not, you should be!) decided that he was
going to add tagged REs to sam, and he did it.  That code got sent back
to Pike, and it appears now in the version of sam that they've distributed.
I have always wondered (but never been brave enough to bother Pike)
what the full story is.  Challenge: can anyone find a sam command
to accomplish the exchange _without_ using \<digit> on the right
side of an s command?  (Note: please don't mail me any _theories_ about
this; I worked at it for some days, and have already tried whatever
you have theorised.  I'm only interested if you have tested it in
sam and it worked.)

OK,
John.


  reply	other threads:[~1992-11-19  2:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1992-11-19  1:42 My patches Chris Siebenmann
1992-11-19  2:12 ` John Mackin [this message]
1992-11-19 22:21 ` Scott Schwartz

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=199211191312.1153.sam.babaf@civil.su.oz.au \
    --to=john@civil.su.oz.au \
    --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).