Create global.di

define foo {
  $bar = $[0]
  global {
    $foo = $bar;
  }
}

foo()