problem with op() cmd

Messages in english

Modérateur : xcasadmin

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

problem with op() cmd

Message par compsystems » dim. déc. 09, 2018 3:37 pm

Hello BP

a := (0,1,2) ↵ returns 0,1,2, // a is a sequence
b := makevector(a) ↵ returns [1,2,3] // makeVector converts a sequence into vector
type(b) ↵ returns 'vector'

seqQR := qr([[1,2], [3,4]]) ↵ returns a sequence mq, mr
op(seqQR) ↵ returns Error: Bad Argument Value "
must return [ mq, mr ]

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

Re: problem with op() cmd

Message par parisse » dim. déc. 09, 2018 6:01 pm

op expects one argument (a list) and extracts the element of the lists as a sequence. If you pass a sequence with 2 args to op, you do the reverse, therefore you get an error and that's expected.

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

Re: problem with op() cmd

Message par compsystems » dim. déc. 09, 2018 8:29 pm

Sorry, op() cmd works well
the inverse operation to op() is makevector()
makevector(seqQR) // ok

Répondre