Possible to use /usr/bin/watch to call a function?

http://www.unix.com –
I want to have a script both define functions and have the ability to run an external program calling one of them. This is the simplified construct:
Code:
#!/bin/bash
foo() {
echo "this is foo"
}
bar() {
echo "this is bar"
}
case "$1" in
one)
foo
;;
two)
export bar
/usr/bin/watch bar
;;
*)
echo $0 "{one|two}"
exit 0
;;
esac
So if I invoke /path/to/script one the foo function
(HowTos)

Stories similar to Possible to use /usr/bin/watch to call a function?

In the following program though most of the working part of the program is commented out, it gives seg fault. reducing the value of MAX to say 10000 removes the seg fault. Why is this happening? it should be only 1 MB only. Is 1 MB too big for an array?

I run F12. Since some days my laptop has become very sluggish. In Mozilla, switching between the tabs takes like seconds instead of fraction of a second. Also minimizing and mximizing windows takes long. Switching between the windows too takes long. Now I can't see the cursor while typing this post.