Subject: the obvious. =)

From: "James A. Robinson" <[email-masked]>
Date: Fri, 24 Mar 2000 16:25:07 -0500

I just have to shout to the world (well, to sam fans) that this editor
is wonderful! Now that I'm actually working directly in sam instead of
just using it via a pipe (from wily), I'm amazed at how much easier it
is to do stuff.

One of the things I tend to do in Java is write a method with name X
that takes no args, X(), or takes N args, X(N). X() tends to just pass
some sort of defaults on to X(N).

When writing JavaDoc comments for each method, it's a major pain
a lot of it tends to be a straight copy and paste one to the
other

Now, with sam, I can just write the top java doc comment, and when
I'm finally ready I can just write

,x/^\/\*(.+\n)+ \*\/\n/ t /}\n/

To copy the top comment down to the second method. e.g.

	/**
	 * 1-5 lines describing Foo
	 */
	public void X()
	{
		...
	}
	public void X(N)
	{
		...
	}

turns into

	/**
	 * 1-5 lines describing Foo
	 */
	public void X()
	{
		...
	}
	/**
	 * 1-5 lines describing Foo
	 */
	public void X(N)
	{
		...
	}

sam's slogan ought to be 'Making your life easier through
structured regular expressions.' =)

Jim

---

From: "rob pike" <[email-masked]>
Date: Mon, 27 Mar 2000 09:37:26 -0500

Regular expressions have their limitations, which is why Sam
also has addresses. These provide a simpler and safer way to
match multi-line things like comments:

	,x/^\/\*/ .,/\*\/\n/ t /}\n/

This one works even if there are no blank lines.
Here's a troff paragraph-at-a-time pattern:

	,x/^\.PP/ .,/^\.(PP|SH)/-     ...

Also if there's a slash in the pattern, you can use another character
as the delimiter and save a backslash, as in this example for C++ //
comments:

	x/\/\//  goes to x;//;

Have fun.

-rob