🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.editors
Article #3742

Re: Editor theory

#3742
From: Richard O'keefe
Date: Fri, 09 Feb 1990 08:55
17 lines
1457 bytes
sja@sirius.hut.fi (Sakari Jalovaara) writes:
>> gap motion delay

The only time you need to move the gap is when you want to insert or
delete and the gap is in the wrong place. 

>One small point I haven't seen mentioned: replace-string in a gap
>editor can be s...l...o...w.  It can be optimized somewhat, though.

Eh?  The buffer gap method is one of the BEST around for search
and replace, because the searching code works with a straight array
of characters.  Yes, when you replace, you may have to move the characters
you traversed, but that gives you a cost of 3N memory references (where N is
the number of characters traversed) instead of 1N or so, and the saving
from using raw pointers into memory instead of going through an abstraction
layer can be _huge_.  I have worked on buffer-gap and piece-table editors
both, and I know which one handled search-and-replace better.
Technical Details
Message-ID: <2848@goanna.oz.au>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!samsung!munnari.oz.au!goanna!ok
References: <1558@aber-cs.UUCP> <1025@uc.msc.umn.edu> <SN_87Eggpc2@ficc.uu.net> <1060@uc.msc.umn.edu> <2691@isc-br.ISC-BR.COM> <19260@bellcore.bellcore.com> <7082@wpi.wpi.edu> <SJA.90Jan23124543@sirius.hut.fi>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!samsung!munnari.oz.au!goanna!ok
From: ok@goanna.oz.au (Richard O'keefe)
Newsgroups: comp.editors
Subject: Re: Editor theory
Message-ID: <2848@goanna.oz.au>
Date: 9 Feb 90 08:55:44 GMT
References: <1558@aber-cs.UUCP> <1025@uc.msc.umn.edu> <SN_87Eggpc2@ficc.uu.net> <1060@uc.msc.umn.edu> <2691@isc-br.ISC-BR.COM> <19260@bellcore.bellcore.com> <7082@wpi.wpi.edu> <SJA.90Jan23124543@sirius.hut.fi>
Organization: Comp Sci, RMIT, Melbourne, Australia
Lines: 17