load: use AssocData to free load handles

Instead of an explicit call in jim.c, store load
handles as AssocData so that it is automatically cleaned up.

Signed-off-by: Steve Bennett <steveb@workware.net.au>
pid: error message is now tcl 8.6 compatible

Signed-off-by: Steve Bennett <steveb@workware.net.au>
tests: fix tests if tclcompat is not enabled

Signed-off-by: Steve Bennett <steveb@workware.net.au>
exec: respect $::env even without tclcompat

Otherwise there is no way to affect the environment for exec

Signed-off-by: Steve Bennett <steveb@workware.net.au>
tclcompat: it is finally time to remove [case]

Use [switch] instead

Signed-off-by: Steve Bennett <steveb@workware.net.au>
jim-aio.c: Fix possible compile error for JIM_ANSIC

Signed-off-by: Steve Bennett <steveb@workware.net.au>
jim-aio: don't bother storing fcntl(F_GETFL)

Signed-off-by: Steve Bennett <steveb@workware.net.au>
tests: Don't stop on the first error

But still return non-zero if there are any errors
On some systems there are known test failures

Signed-off-by: Steve Bennett <steveb@workware.net.au>
aio: open |... should use ::popen

In case not in the global namespace

Signed-off-by: Steve Bennett <steveb@workware.net.au>
aio: simplify JimMakeChannel()

Signed-off-by: Steve Bennett <steveb@workware.net.au>
array: error msg for odd length array get

Currently an error is set, but with no message

Signed-off-by: Steve Bennett <steveb@workware.net.au>
sleep: support sub-second sleep > 1

e.g. sleep 1.5

Signed-off-by: Steve Bennett <steveb@workware.net.au>
stdlib: errorInfo includes the live stacktrace

Rather than just the error backtrace ([info stacktrace]),
include the live stacktrace. This means it is possible to do:

  if {[catch $script msg]}
    puts [errorInfo $msg]
  }

to output the stack trace from the top level, not just from the point of capture.

It is still possible to pass a stacktrace to errorInfo to override this behaviour.

Signed-off-by: Steve Bennett <steveb@workware.net.au>
doc: improve documentation for bgerror

Signed-off-by: Steve Bennett <steveb@workware.net.au>
eventloop: various minor code cleanups

warn at compile time if subsecond sleep in [after] is not supported
Simplify time handling by keeping all times in milliseconds since initialisation.
No need for any sleep on -ve time
Use memset() in initialisation of eventLoop

Signed-off-by: Steve Bennett <steveb@workware.net.au>
exec: remove duplicate code

Two versions of the "trim trailing space" function

Signed-off-by: Steve Bennett <steveb@workware.net.au>
exec: fix reaping of detached processes

Signed-off-by: Steve Bennett <steveb@workware.net.au>
exec: better handling of SIGPIPE

Signed-off-by: Steve Bennett <steveb@workware.net.au>
file: simplify [file stat], var now optional

The varname is now optional. The return value is a dictionary.

Signed-off-by: Steve Bennett <steveb@workware.net.au>
clock: handle case of format string too long

Signed-off-by: Steve Bennett <steveb@workware.net.au>