|
|
|
|
|
by kazinator
3892 days ago
|
|
> opposite to the Unix philosophy Bash: $ foo()
{
bar ()
{
echo I am bar
}
}
$ bar
bar: not found
$ foo
$ bar
I am bar
Pretty much the same thing as the Ruby example.This is simply because function defining is a kind of statement or expression with a side effect which must be evaluated. The side effect is global (a name is globally associated with a function). So if the side effect is in a function body, its evaluation is delayed until the function is called, and then its effect is still global. |
|
Does this work in Plan 9 rc?