<commit_before># coding: utf-8

#* library/fiber_library.rb - The fOOrth Fiber class library.
module XfOOrth

  #Define the Fiber class.
  Object.create_foorth_subclass('Fiber').new_class

  #The fOOrth Fiber class.
  class XfOOrth_Fiber

    #Tag for newly created fibers.
    NEW   = "new".freeze

    #Tag for running fibers.
    ALIVE = "alive".freeze

    #Tag for defunct fibers.
    DEAD  = "dead".freeze

    #Build up the fiber instance. A fiber is a light-weight coroutine.
    def initialize(stack=[], &block)
      @stack = stack
      @fiber = Fiber.new &lambda{|vm| block.call(vm); nil}
      @status = NEW
    end

    #Return this fiber as a fiber.
    def to_foorth_fiber
      self
    end

    #What is the status of this fiber?
    def status
      @status || DEAD
    end

    #Let the fiber run for one step.
    def step(vm)
      vm.data_stack, vm.fiber, @save = @stack, self, vm.data_stack<commit_msg>Refectored fiber initialize method.<commit_after># coding: utf-8

#* library/fiber_library.rb - The fOOrth Fiber class library.
module XfOOrth

  #Define the Fiber class.
  Object.create_foorth_subclass('Fiber').new_class

  #The fOOrth Fiber class.
  class XfOOrth_Fiber

    #Tag for newly created fibers.
    NEW   = "new".freeze

    #Tag for running fibers.
    ALIVE = "alive".freeze

    #Tag for defunct fibers.
    DEAD  = "dead".freeze

    #Build up the fiber instance. A fiber is a light-weight coroutine.
    def initialize(&block)
      @stack = []
      @fiber = Fiber.new &lambda{|vm| block.call(vm); nil}
      @status = NEW
    end

    #Return this fiber as a fiber.
    def to_foorth_fiber
      self
    end

    #What is the status of this fiber?
    def status
      @status || DEAD
    end

    #Let the fiber run for one step.
    def step(vm)
      vm.data_stack, vm.fiber, @save = @stack, self, vm.data_stack
{'fraction_non_alphanumeric': 0.09403546480386889, 'fraction_numerical': 0.0010746910263299302, 'mean_word_length': 2.5399239543726235, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6594910', 'n_tokens_mistral': 662, 'n_tokens_neox': 629, 'n_words': 204}