Hi dean,


I would probably do this:

: (in '(ls) (make (until (eof) (link (line T)))))
-> ("app" "bin" "CHANGES" "COPYING" "CREDITS" "cygwin" "db2" "dbg"
"dbg.l" "dev" "doc" "doc64" "ersatz" "ext.l" "games" "img" "INSTALL"
"lib" "lib.css" "lib.l" "loc" "man" "misc" "picoblogorg" "pil" "plmod"
"rcsim" "README" "simul" "src" "src64" "test")

Some comments:

pil makes it easy to experiment. I would first start with this experiment:

: (in '(ls) (line T))
-> "app"

We see that it returns a single item. So, we want to build a list of
multiple items. An efficient way to do this is with make/link. We can
loop until eof using (until (eof))

Hope this helps!

On Fri, Nov 11, 2016 at 8:07 AM, dean <deangwillia...@gmail.com> wrote:
> I'm just wondering how you would capture the output from 'ls' to a list for
> further processing.
> I the first instance...I'd like to cd to a specified dir and caputure all
> subdir names so that I can
> cd to them in turn and process their pdf files, labelled 2005.pdf, 2006.pdf
> etc
> I've been playing around with the examples
> I tried to bend this
> https://rosettacode.org/wiki/Get_system_command_output#PicoLisp
> : (in '(uname "-om") (line T))
> to
> : (in (call 'ls) (line T))
> but no-go
> Thank you in anticipation for your consideration and for
> creating and supporting such an interesting little language.
> BTW This is my very first lisp program let alone picolisp program.
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to