/tutorial/agent/example1.e
http://github.com/tybor/Liberty · Specman e · 31 lines · 23 code · 5 blank · 3 comment · 0 complexity · 612c332124bbe4e3578e78d20c4e02d0 MD5 · raw file
- class EXAMPLE1
- --
- -- To start with agents, just read this first example.
- --
- create {ANY}
- make
- feature {ANY}
- make
- local
- my_array: ARRAY[STRING]
- do
- my_array := {ARRAY[STRING] 1, << "Benedicte", "Lucien", "Marie" >> }
- my_array.for_each(agent print_item(?))
- end
- feature {}
- print_item (item: STRING)
- do
- number := number + 1
- std_output.put_character('#')
- std_output.put_integer(number)
- std_output.put_character(' ')
- std_output.put_string(item)
- std_output.put_character('%N')
- end
- number: INTEGER
- end -- class EXAMPLE1