Question: Is this a bug with DEQueue?

Maple 2022:

It appears that one can use push_back() with an empty DEQueue(), but not push_front().

Since the queue is double-ended and empty, this doesn't make much sense to me. So should this be considered a "bug"?

See the attached

  restart:

#
# This works
#
  A:=DEQueue();
  empty(A);  
  push_back(A,2);
  

module DEQueue () local num, head, tail, storage, dsp; option object; end module

 

true

 

module DEQueue () local num, head, tail, storage, dsp; option object; end module

(1)

#
# But this results in an error!
#
  B:=DEQueue();
  empty(B);
  push_front(B,2);

module DEQueue () local num, head, tail, storage, dsp; option object; end module

 

true

 

Error, invalid return value from method moduledefinition: 'NULL'

 

 

Download DEQueue_Prob.mw

Please Wait...