LearnRholangByExample icon indicating copy to clipboard operation
LearnRholangByExample copied to clipboard

airportInfo outside

Open guilhermehas opened this issue 4 years ago • 2 comments

guilhermehas avatar Apr 30 '20 23:04 guilhermehas

Ahh, good catch. This is indeed a bug. Your fix makes the code run and display the expected output, but it has the nasty side effect that any listener to the airport info can also change it. ATC won't like that.

How about this

// Controllers create new station with private set capability
// and public get capability
new airportInfo in {
  new set in {
    stationFactory!("Weather is nice", *airportInfo, *set)
  }
  |
  // Listener tunes in to receive latest message
  airportInfo!(*stdout)
}

JoshOrndorff avatar May 01 '20 13:05 JoshOrndorff

I think this works

guilhermehas avatar May 01 '20 14:05 guilhermehas