At 09:46  -0400 2007/05/24, Raul Miller wrote:
On 5/23/07, Joey K Tuttle <[EMAIL PROTECTED]> wrote:
In Unix/Linux/Darwin I find the following 2!: cover convenient/essential
  host =: [: 2!:0 '(' , ' || true)' ,~ ]

Does this do anything better than
  host0=: 2!:0 ::0:
?

Well, not that I can think of (Martin?) - just a way to get a
result back from the j verb when the requested host expression
failed. Yours is shorter and very nice - even a useful result
if one checks for numeric result (impossible as a result of
remote execution - I think) indicating an error. Maybe not as
handy if building a result in jspace by catenating successive
calls, but I don't remember ever doing that.

Since the standard error comes back in addition to the
obverse result, I would be inclined to make the failure
result 2: (or something other than 0 which usually indicates
all ok -- but that it a minor matter of taste.)

Thanks for the nice cleanup/improvement!

- joey
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to