New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change Q data dumps to conform to the new object constructor syntax #45
Comments
Yeah, got it. And wow is it an improvement!
My hand-written translation in the OP brought the line count up from 23 to 37. But the stringifier brings it back down to 25, so it ties in line count with the original format. It's more informative, and more compact at the same time. I told it that if a Q type only has one attribute, then go ahead and abbreviate it on the same line. Apparently it's better than I am at finding those cases. 😊 Some hacky beautification is applied to remove attributes that don't add any information, and to improve the presentation order of some other attributes. |
Today I was struck by the thought that the stringification of objects might be vulnerable to cyclical references between objects. Since the stringification doesn't check for cycles (à la But then I realized that there can be no cycles. For the same reason there can be none in Git. Objects can only be created to refer (publicly) to things with a strictly older time stamp. Even To get a "backlink", one would have to return one from a method rather than have it as a public attribute. (This way, one could still have doubly linked lists, trees, etc.) I guess it's the price being paid for the immutability-heavy design. From the point of view of stringification, it certainly makes things easier. |
A piece of code like this:
has a Qtree which currently stringifies to this:
That stringification has served us well, but I think it's time to replace it with something more 007-native: the new proposed object constructor syntax. That same Qtree above would then render as this:
A bit more verbose. But also much more in line with where 007 is heading in general.
The text was updated successfully, but these errors were encountered: