[plt-scheme] reading a whole file

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Tue Nov 4 09:58:32 EST 2008

On Nov 4, 2008, at 9:52 AM, Shriram Krishnamurthi wrote:

> Thanks, Robby.
> 1. It might be nice if someone w/ Cookbook access posted this version
> w/ a comment about atomicity.

Could someone explain why the cookbook uses an accumulator and  
reverse? Last time I measured, this improved the performance in Chez  
but not in Mz.

> 2. It is often *awfully convenient* to just read the file in as a
> string.  This semester I'm co-teaching a mini-course for social
> science students, and just about everything we do is content analysis.
>  The files tend to be no more than 10-30k long.  With modern computer
> memories and processing speeds, it's just not worth the effort to do
> anything other than a brute-force "read everything in as one string
> and search over it" unless that proves to be insufficient.  (And doing
> it that way in Python proves to be dreadfully convenient.)  It feels
> to me like a bit like mucking about with fixnums when you could have
> bignums instead.

Do you use regexp on ports? My experience -- via Daniel -- was once  
Matthew included that my code was as short and compact as Python stuff.

> And if you continue to complain, I'll G"odel-encode the file -- since
> you only enjoin against strings, not numbers. (-:

I claim 0 for this message.

Posted on the users mailing list.