Subclassing hierarchy of Strings and Arrays

BlitzMax Forums/BlitzMax Programming/Subclassing hierarchy of Strings and Arrays

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I agree with Fabian on this. Lisp does something like this - strings, arrays, vectors, lists - they are all of a type "Sequence." A lot of functions work on all types of sequence (and are - I'm assuming - overloaded (or defined as generic in Lisps case) functions that act appropriately given a specific argument).

A 2 dimensional array is nothing more than an array of arrays, essentially. Maps and Trees are nothing more than lists of lists.

That's one really nice thing about lisp and this type of a classification hierarchy - you can call the reverse function on a string such as "hello" and get "olleh" - you can call it on a list of numbers (1 2 3 4 5 6) and get (6 5 4 3 2 1), you can call it on a list of lists ( (1 2 3) (4 5 6) ) and get ( (4 5 6) (1 2 3) ), you can call it on arrays, etc.