Skip to content

58 Named callback parameters ​

The callback parameter title is available in the first trailing block. renamed in chooses a local name for the same supplied value in the second.

norm
Void submit(Void completed(String title)) {
  completed("Learn Norm")
}

main() {
  submit {
    printLine(title)
  }
  submit { renamed in
    printLine(renamed)
  }
}

Expected output:

text
Learn Norm
Learn Norm

Try it: Change the submitted title and verify both callbacks receive it.

Precise rules: Reference.

Norm 0.25