Multiple initialization of files with different extensions

We know we can start SWI and initi/load/consult many files at once:

$ swipl file1.pl file2.pl file3.pl ....

However, if for some reasons the files have different extensions (e.g., come from ASP code, but still plain LP) it does not work (note extensions of files):

$ swipl file1.lp file2.lp

will load the FIRST one (here file1.lp) but nothing on the second file will be loaded.

Is this the expected behavior?

It has been intended to work that way. The idea is that you need at least one file to load. This also make #!/usr/bin/env swipl work regardless of the extension. Anything that follows are application arguments. You can of course make sure that the first line starts the application and loads the *.lp files that follow.

I see. So the non .pl files are treated as arguments, not as Prolog files. Makes sense. I can make my Prolog file to see if arguments (files her) were given and in this case consult them.

Thanks, got it!