Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: minor module tweak



Bart Schaefer wrote:
> So it's fine that you documented this, but I think it was implicit all
> along in the phrase "prints an error message and returns a non-zero
> status."  (If it were going to abort the code block, it couldn't return
> a status, could it?)

Yeahburrid didn't say that before...

-ignored.  Otherwise tt(zmodload) prints an error message.
+ignored.  Otherwise tt(zmodload) prints an error message and returns
+a non-zero status.  The current code block is not aborted unless
+tt(zmodload) detects an inconsistency, such as an invalid module name
+or circular dependency list.  Hence `tt(zmodload -i) var(module)
+tt(2>/dev/null)' is sufficient to test whether a module is available.
+If it is available, the module is loaded if necessary, while if it
+is not available, non-zero status is silently returned.

You're right that I've been a bit wordier in the change then necessary,
but I think it's useful to say that the code block is aborted on an
inconsistency (though I could have phrased that the other way round, so
the nitpicking version might read "If tt(zmodload) detects an
inconsistency ... the current code block is aborted") and the final
sentence applies specifically to the behaviour of the example.

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


To access the latest news from CSR copy this link into a web browser:  http://www.csr.com/email_sig.php

To get further information regarding CSR, please visit our Investor Relations page at http://ir.csr.com/csr/about/overview



Messages sorted by: Reverse Date, Date, Thread, Author