I need to have (for an html project of mine, which you all know about by now) a stack data structure. I know one *really* klugy way to do it, by having a number register which counts the depth of my stack, and then having a variable which is concatenated to form a name like "name0", "name1", etc, so I can automatically reference the top variable when I want.
I was wondering if there might be a cleaner way to do it, or if I really must commit this code atrocity. Don't get me wrong, having at least 1 way to do it is one hell of a long way better than having NO way, but I wanted to make sure that some cleaner method doesn't exist. I'll really be in your debt if you can point me towards some cleaner way to do this. Else, my code is gonna be truly write-only in character. Remember APL? mine will be worse!