-
Notifications
You must be signed in to change notification settings - Fork 42
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
<#/> displays as "[]" rather than "" #50
Comments
I thought I'd try to fix this trivial-looking bug but after a little thought I'm not sure why this is a bug. Since
Moreover, why is the proposed solution to display it as the empty string The only inconsistency I see about the current situation is that there is no way to write a single
I think it would be better for It might also make more sense to use the |
The program |
We had a discussion about 10 years ago about whether XML literals should have type |
There seem to be two or more separate issues here:
I think it is desirable for the default string representation of a value to be a string that parses back to that value, when this makes sense. So one fix that does not require changing the existing type structure could be to use the existing Value.string_of_value to print out the value of |
Hmm. So the basic problem is that in webif, we call "string_of_value", which does not call "string_of_xml" directly. Instead, it prints the empty list as Likewise we call When we have an empty list, we have no way of knowing that it is an empty list of XMLitems because we don't have type information. So would one solution be to change the calls to In any case, I think in a good design |
Revisiting this, it seems that the following toy program no longer exhibits the undesired behavior:
When run, this yields HTML that renders as an empty page, and on viewing the source it appears that It is still the case that in the REPL the value of the expression So I think this can be closed. |
As
Xml
is a type alias for[XmlItem]
, empty XML values are rendered as the empty list.The text was updated successfully, but these errors were encountered: