Indexed variables

9 views
Skip to first unread message

Waldek Hebisch

unread,
Jul 31, 2026, 9:10:19 PM (4 days ago) Jul 31
to fricas...@googlegroups.com
I have created a simple domain (attached) that implements indexd
variables. It has some similarity to OrderedVariableList,
because it accepts a list of symbols. But the symbols are
just used as base for names and there is numeric suffix.
So one can have things like a0, a1, ..., b0, b1,..., t0, ...

I plan to include it.

--
Waldek Hebisch
IVARS.spad

Qian Yun

unread,
Jul 31, 2026, 9:33:20 PM (4 days ago) Jul 31
to fricas...@googlegroups.com
1. Use 'Rep:=Integer' instead of 'pretend'?

2. Change '(Symbol, Integer)' to '(Symbol, NNI)'?

- Qian

Waldek Hebisch

unread,
Aug 1, 2026, 9:35:16 AM (4 days ago) Aug 1
to fricas...@googlegroups.com
On Sat, Aug 01, 2026 at 09:33:15AM +0800, Qian Yun wrote:
> On 8/1/26 9:10 AM, Waldek Hebisch wrote:
> > I have created a simple domain (attached) that implements indexd
> > variables. It has some similarity to OrderedVariableList,
> > because it accepts a list of symbols. But the symbols are
> > just used as base for names and there is numeric suffix.
> > So one can have things like a0, a1, ..., b0, b1,..., t0, ...
> >
> > I plan to include it.
> >
>
> 1. Use 'Rep:=Integer' instead of 'pretend'?

We have just two 'pretend'-s in context where types are clearly
specified. Rep is more dangerous in similar cases and needs
more code.

> 2. Change '(Symbol, Integer)' to '(Symbol, NNI)'?

Various indexing functions use Integer and that caused no
trouble. OTOH NNI frequently needs extra code. And
computations should work fine if anybody needs negative
indices, only the output would be fishy in such case
(but probably no worse than for SMP(INT, INT)).

--
Waldek Hebisch

Ralf Hemmecke

unread,
Aug 1, 2026, 2:18:20 PM (4 days ago) Aug 1
to fricas...@googlegroups.com
On 8/1/26 15:35, Waldek Hebisch wrote:
>> 1. Use 'Rep:=Integer' instead of 'pretend'?
>
> We have just two 'pretend'-s in context where types are clearly
> specified. Rep is more dangerous in similar cases and needs
> more code.

Maybe it is only me, but I like to see Rep := ... even if it is strictly
not necessary. It is much more easy for a human to read of what
representation is used from that line than to decipher it from the
functions that provide the domain functionality.

>> 2. Change '(Symbol, Integer)' to '(Symbol, NNI)'?

> Various indexing functions use Integer and that caused no
> trouble. OTOH NNI frequently needs extra code. And
> computations should work fine if anybody needs negative
> indices, only the output would be fishy in such case
> (but probably no worse than for SMP(INT, INT)).

In fact, I would also prefer NNI. But it's not a strong opinion.

Ralf



Reply all
Reply to author
Forward
0 new messages