All pastes #811379 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-12-10 21:20 UTC
rendered paste body
component Counter
  def init
    this count = 0
  def render-on: p
    p heading: count
    [p button: '++' callback: { this count += 1 },
    p button: '--' callback: { this count -= 1 },
    p button: 'OK' callback: { this answer: this count }] render-seperated-by: ' '

task AddTwoNumbers
  def go
    this inform: 'Enter a number.'
    n1 = this call: Counter
    this inform: 'You entered ', n1, '. Enter another.'
    n2 = this call: Counter
    this inform: n1, ' + ', n2, ' = ', n1 + n2