-- -*- mode: eiffel -*-
-- $Id: methcall.se,v 1.2 2001/05/23 18:29:16 doug Exp $
-- http://www.bagley.org/~doug/shootout/
-- from Steve Thompson

-- <LOC-OFF>
indexing
   description: "This class is the entry point for the method call test" 
   author : Steve Thompson
   email  : "Steve_Thompson@prodigy.net"
   date   : February 18, 2001
   compile: "compile -clean -boost -no_split -O3 main.e -o main"
   run    : "main 400000"
-- <LOC-ON>
   
class METHCALL
   
creation make
   
feature -- Creation
   
   make is
      local
     index: INTEGER
     n: INTEGER
     toggle: TOGGLE
     value: BOOLEAN
     nth_toggle: NTH_TOGGLE
      do
     if argument_count = 0 then 
        n := 1
     else
        n := argument(1).to_integer
     end
     
     value := True
     !!toggle.make(value)
     from index := 0 until index = n loop
        value := toggle.activate.value
        index := index + 1
     end

     if value then print("true%N") else print("false%N") end
        value := True
        !!nth_toggle.make(value, 3)
     from index := 0 until index = n loop
        value := nth_toggle.activate.value
        index := index + 1
     end
     if value then print("true%N") else print("false%N") end
        
      end -- make
   
end