Hello, Sean. 2012/8/7 Sean Bartell <wingedtachik...@gmail.com>: >> First, if you specify an unknown field in a switch (run with hex:00) >> transform main = struct { >> switch (.non_existent) { >> 1: { }; >> else: { }; >> } >> }; >> Bithenge would enter some endless recursion and eventually die. > > The problem is that in order to find ".non_existent", Bithenge tries to > figure out whether the "switch" generates ".non_existent", which means Do I understand it right that the switch could be driven by a value assigned inside that switch? That would hardly make sense.
> it has to find ".non_existent". I've added this to the future feature > list, even though it's more of a bug than a feature. I would consider the endless loop definitely a bug. Especially if an error in the script results in a page fault. >> Do you think you can improve that somehow? Either by defining more >> fine-grained error codes or returning bigger context or ...? > > I think the solution would be to put some sort of error information in > the bithenge_scope_t. I've also added this to the future feature list. That would be very nice. I think that just adding a char * member to which you could assign more descriptive messages would be enough. >> Last thing - do you think it would be possible to support recursive >> structures? At least a simple variant that a structure can reference >> itself? I am not sure that it is possible at all with current design >> but it might be a natural way of describing some data... >> What I have in mind is this: >> transform recursive = struct { >> .have_next <- nonzero_boolean <- uint8; >> .data <- whatever; >> if (.have_next) { >> .next <- recursive; >> } >> } > > Well, this case could be handled with do...while: Yes. As a matter of fact, my example was a simplified workaround for not having the possibility to use fields as inputs to another transform. > Other cases would still need recursion, and it wouldn't be too hard to > implement, so I've added it to the future feature list. I agree. But it is definitely not a high-priority issue. Thanks. - Vojta > > Thanks, > Sean > > _______________________________________________ > HelenOS-devel mailing list > HelenOS-devel@lists.modry.cz > http://lists.modry.cz/cgi-bin/listinfo/helenos-devel _______________________________________________ HelenOS-devel mailing list HelenOS-devel@lists.modry.cz http://lists.modry.cz/cgi-bin/listinfo/helenos-devel