Re: [eclipse-users] Use of structured variables

From: Kish Shen <kisshen_at_...5...>
Date: Tue, 09 Jan 2007 00:16:38 +0000
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
Received on Tue Jan 09 2007 - 00:16:59 CET

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