Sha256: aa42d1abe7502296b591fd743340e1f5d6d78596bc1f71a8b8486cecb5b2c52d

Contents?: true

Size: 290 Bytes

Versions: 5

Compression:

Stored size: 290 Bytes

Contents

def foo: block {
  1 upto: 10 do: |i| {
    val = block call: [i]
    if: (block call: [i]) then: {
      return i # non-local return from "foo:"
    }
  }
  return "yay"
}

foo: |x| { x == 6 } . println
foo: |x| { x == 0 } . println
foo: |x| { return_local true } . println # local return

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fancy-0.7.0 examples/return.fy
fancy-0.6.0 examples/return.fy
fancy-0.5.0 examples/return.fy
fancy-0.4.0 examples/return.fy
fancy-0.3.3 examples/return.fy