gap icon indicating copy to clipboard operation
gap copied to clipboard

Improve argument checking in `Cycles` and other related functions

Open markuspf opened this issue 6 years ago • 2 comments

Example:

gap> Cycles((1,2,3)(4,5));
Error, List Element: <list>[2] must have an assigned value in
  D := arg[2]; at /home/makx/git/gap/master/lib/oprt.gi:2149 called from 
<function "Cycles">( <arguments> )
 called from read-eval loop at *stdin*:4
type 'quit;' to quit to outer loop
brk> 

markuspf avatar Oct 30 '19 14:10 markuspf

Also, the documentation is incomplete: It mentions up to three arguments, but actually four can be given.

Also, the same or similar issues seem to affect

  • Permutation
  • PermutationCycle
  • Cycle
  • CycleLength
  • Cycles (the function from the original report)
  • CycleLengths
  • CycleIndex

A function which seems to be somewhat similar but gets it right is e.g. IsTransitive, which declared using OrbitsishOperation ; I wonder if that or one of its relatives could also be used for the problematic functions mentioned here.

fingolfin avatar Oct 31 '19 14:10 fingolfin

I will take it.

limakzi avatar Aug 26 '24 15:08 limakzi