I guess
1) the "by 2" should not be ignored.
2) "2.. by 2" should be counted as a correct expression for a UniversalSegment.

```
(12) -> l := [a,b,c,d,e,f,g,h,i,j]

   (12)  [a, b, c, d, e, f, g, h, i, j]
Type: List(OrderedVariableList([a,b,c,d,e,f,g,h,i,j]))
(15) -> l(2..7)

   (15)  [b, c, d, e, f, g]
Type: List(OrderedVariableList([a,b,c,d,e,f,g,h,i,j]))
(16) -> l(2..7 by 2)

   (16)  [b, c, d, e, f, g]
Type: List(OrderedVariableList([a,b,c,d,e,f,g,h,i,j]))
(17) -> l(2.. by 2)
   There are no library operations named BY having 1 argument(s) though
      there are 1 exposed operation(s) and 0 unexposed operation(s)
      having a different number of arguments. Use HyperDoc Browse, or
      issue
                                 )what op BY
      to learn what operations contain " BY " in their names, or issue
                               )display op BY
      to learn more about the available operations.

   Cannot find a definition or applicable library operation named BY
      with argument type(s)
                               PositiveInteger

      Perhaps you should use "@" to indicate the required return type,
      or "$" to specify which version of the function you need.

(17) -> l((2..) by 2)

   (17)  [b, c, d, e, f, g, h, i, j]
Type: List(OrderedVariableList([a,b,c,d,e,f,g,h,i,j]))
```

Clearly, the problem lies here
https://github.com/fricas/fricas/blob/master/src/algebra/aggcat.spad#L1658
```
   elt(x : %, i : UniversalSegment(Integer)) ==
       l := low(i) - minIndex x
       l < 0 => error "index out of range"
       not hasHi i => copy(rest(x, l::NonNegativeInteger))
       (h := high(i) - minIndex x) < l => empty()
first(rest(x, l::NonNegativeInteger), (h - l + 1)::NonNegativeInteger)
```
However, it is not so clear how the stepsize can be taken into account, given that a generic implementation should work for finite (List) and infinite (Stream) structures.

The same applies for the delete function.

Should we rather move that function into the respective domains and implement it properly there? Or explicitly forbid (in the ++ docstrng the "by n" in the UniversalSegment?

Ralf

--
You received this message because you are subscribed to the Google Groups "FriCAS - 
computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/0fc2d6b5-b1e7-8be8-6dc4-c5e0e1d6d892%40hemmecke.org.

Reply via email to