Editors & sequences & dreams

new topic     » topic index » view thread      » older message » newer message

-----Original Message-----
From: Judith Evans <camping at FLASH.NET>
To: EUPHORIA at LISTSERV.MUOHIO.EDU <EUPHORIA at LISTSERV.MUOHIO.EDU>

-- snip----------------

>I'm also working on a stand alone editor that uses the guts of IDE
editor.
>It allows multiple files to be open and switching between files. It is
>working but needs the same fix for scrollbar so I won't post it until
that
>problem is solved.
>
>Thanks,
>Judith Evans

I have also been working on a stand-alone editor (actually attempt #7, #6
got to stage of displaying a file on screen) but it is far from working
(being editable). However it can easily handle very large multiple text
files
(

in a format which consumes *at maximum* 25% (probably about 15% in real
situation) of the memory required when compared to:

{"-- first line of program\n",
"integer dosomething\n",
"dosomething = 0\n"...}

)


and is totally written in Euphoria and will have a truck-load of other
neat stuff eg:

-- neat stuff#1-----------------------------
x = y ^ z + 1 -- this is written in the editor

but

x = power(y, z) + 1 -- this is written to the .ex* file to be run

-- neat stuff#2-----------------------------

sList = sOldlist[1..] -- written in editor

but

sList = sOldlist[1..length(sOldlist)] -- written to .ex* etc..

er, I'll probably need help with a lot of this, that is, if i live long
enough to be at the point of actually asking for help...

Anyway, i have noticed a useful code speed-up that can be used for a large
1-d sequence where insertion of an element is required.

Normally we might have:

-- standard insert code
-- (s is 10000 element sequence of integers)
-- insert at position 4000

s = s[1..3999] & x & s[4000..length(s)]



But, I think that a temporary copy of s (or part/s thereof) is made which
slows things down. try this instead:

-- faster insert code
-- (s is 10000 element sequence of integers)
-- insert at position 4000

s &= 0 -- reserve some space
s[4001..length(s)] = s[4000..length(s)-1] -- move top half up a notch
s[4000] = x -- assign position 4000 with the element


The same principle works for deleting as well. I suppose then that my
editor should also do:

-- neat stuff#3-----------------------------

s: insert(x, 4000)

and expand this to..


s &= 0
s[4001..length(s)] = s[4000..length(s)-1]
s[4000] = x

At the moment i am only dreaming about the pre-process stuff but the code
to manage the handling of multiple files is basically complete and works
really well. Soooo..if anyone could use this stuff please "ask and ye
shall receive".

Yours Truly
Mike

vulcan at win.co.nz

PS: there aint no documentation save what can be gleaned from the code
comments blink

PPS: I check my mail once a week

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu