Closed agent arguments

Wolfgang Jansen <[email protected]>
Newsgroups gmane.comp.lang.eiffel.smalleiffel
Organization University of Potsdam, Institute of Informatics
Message-ID <[email protected]>
Hi,

I detected a spurious behaviour of agents if the program
had been compiled by SE2.*. Consider the following class:

class X creation make

feature
  make is
    do
      n := 3
      func := agent run(n)  -- closed_arg=5 at agent creation time
      n := 5
      func.call([])         -- uses new value of `n' for closed_arg
    end

  n: INTEGER
  func: PROCEDURE[ANY,TUPLE]

  run(i: INTEGER) is
    do
      print(i.out);  print("%N")
    end

end

When running, the program prints 5 while one would
expect 3 (and 3 is also the output if compiled by SE1.1).
Is this a bug or a new language feature?
In case of the latter, where has it been described?

Best regards
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.