Vocabulary/gotodot

From J Wiki
Jump to: navigation, search

>> <<   Back to: Vocabulary Thru to: Dictionary

goto_lbl. Go to label Control
label_lbl. (target label) Control

Valid only inside an explicit definition.


Make the labelled statement the next statement to be executed

f=: 3 : 0
  if. y do. goto_true. else. goto_false. end.
  label_true.  'true'  return.
  label_false. 'false' return.
)

   f 0
false

   f 1
true