Daniel Bastos <dbastos+0### [at] toledo com> wrote:
> How strong are my imperative ways?
> #!/usr/bin/env mzscheme
> (module cat scheme/base
> (define (cat)
> (let ([ln (read-line)])
> (if (not (eq? ln eof))
> (and (display ln) (newline) (cat))
> (exit) )))
> ; main
> (cat)
> )
> %fortune | ./cat
> Let me put it this way: today is going to be a learning experience.
> %
> How would you scheme up your cat?
'cat' is a program for concatenating files. It's used like:
cat file1 file2 file3 > concatenated_files
Your program does not fulfill this role.
(Some people abuse 'cat' to concatenate one single file with nothing,
but that doesn't mean that the role of 'cat' is anything else than
concatenating files.)
--
- Warp
Post a reply to this message
|