POV-Ray : Newsgroups : povray.off-topic : how to scheme a cat up? : Re: how to scheme a cat up? Server Time
5 Sep 2024 09:21:34 EDT (-0400)
  Re: how to scheme a cat up?  
From: Warp
Date: 18 Aug 2009 13:26:05
Message: <4a8ae42c@news.povray.org>
Daniel Bastos <dbastos+0### [at] toledocom> 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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.