Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!ukma!tut.cis.ohio-state.edu!osu-cis!att!ihlpb!gregg From: gregg@ihlpb.ATT.COM (Wonderly) Newsgroups: comp.editors Subject: Re: UNIX needs a real text editor Message-ID: <10141@ihlpb.ATT.COM> Date: 5 Apr 89 14:06:43 GMT References: <3861@mipos3.intel.com> Organization: AT&T Bell Laboratories - Naperville, Illinois Lines: 42 From article <3861@mipos3.intel.com>, by nate@hobbes.intel.com (Nate Hess): > In article <10099@ihlpb.ATT.COM>, gregg@ihlpb (Wonderly) writes: >> >>The point I was trying to make is that LISP is not a common language base for >>most people. A more procedural language such as TPU looks and feels more >>comfortable. E.g. something like the following is infinitely easier for me to >>read than lisp. > > [TPU example deleted.] > > Hmmm. Easier for *you*, yes, not easier for me. I think that lisp is > an excellent choice as an editor's "native: language. It's a big win to > have the language that you write your editor init file with be the same > language that you type to the editor's command interpreter. If you're > in TPU, looking at a buffer containing the TPU code you defined in your > example, how easy is it to change the buffer, and then instantly > re-evaluate the definition, so that the modified procedure is now > available in your editing session? TPU has two builtin procedures that make this easy. COMPILE takes a STRING or BUFFER or RANGE object and returns an object of type PROGRAM which can be passed to EXECUTE at any time. If the object compiled contains PROCEDURE definitions or other global assignments/definitions those take effect immediately. My VI emulator makes use of this to convert an RE to a TPU PATTERN (two entirely different things). If the pattern is in string format in the variable pat, e.g. (+ is string concat) pat := "LINE_BEGIN & SPAN(' ' + ASCII(9)) & 'switch'"; which represents the RE "^[ \t]*switch", I can say EXECUTE (COMPILE ("vi$global_var :=" + pat)); pos := SEARCH (vi$global_var, FORWARD, EXACT); to store the first location of text matching the pattern into the variable 'pos' (searching forward, matching case exactly). It really is superior to lisp and a lot more readable! -- Gregg Wonderly DOMAIN: gregg@ihlpb.att.com AT&T Bell Laboratories UUCP: att!ihlpb!gregg