[REBOL] Re: Limiting Serie sizes (native!)
From: Rebolinth:nodep:dds:nl at: 13-Aug-2003 18:02
Quoting Maxim Olivier-Adlhoch
Yes im using something like that right now, but My idea behind was more like:
* Protecting runaway code
- Wrong functions can fillup block cq. memory in milliseconds
* Limiting the code in the begining in the header ie. REBOL [ blocks/limit 65535 ]
* Controlling static ends, that saves extra functions for controlling serie lengths.
* Perhpas dynamicly extending/descreasing the limit during serie use?
But on the other hand I can emagine the structure of rebol
to suffer under this enhancement too, its not dynamic anymore, BUT
if you could control memory size by limiting serie sizes??
I think the idea above could be a contradiction on the idea Carl has about the
dynamic behaviour of rebol ;-)
-> If it where added it would have to be something off by default...
-> also, It'd have to be appended as a refinament in all series based
-> functions (like the /open refinement).
-> and setting /limit to none would allow the block to grow once more...
-> BUT you can already easily clip length after
-> > list: [1 2 3 4 5 6 7 8 9 0]
-> > head clear at list 4
-> == [1 2 3]
-> maybe this function helps in what you want to acheive?
-> clipped-append: function [series data maxlen][
-> return all [((length? series) < maxlen ) (append series data)] ; or call
-> throw if you want an error