Re: Ann: SWI-Prolog 6.5.2

Jan Wielemaker <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <[email protected]>
On 08/22/2013 02:31 PM, Kilian Evang wrote:
> Hi Jan, all,
> 
> On 22-08-13 14:12, Jan Wielemaker wrote:
>>  * MODIFIED: The =argv= Prolog flag now only contains _unprocessed_
>>    commandline arguments.  This change is primarily for improving
>>    compatibility with other systems (e.g., YAP, SICStus).  A new flag,
>>    called =os_argv= provides the original complete list of arguments.
>>
>>    Unfortunately, some code must be updated to deal with this change. A
>>    hack to restore compatibility is to call the following before anything
>>    else in the application:
>>
>>      ==
>>      :- current_prolog_flag(os_argv, Argv),
>>         set_prolog_flag(argv, Argv).
>>      ==
> 
> or, to maintain compatibility with older SWIPL versions:
> 
> :- current_prolog_flag(os_argv, Argv)
>    -> set_prolog_flag(argv, Argv)
>     ; true.

Not sure I get this.  If you want to run code for the new argv on an old
Prolog, so something like this (incomplete, but will suffice for most):

:- current_prolog_flag(argv, OsArgv),
   set_prolog_flag(os_argv, OsArgv),
   (   append(_, [--|Argv], OsArgv)
   ->  set_prolog_flag(argv, Argv)
   ;   OsArgv = [_Exe|Argv]
   ->  set_prolog_flag(argv, Argv)
   ).

	Cheers --- Jan

P.s.	Added the MacOS application to the normal download page.
	Note that this version also contains the commandline
	tools.
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.