The float type is now in my little scripting language. Also I have added support for float arrays. The arrays in my language are currently one dimensional. I think this is no good and will attempt to add either a matrix type or support for multidimensional arrays in a future version.
Hell-of-a-time...
Too make a long story short I'll just say that pointers and STL don't mix well. I wanted to store a data type as a dynamic array of bytes. The problem with this is that A2 types are stored inside of STL vectors and a pointer to an array of bytes doesn't get copied or even noticed with common STL vector operations. I may find an elegant solution to this in the future and thanks to data abstraction should have no problem dropping in a different implementation without affecting too much. Something will need to be done before I can add user defined structs to the language.
A scripting demo...
I'm working on a graphical demo which executes A2 scripts. It will demonstrate different ways you can use A2 in a 2D game environment. And yes tossing Spongebob around with script vectors is included. [smile] What else could I put in the window?
Not entirely sure how you'd go about implementing it, but if you can allow an array as a basic type that contains any other basic type you could have an array-of-arrays-of-arrays (3D array)...
I'm pretty sure this is how Java implements arrays, maybe C/C++ as well. Although, I think it's only Java that allows you to have "odd shape" arrays:
Agreed. The STL is great, but it can be a real pain in the backside. The thing that always annoys me about it is that I get stuck, look up some guru's book/website and find the solution - upon which it all seems so elegant and simple (as STL is supposed to be) yet I'd never of figured it out on my own [headshake]
Some glass? [lol]
I did see an interpretted script demo once that showed, as a form of log-like output, the script commands as they're executed. Thus you get a sort of flickering of code across the bottom of the screen as all the lines of script get executed... You could slow it down and watch each line as the program worked through it.
It was a bit noisy, but it looked quite cool - almost had that Matrix Code™ effect from the films [grin]
Jack