This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Shell-style programming in Kawa


On Feb 12, 2014, at 2:16 PM, Per Bothner <per@bothner.com> wrote:

> I checked in a new 'pipe-process' macro.  I updated the blog page
> (search for the "Pipe-lines" section):
> http://per.bothner.com/blog/2014/Kawa-shell-programming/

Excellent, thanks.

> You might also find interesting the implementation: It's
> my first macro/function combination where the "validate"
> handler is written in Scheme.  See kawa/lib/system.scm.
> It's a little klunky, but not too bad.

Very cool.  Is there something special about how kawa.lib.system
definitions get loaded?  If I copy/paste pipe-process, %pipe-process,
and pipeProcessValidateApply into a new file with slightly changed
names (appending '2' to each), the validate-apply key gets ignored:

#|kawa:1|# (require test.test_inlining)
#|kawa:2|# (pipe-process2 "abc\ndef" &`{grep a})
java.lang.RuntimeException: %pipe-process2 called

It still fails if I point to the real pipeProcessValidateApply, too:

(define-procedure %pipe-process3
  validate-apply: "kawa.lib.system:pipeProcessValidateApply"
  (lambda (e1 e2)
    (java.lang.RuntimeException "%pipe-process3 called")))

#|kawa:3|# (pipe-process3 "abc" &`{grep a})
java.lang.RuntimeException: %pipe-process3 called


--
Jamison Hope
The PTR Group
www.theptrgroup.com




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]