[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: [QUIZ] Editing Text (#145

Terry Poulin

10/30/2007 7:33:00 PM

One Quiz I would love to participate in... If onyl I had the time.


How Text Editors work has always been an interest of mine but sadly one I've
never really have been able to pursue.



Considering this was a long time ago (before I learned Ruby). The idea that I
had (yes C was my primary language at the time), was just to test the concept.


Was to create a two-way linked list the length of every character in the file.
Where each node of the list contained a simple set of boolean values
indicating that the current character is the start/end of a
paragraph/line/word, if it is a space or \n e.t.c. And eventually just for fun
work on a way to swap parts of the file into and out of memory and a temporary
file.


I figured that it would be grossly inefficient if every character in the text
was a segment like that in memory but a little less in depth to code a 'Hmm I
wonder if this would work' scratch project then mucking through a BST ;-)



I never really had time to play with it through, considering if I wanted to
use line editor I would just use /bin/ed instead of /usr/bin/vi hehe. Although
I do admit if I ever did have time... I would probably still do it in C rather
then Ruby because I'm more comfortable with C's I/O.


TerryP.


--

Email and shopping with the feelgood factor!
55% of income to good causes. http://www.ip...