[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Adding scoped local set/param declaration to GMPL
From: |
Domingo Alvarez Duarte |
Subject: |
Adding scoped local set/param declaration to GMPL |
Date: |
Tue, 25 Aug 2020 22:12:07 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
Hello !
I'm experimenting with allow local set/param declarations inside scoped
blocks (for/if/then/else), it's the base to possibly experiment further
with problem/callback/function declarations you can see/experiment with
it in this branch https://github.com/mingodad/GLPK/tree/local-set-param
, look at
https://github.com/mingodad/GLPK/blob/local-set-param/examples/shikaku-if.mod
and
https://github.com/mingodad/GLPK/blob/local-set-param/examples/test-if.mod
to see it's usage.
====
for{i in 1..4} {
printf "now we are at %d\n", i;
if i mod 2 = 0 then { #assert when missing "= 0"
param lp := i+10;
set ls := {1..i+1};
printf "nested if lp = %d\n", lp;
display ls;
}
param lp := i+20;
set ls := {1..i+2};
printf "nested for lp = %d\n", lp;
display ls;
}
====
Any comment/suggestion is welcome !
Cheers !
- Adding scoped local set/param declaration to GMPL,
Domingo Alvarez Duarte <=