1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
#!/bin/sh
. ${SHOOPSH:-/usr/share/shoop/shoop.sh}
. ${SHOOPMOD:-/usr/share/shoop/modules}/use.sh
OBJECT . use introspect serialize final destroy thread prettyprint
_USE . showdeps
THREAD . new TT
TT . run : '
local a;
for a in $(seq 1 5);do
echo $a;
sleep 1;
done
'
#TT . start
#sleep 3
#TT . wait
#exit
echo some counters:
OBJECT . counter = 10
echo
OBJECT . count : '$THIS . counter = $(expr $($THIS . counter) + 1); return'
OBJECT . test = 20
OBJECT . final test
echo
OBJECT . count
echo
OBJECT . new FOO
OBJECT . new BAR
BAR . parent = A B FOO C D OBJECT > /dev/null
BAR . test
echo
# This will produce an error.
BAR . blah
FOO . count : '$THIS . counter = $(expr $($THIS . counter) \* 2 + $($THIS . super)); return'
FOO . counter = 1
echo
FOO . count
echo
FOO . count
echo
FOO . count
echo
OBJECT . count
echo
echo introspecting BAR
BAR . introspect
OBJECT . prettyprint
echo introspecting FOO
FOO . introspect resolve
echo serializing OBJECT
#OBJECT . serialize
echo serializing FOO to temporary file
FOO . serialize > FOO.sh.tmp
echo destroying FOO
FOO . destroy
set | grep FOO
echo loading FOO
. ./FOO.sh.tmp >/dev/null
rm -f FOO.sh.tmp
FOO . count
echo
|