Re: [eclipse-users] Use of structured variables

From: Daniel Riera <daniel.riera_at_...6...>
Date: Tue, 09 Jan 2007 08:36:28 +0100
Thanks everybody for your fast and precise answers.

En/na Kish Shen ha escrit:
> Marco Gavanelli wrote:
>   
>> Daniel Riera wrote:
>>   
>>     
>>> Hello,
>>>
>>> I am working at the moment with a set of variables related to "objects". 
>>> For instance,
>>> I can have an object Person, with member variables Age [0..100], weight 
>>> [1..200],
>>> height [20..230], etc.
>>> At the moment I am storing these variables in a list of lists, but I 
>>> would like to know
>>> how to do this using a structure (if possible) to improve the program 
>>> reading.
>>>     
>>>       
>> Hi Daniel,
>>
>> You can define a structure with
>>
>>      :- local struct(person(age,weight,height)).
>>
>> and then access the fields with "with".
>>
>> You can have a look at the manual page with
>>
>> 	help(struct/1).
>>
>> Cheers,
>> Marco
>>
>>
>>   
>>     
> Hi Daniel and Marco,
>
> We introduced a new syntax for the structure notation that is more 
> compact: instead of with ..., you can use {}, e.g.
>
> person{weight:50,age:10} instead of   person with [weight:50,age:10]
>
> Cheers,
>
> Kish
>
>
> _______________________________________________
> ECLiPSe-Users mailing list
> ECLiPSe-Users@...2...
> http://www.crosscoreop.com/mailman/listinfo/eclipse-users
>
>   
Received on Tue Jan 09 2007 - 07:36:56 CET

This archive was generated by hypermail 2.2.0 : Mon Jul 09 2018 - 02:05:29 CEST