On Mon, 05 Nov 2012 15:29:42 +0100 dexen deVries <[email protected]> wrote:
> On Monday 05 of November 2012 10:54:20 you wrote: > > rd without argument (or with a sym) means binary read, it tries to > > read an atom or expression in the binary PLIO format (used by pr). > > Rd with a number argument means to read the given amount of bytes > > as a bignum. The sym argument is an optional end of file flag to > > return instead of the default (NIL). > > > thanks, i get it now :-) > > inspired by recent post on HN, i want to learn picoLisp (at last :P) > by re- implementing some basic UNIX tools. here goes the venerable > cat: > > #!/usr/bin/env plmod > > (mapcar '( > (file) > > (in file > (use X > (until (== NIL > (setq X (rd 1)) ) > (wr X) ) ) ) ) > > (argv)) > > (bye) > > > guess it could be shorter... > Maybe this? (while (opt) (in @ (echo))) Though it doesn't really handle well pipelines (if something downstream dies it doesn't seem to die properly like cat does). > > cheers, cheers, José -- UNSUBSCRIBE: mailto:[email protected]?subject=Unsubscribe
