Re: include/1 directive

From: Kish Shen <ks15_at_icparc.ic.ac.uk>
Date: Wed 11 Dec 2002 06:47:12 PM GMT
Message-Id: <E18MBt2-0006lH-00@holborn.icparc.ic.ac.uk>
Dear Sabastian,

>yes I know it's not a good idea, but I don't understand why you say
>include does not work for that even if the first clause for the
>predicate appears in the included file.

This is the symmetric case of the one I mentioned, and it should also
work if include/1 really does just `expand' in place.

We introduced include/1 to more clearly distinguish the two cases where
previously compile/1 was used:

1) compiling a program with multiple modules in several files.
2) compiling a program with a single module in several files.

With the recommended style of having code for at most one module in each
file, and all clauses for a particular predicate in a single file, 
compile/1 and include/1 behaves the same, even though conceptually they
are different. I think we introduced include/1 to make this conceptual
difference more clear, rather than to encourage people to exploit the
differences between the two.

We are currently writing a new compiler for ECLiPSe, and this compiler
will include the proper behaviour of include/1. We can't yet give a
date for when this compiler will become available yet.

If you really want to have definitions for a predicate be spread over
more than one file, then you should either declare the predicates
dynamic, or you can do some preprocessing to join the files together: in
this second case the predicates in the joined file must be in one place
(the same requirement as for the `real' include/1 in the `expanded' file). 


Cheers,

Kish
Received on Wed Dec 11 17:48:52 2002

This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:07:19 PM GMT GMT