Re: `rd' behavior

2012-11-07 Thread Axel Svensson
Also, a + at the end of the command line is special; it turns on *Dbg and is not included in (argv). bare dash. is there any way around it? Make a wrapper like this: #!/bin/bash /usr/bin/picolisp /usr/lib/picolisp/lib.l file.l +++ $@ +++ Then in file.l, remove the extraneous +++: (setq

Re: `rd' behavior

2012-11-06 Thread dexen deVries
Hi Jose, Alexander, HOn Monday 05 of November 2012 16:15:39 you wrote: (...) and instead of 'argv' use 'opt': (while (opt) (in @ (while (rd 1) (wr @) ) ) ) and thus we are almost at José's solution ;-) thanks you both for explanations, it helps a lot :-)

Re: `rd' behavior

2012-11-06 Thread Alexander Burger
Hi Dexen, * by default, many derivative cat use single, bare dash (`-') to stand for /dev/stdin, but picolisp (the interpreter) seems to skip arguments after first bare dash. is there any way around it? Right, a single dash has a special meaning on the command line. It inhibits the

Re: `rd' behavior

2012-11-05 Thread José Romero
On Mon, 05 Nov 2012 14:37:07 +0100 dexen deVries dexen.devr...@gmail.com wrote: hello list, why does `rd' return NIL in simplest use ('sym or NIL argument): (in info.txt (print (rd] while it seems to work fine with 'cnt argument: (in info.txt (print (rd 1] guess i'm doing

Re: `rd' behavior

2012-11-05 Thread dexen deVries
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

Re: `rd' behavior

2012-11-05 Thread dexen deVries
On Monday 05 of November 2012 15:29:42 dexen wrote: (...) here goes the venerable cat: ..and a bugfix -- support the all-important - ;-) #!/usr/bin/env plmod (mapcar '( (file) (in (if (= file -) NIL file ) (use X

Re: `rd' behavior

2012-11-05 Thread José Romero
On Mon, 05 Nov 2012 15:29:42 +0100 dexen deVries dexen.devr...@gmail.com 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

Re: `rd' behavior

2012-11-05 Thread Alexander Burger
Hi Dexen, 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: OK, so let me refine it. As already pointed out by José, it could be simply reduced to 'echo'. However, if you do it by hand,