[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Is this the expected behavior with "default" ?
From: |
Andrew Makhorin |
Subject: |
Re: Is this the expected behavior with "default" ? |
Date: |
Thu, 06 Aug 2020 16:04:35 +0300 |
On Thu, 2020-08-06 at 13:59 +0200, Domingo Alvarez Duarte wrote:
> Hello !
>
> With the GMPL model below when we ask to display an entity with a
> declared "default" value we get nothing but if we indirectly
> reference
> then we get the "default" value.
Yes, this is expected behavior.
The display statement shows the actual content of the object that
includes only members which were actually referenced (and therefore
evaluated and added to the object) in other statements.
>
> ====
>
> param Jm, default 3;
> set J := 1..Jm;
>
> display Jm;
> display J;
> display Jm;
> ====
>
> Output:
>
> ====
>
> ...
>
> Display statement at line 3
> Jm has empty content
> Display statement at line 4
> J:
> 1
> 2
> 3
> Display statement at line 5
> Jm = 3
> ...
>
> ====
>
> Cheers !
>
>
>
Re: Is this the expected behavior with "default" ?,
Andrew Makhorin <=