[REBOL] Re: Line reduction
From: joel::neely::fedex::com at: 5-Jul-2001 15:20
Hi, Aaron,
You've gotten some good suggestions from other folks; I'll only
add responses to a couple of the specific questions you raised.
[aroberts--swri--edu] wrote:
> 1. The data file could have numbers like so: 34564 23512 18372.
> As a string, this takes 15(17 with spaces) bytes of memory.
> The number representation would take 2 bytes per value or 6
> bytes total. Its much faster to search thorough 6 bytes than
> 15(17). Since I'm working with the file as a huge string, is
> there a faster way to do what I'm doing, capitalizing on the
> fact all the data is numerical data?
>
I haven't done the benchmarking to back this up, but I believe
there isn't any gain converting to numeric types. You'd still
have to read through the entire source file (whether all at
once or in parts) and write all output text (whether all at
once, etc.) Adding the conversion from string to number and
then from number back to string doesn't sound to me like it
would save anything.
> 2. Is there a way to not type cast all of my inputs?
>
I assume you're referring to the need to apply TO-FILE prior to
reading/writing files and TO-INTEGER prior to arithmetic.
No. You can't eliminate that.
> 3. What editor would one recommend for using rebol?
> I prefer to have stylized text if possible.
>
I use Vim, freely available from http://www.vim.org/ for a large
number of platforms (about as many as REBOL ;-) Vim supports
syntax coloring, and a considerable number of extensions beyond
the functionality of vi (its ancestor).
I like having a language that works the same on all platforms I
routinely use, and I like having an editor that does likewise!
-jn-
--
___________________________________________________________________
The purpose of computing is insight, not numbers!
- R. W. Hamming
joel'dot'neely'at'fedex'dot'com