container objects - LeFreq/Singularity GitHub Wiki

Containers are objects that hold other objects (sometimes I called them meta-objects, since one hardly uses them directly) get all of the methods of standard objects, plus 2 to 4 additional methods:

XXX distinguish between a sequence (where membership isn't important) NO, sequences are ad-hoc, anonymous containers f0r the command line OR tables (in other words completely structured data -- not objects) and setsXXX

  • the index operator[],
  • or containment test (in) or size
The getstate method returns the size of the container or the number of other elements within it.

One should be able to overload a single method, rather than the whole class, like the out>> method, so that it can return, say, the smallest element, or the last, or pop a member off of the stack. In fact, the container object may be such a object, inherited from the standard objects.

This is a preliminary exploration. It may be that more methods will be necessary, like size or a test for non-zero, yet I believe these can be accommodated with get_state.... STUB

A built-in Stack object exists in the shell offering a First-In, Last-Out container. The shell stack can be accessed with what operator, symbol, or name?

The Stack(Container) adds push, pop

⚠️ **GitHub.com Fallback** ⚠️