October 12, 2017

[Product Design] Amber: Variable Scope

The variable stdio in pressed method is defined under the application component. How to define this variable scope rule?

application: {
  stdio: (Console) <- console_window.stdio
  main_window: Window {
    button: {
      pressed: Void %{
        printf(stdio.output, "hello, world")
      %}
    }
  }
  console_window: Window {
  }
}

No comments: