| 4421 | // ---------------------------------------------------------------------------- |
| 4422 | |
| 4423 | BOOLEAN spaddProc( leftv result,leftv first,leftv second ) |
| 4424 | { |
| 4425 | semicState state; |
| 4426 | |
| 4427 | // ----------------- |
| 4428 | // check arguments |
| 4429 | // ----------------- |
| 4430 | |
| 4431 | lists l1 = (lists)first->Data( ); |
| 4432 | lists l2 = (lists)second->Data( ); |
| 4433 | |
| 4434 | if( (state=list_is_spectrum( l1 )) != semicOK ) |
| 4435 | { |
| 4436 | WerrorS( "first argument is not a spectrum:" ); |
| 4437 | list_error( state ); |
| 4438 | } |
| 4439 | else if( (state=list_is_spectrum( l2 )) != semicOK ) |
| 4440 | { |
| 4441 | WerrorS( "second argument is not a spectrum:" ); |
| 4442 | list_error( state ); |
| 4443 | } |
| 4444 | else |
| 4445 | { |
| 4446 | spectrum s1= spectrumFromList ( l1 ); |
| 4447 | spectrum s2= spectrumFromList ( l2 ); |
| 4448 | spectrum sum( s1+s2 ); |
| 4449 | |
| 4450 | result->rtyp = LIST_CMD; |
| 4451 | result->data = (char*)(getList(sum)); |
| 4452 | } |
| 4453 | |
| 4454 | return (state!=semicOK); |
| 4455 | } |
| 4456 | |
| 4457 | // ---------------------------------------------------------------------------- |
| 4458 | // this procedure is called from the interpreter |
no test coverage detected