% compile this program using "gplc hworld.pl --no-top-level" % put_codes( [C|[]] ) :- put_code( C ). put_codes( [C|Cs] ) :- put_code( C ), put_codes( Cs ). main :- append( "Hello, ", "world!\n", Str ), put_codes( Str ). :- initialization( main ). %%%%%%%%%% % Question: what happens if you define the main predicate "backwards"? % For example: % % main :- put_codes( Str ), % append( "Hello, ", "world!\n", Str ). % % Why does this happen? %%%%%%%%%%