[Prev][Next][Index][Thread]

Re: Critique a first prog?



Hi,

I think your program would be clearer if you wrote it something like
this:


define function process-file(input-filename, output-fs)
  with-open-file(input-fs, locator: input-filename)
    let line = #f;
    while(line := read-line(input-fs, on-end-of-stream: #f))
      if(goodline?(line))
        write(output-fs, line);
      end;
    end;
  end;
end;



// in main
  with-open-file(output, locator: output-filename)
    process-file(input-filename, output);
  end;


Sent via Deja.com http://www.deja.com/
Before you buy.



References: