On Fri, Sep 02, 2011 at 02:00:01AM +0700, Henrik Sarvell wrote:
> Lately I've been reading parts of this funny document:
> http://www.catb.org/~esr/writings/taoup/html/ (The Master Foo section is
> especially funny:
> http://www.catb.org/~esr/writings/taoup/html/ten-thousand.html )

LOL Indeed!

> Anyway I thought that perhaps it would be possible to somehow bypass the
> need for an actual physical file as input to these UNIX commands and one of
> ...
> Here the result of a little fiddling:

Godd idea. Directly using the 'pipe' function is quite clumsy and
confusing. I have to look up the ref each time.

> #(println (match> '+Cmd "apa" "apa hej pa dig"))
> (dm match> (Search Str)
>    (<> 0 (any (awk> This (pack "print match($0, /" Search "/)") Str))) )

Minor improvement: You could avoid the extra number conversion with
'any' by directly checking (<> "0" (awk> ...)).

> In most cases it won't matter probably, invoking sed, awk et al should
> however entail a lot less overhead for a busy application.

I feel so too.

- Alex
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to