Oh, I may have a big problem with Euphoria
- Posted by George Henry <ghenryca at hotmail.com> Dec 24, 2000
- 611 views
If I build a deeply-nested data structure of arbitrary size, say for example a tree: (view using a fixed font) a b c e f g h i j k l m n o p qrstuvwxyz123456 where z is root[RIGHTCHILD][LEFTCHILD][LEFTCHILD][RIGHTCHILD][VALUE] (follow that?), then is there any way of modifying z without hardcoding that particular expression? There does not appear to be a way of "aliasing" that nasty expression, or saving some sort of bookmark to z that I can use later to access it. The word "pointer" springs to mind, but maybe there is another way. Just as an example, show me a routine, for an arbitrary tree represented by nested sequences, to change all instances of "g" to "w". Suppose the tree is built at runtime by user action, and has gaps in it.... Then, what if the user bookmarks nodes in the tree? Must I save the bookmark information in the nodes, to be able to identify it later? If I do this, it seems that searching the tree for bookmarks would be incredibly inefficient and ugly, compared to having external bookmarks. Do I have to use dynamic allocation and pointers, after all? When we sing the praises of sequences vs. pointers, are we sweeping this sort of difficulty under the rug? George _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com