Re: Float constants in Eclipse

From: Andrew Cheadle <amc4_at_icparc.ic.ac.uk>
Date: Wed 12 Jan 2005 09:44:16 AM GMT
Message-ID: <20050112094416.GA1586@elstree.icparc.ic.ac.uk>
Hi Huy

> I would like to ask how I could write atomic
> statements like:
> 
> myVector3D(0.123, 1.234, 3.456).

The short answer is 'exactly as you have'!

I'm not actually sure what you are asking, I guess I may be missing
something. You're reference to 'atomic' is somewhat confusing (at least to
me). I suspect you mean 'structured' or 'encapsulated'. Regardless, your 
statement is simply a standard Prolog fact and can be written 
(as you wrote it!) and queried by:

Version 5.8 #77, Thu Dec 16 00:09 2004
[eclipse 1]: [user].
 myVector3D(0.123, 1.234, 3.456).
  user       compiled traceable 64 bytes in 0.00 seconds

Yes (0.00s cpu)
[eclipse 2]: myVector3D(X, Y,Z).

X = 0.123
Y = 1.234
Z = 3.456
Yes (0.00s cpu)

In an ECLiPSe source file you simply place:

myVector3D(0.123, 1.234, 3.456).
myVector3D(0.456, 1.567, 3.789).
<and so on for as many facts as you know>

So what have I missed. If this isn't what you want can you please elaborate.

Cheers

Andy
Received on Wed Jan 12 09:41:56 2005

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