For the program test.pl: test :- set_flag(variable_names, check_singletons), compile_term((bar :- Xs = [1,2,3,4], (foreach(X, Xs) do true))). Running on Linux: Version 5.1.0, Wed Nov 22 12:31 2000 [eclipse 1]: [test]. *** Warning: Singleton variables in clause 1 of test/0: X test.pl compiled traceable 304 bytes in 0.00 seconds yes. [eclipse 2]: test. *** Warning: Singleton local variable X in do-loop, maybe param(X) missing? yes. [eclipse 3]: test. yes. A warning is not generated in the second run of test/0. In fact in the first case the do-loop is compiled away, but not in the second case: [eclipse 2]: test. *** Warning: Singleton local variable X in do-loop, maybe param(X) missing? yes. [eclipse 3]: als(bar). bar/0 : Debug_esc =/2 F|NA|CALL Put_listAM A1 Write_integer 1 Push_list Write_integer 2 Push_list Write_integer 3 Push_list Write_integer 4 Write_nil Debug_call do__0/1 L|CALL JmpdP do__0/1 [eclipse 4]: test. yes. [eclipse 5]: als(bar). bar/0 : Debug_esc =/2 F|NA|CALL Put_listAM A3 Write_integer 1 Push_list Write_integer 2 Push_list Write_integer 3 Push_list Write_integer 4 Write_nil MoveAM A3 Put_structureAM A1 foreach/2 etc.Received on Fri Jan 12 14:11:03 2001
This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:08:03 PM GMT GMT