[GAP Forum] suggestion for additional core operations on polynomials and lists

kroeker kroeker at uni-math.gwdg.de
Thu May 31 16:34:34 BST 2012


Hello Mariano,


thanks for the hint with 'Flat'. It seems I overlooked it.

But 'Flat' is still different to 'Flatten'.
'Flat()' applied to a list returns a complete flat list while
'Flatten()' only flattens the list a bit:

Applying 'Flat' to  [ 2,[ 3,[4] ] ]  results in [ 2, 3, 4 ],
  while 'Flatten' would return  [ 2,  3, [4]  ]


Best,


Jakob



Am 30.05.2012 20:53, schrieb Mariano Suarez-Alvarez:
> On Wed, 30 May 2012, kroeker wrote:
>
>> Dear GAP-team,
>>
>>
>> recently I extensively used  polynomials, lists and methods to 
>> manipulate them.
>> From this experience I would like to suggest to add some of the 
>> following manipulation and access methods to the GAP-core:
>>
>
> [snip]
>
>> - flatten a list
>>  ( e.g. Flatten( [ 2,[ 3,[4] ] ] )  => [ 2,  3, [4]  ] ; Flatten( [ 
>> 2,  3, [4]  ] ) => [ 2,  3, 4 ] );
>
>
> Isn't this precisely what the function Flat does?
> (The naming scheme for functions is sometimes surprising, going from 
> verbs to adjectives to nouns... I hope in some parallel universe GAP 
> has a better naming convention :) )
>
> -- m
>
>




More information about the Forum mailing list