convert( ) cmd

Messages in english

compsystems
Messages : 540
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

convert( ) cmd

Hello

A SEQUENCE is transformed into VECTOR with the order nop()
nop( 1, 2, 3) [↵] returns [1, 2, 3]

A VECTOR / LIST / SET / POLYNOMY / MATRIX is transformed into SEQUENCE with the op() cmd

op( [ 1 ,2, 3 ] ) [↵] returns ( 1 ,2, 3 )
op( list[ 1 ,2, 3 ] ) [↵] returns ( 1 ,2, 3 )
op( set[ 1 ,2, 3 ] ) [↵] returns( 1 ,2, 3 )
op( poly1[ 1 ,2, 3 ] ) [↵] returns( 1 ,2, 3 )
op( matrix[[ 1 ,2, 3 ], [ 4, 5, 6 ]] ) [↵] returns a sequence of vectors ( [ 1 ,2, 3 ], [ 4, 5, 6 ] )

you need to complete the option of the convert command to sequence,
since it is easier to remember the name convert() than op()

convert( [ 1, 2, 3 ], 'seq' ) -> ( 1 ,2, 3 )
convert( list[ 1 ,2, 3 ], seq ) -> ( 1 ,2, 3 )
convert( set[ 1 ,2, 3 ], seq ) -> ( 1 ,2, 3 )
convert( poly1[ 1 ,2, 3 ], seq ) -> ( 1 ,2, 3 )
convert( matrix[[ 1 ,2, 3 ], [ 4, 5, 6 ]], seq ) -> ( [ 1 ,2, 3 ], [ 4, 5, 6 ] )

parisse
Messages : 5346
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :