fork.sf 166 B

1234567891011
  1. #!/usr/bin/ruby
  2. #
  3. ## https://rosettacode.org/wiki/Fork
  4. #
  5. var x = 42;
  6. var child = { x += 1 }.ffork;
  7. say child.wait; # prints: 43
  8. say x; # but x is still 42