index <---> lookup

6 views
Skip to first unread message

Ralf Hemmecke

unread,
Dec 6, 2019, 7:56:01 PM12/6/19
to fricas-devel
I find the types of "lookup" and "index" in FriCAS a bit strange.

http://fricas.github.io/api/Finite.html#l-finite-index

index: PositiveInteger -> %
lookup: % -> PositiveInteger

Yes, it's just a definition, but I would have expected that

"index" returns the index of an element, i.e. a number.
And lookup(i) gives the i-th element.

Interestingly, in the Aldor library it's exactly as I would expect.

https://github.com/pippijn/aldor/blob/master/aldor/lib/algebra/src/categories/sit_fset.as

index: % -> Z;
lookup: Z -> %;

Ralf
Reply all
Reply to author
Forward
0 new messages