> Computer Scientists (and old-time vi aficionados) love to optimize things like this... :)
 
Even if it doesn't produce more obfuscated code?  :)
 
Hartmut Sager


On 13 May 2014 14:39, Gilbert E. Detillieux <gedetil@cs.umanitoba.ca> wrote:
On 13/05/2014 2:08 PM, Michael Doob wrote:
Date: Mon, 12 May 2014 15:42:28 -0500
From: John Lange <john@johnlange.ca>
To: "Roundtable, MUUG" <Roundtable@muug.mb.ca>
Subject: [RndTbl] The Oldest Rivalry in Computing

This mailing list is the only place I can think of where I could possibly
share this article:

"Emacs and Vi have been battling for text-editor supremacy among
programmers for 40 years."

http://www.slate.com/articles/technology/bitwise/2014/05/oldest_software_rivalry_emacs_and_vi_two_text_editors_used_by_programmers.html



John
...
Note that the author's vi example to put quotes around lines:

%s/\(^\|$\)/\"/g

only works if ^ .ne. $, that is, the line is nonempty.

(Sorry, mathematicians just love to point out things like this).

Maybe this would work better...

%s/.*/"&"/

It's a lot briefer, and IMHO, more obvious.

Computer Scientists (and old-time vi aficionados) love to optimize things like this... :)

--
Gilbert E. Detillieux           E-mail: <gedetil@muug.mb.ca>
Manitoba UNIX User Group        Web:    http://www.muug.mb.ca/
PO Box 130 St-Boniface          Phone:  (204)474-8161
Winnipeg MB CANADA  R2H 3B4     Fax:    (204)474-7609
_______________________________________________
Roundtable mailing list
Roundtable@muug.mb.ca
http://www.muug.mb.ca/mailman/listinfo/roundtable