The circularqueue new class method requires the initialize size of the queue as a parameter. This is not documented.
Hmm, kind of seems like it should have a default size if none is specified. The default would still need to be documented.
What do you think Rick, is there seem reason why a default size is not appropriate?
You seem to have CSS turned off.
Please don't fill out this field.
Well, the main point behind a circular queue is that it has a fixed size where it wraps. The problem with having a default size it is would be a very arbitrary number that you really shouldn't depend on ever, so there's no real sense in trying to define a default.
My point is merely the documentation. If I code:
like the document says, it gives me an error. The documentation does not describe any parameters to provide on the new method. If I specify a number as the parameter on the new method, that number is displayed if I code
q = .circularqueue~new(10);
say q~size / <--- says 10 /
If you want, you could provide a default for the new method or not, I don't care. Just fix the document.
Committed revision 5748.
This item is fixed in the 4.1.0 release.
Sign up for the SourceForge newsletter: