Ulti
Member
While trying to create an ash equivalent of simple_html_dom.php to add to the framework I've been working on, I've been creating many workarounds to overcome ash's limitations. You can get an idea of what I've been busy with by running this state-of-the-art masterpiece in the making: http://pastie.org/pastes/9665440/text
it runs flawlessly and outputs an html tree constructed with DOM methods represented internally as a nested set.
To workaround ash's limitations, notice how I had to create a treeRegistry and use a treeId for a node within the tree to reference the tree itself. My workaround, creating a registry special to manage the record recursion, is an ugly one attempting so very hard to implement a means for ash to manage multidimensional arrays. The workaround is a cry of desperation.
So, with the future of ash scripting in mind, I'd like to propose the following to the developers:
The ability to predefine records, so they can be used recursively:
it runs flawlessly and outputs an html tree constructed with DOM methods represented internally as a nested set.
To workaround ash's limitations, notice how I had to create a treeRegistry and use a treeId for a node within the tree to reference the tree itself. My workaround, creating a registry special to manage the record recursion, is an ugly one attempting so very hard to implement a means for ash to manage multidimensional arrays. The workaround is a cry of desperation.
So, with the future of ash scripting in mind, I'd like to propose the following to the developers:
The ability to predefine records, so they can be used recursively:
Code:
record nestedSetTree;//predefine in the same manner that we can already predefine functions in ash
record nestedSetTree
{
record nestedSetNode
{
string data;
int left;
int right;
nestedSetTree tree;//reference our predefined record for recursion
}[int] node;
};
Last edited: