11.07.2015 Views

Advanced Programming Guide

Advanced Programming Guide

Advanced Programming Guide

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

3.3 Packages • 87From the output of showstat,> showstat( copy );copy := proc(A)|Calls Seconds Words|PROC | 2 0.000 670|1 | 2 0.000 670| if type(A,rtable) then2 | 0 0.000 0| return rtable(rtable_indfns(A),rtable_dims(A),A,rtable_options(A),readonly = false)elif type(A,{array, table}) then3 | 2 0.000 630| if type(A,name) then4 | 0 0.000 0| return map(proc () args endproc,eval(A))else5 | 2 0.000 606| return map(proc () args endproc,A)end ifelse6 | 0 0.000 0| return Aend ifend procit appears that the rtable case (statement 2) has not been called.Add a test for the rtable case.> copy( rtable() ):> showstat( copy );copy := proc(A)|Calls Seconds Words|PROC | 3 0.000 868|1 | 3 0.000 868| if type(A,rtable) then2 | 1 0.000 186| return rtable(rtable_indfns(A),rtable_dims(A),A,rtable_options(A),readonly = false)elif type(A,{array, table}) then3 | 2 0.000 630| if type(A,name) then4 | 0 0.000 0| return map(proc () args endproc,eval(A))else5 | 2 0.000 606| return map(proc () args endproc,A)end ifelse6 | 0 0.000 0| return Aend ifend proc

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!