-
-
Notifications
You must be signed in to change notification settings - Fork 704
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
[GSoC] [new package] Add std.experimental.xml package #4741
Conversation
|
@lodo1995, thanks for your PR! By analyzing the annotation information on this pull request, we identified @9rnsr, @9il and @WalterBright to be potential reviewers. @9rnsr: The PR was automatically assigned to you, please reassign it if you were identified mistakenly. |
Codecov Report
@@ Coverage Diff @@
## master #4741 +/- ##
==========================================
- Coverage 88.78% 88.15% -0.64%
==========================================
Files 121 134 +13
Lines 74159 76768 +2609
==========================================
+ Hits 65845 67671 +1826
- Misses 8314 9097 +783
Continue to review full report at Codecov.
|
I do not think it should. For it to actually ease transition, the behaviour must not differ from the existing |
|
Yah, don't worry about compatibility. We only need to make sure we use different entity names (either the whole module or the artifacts in it). I'm okay with just aiming at calling it |
|
@don-clugston-sociomantic @andralex Seems reasonable. The behaviour of the current library is not that easy to reproduce correctly.
|
|
@lodo1995 I'm seeing e.g. in https://auto-tester.puremagic.com/show-run.ghtml?projectid=1&runid=2150441&isPull=true: Are these traceable to the code? |
|
@andralex Yes, I found out the issue. It's a |
|
Phobos naming convention is not followed. |
@jacob-carlborg Yes, you are right. I forgot to change that. Enum members should not be all upper. If I remember correctly, you also pointed out on the forum that the cursor members |
Hmm, not sure. Let's see if someone else has a suggestion. |
|
IMO if they are member an struct or class all lowercase property. If a property is even needed. If the member function computes something or calls something that might compute something the fact should be reflected in the name. getXXX or computeXXX. |
|
@burner These methods do very simple computations; some of them cache their results for successive calls. For reference, they are |
A good example would be std.container, where the complexity of an operation is part of the documentation and if there are more ways to do it even its name. Hence AFAIK adn as @jacob-carlborg mentioned in D-style there are no getters and to avoid confusion, it could be something like You should try to ping @andralex via mail. He is pretty good in naming ;-) |
|
@burner the point of having properties is to be able to have computed fields. Example: struct Person
{
string firstName;
string lastName;
string fullName() { return firstName ~ " " ~ lastName; }
} |
|
@jacob-carlborg I disagree, just look at all the crazy long threads on the forums. |
|
@burner then what is the point of having properties? |
|
to assert assignments and to make trival access operation like a[idx] or even better return this._current |
|
Looking over the doc at https://lodo1995.github.io/experimental.xml/std/experimental/xml.html (nice writeup), I see no need for e.g. Related: Indeed the all-lowercase enum names should be converted to Few more unasked for thoughts: in this example I'm unclear why |
|
Ok, I finally found some time to work on this PR. // create uninitialized
auto cursor = chooseLexer!string
.parser
.cursor
;
foreach (input; inputs)
{
// reinitialize every time
cursor.setSource(input);
foo(cursor);
}So this is a tradeoff we need to decide. Steven brought up this issue, so I guess he prefers full initialization without |
|
Why would you need the ability to create uninitialised components? It doesn't seem like there would be a large performance cost associated with constructing the chain (although I haven't looked at what your code is doing there), so moving the declaration inside the loop would be just fine. |
|
@klickverbot Yes, currently the only different behaviour is that internal buffers are kept for reuse. |
|
I have to give a closer look at the code. Will get back to you. Sent from my iPhone
|
|
@lodo1995 leaving this to you, feel free to choose whatever you think is most flexible |
…rom asserts to exceptions
|
Changes of the new commit:
|
Awesome! Sorry I haven't had a chance to look yet. I will get to this... so many things to do... |
| private Unqual!T[] arr; | ||
| private size_t used; | ||
|
|
||
| public this(ref Alloc alloc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is trivial but you have an inconsistent usage of public here and in 3 next methods. They would only be justified after a global private: since public is the default protection attribute.
| { | ||
| allocator = &alloc; | ||
| } | ||
| public this(Alloc* alloc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you define @disable this();? This is just in case someone would use the appender in the future and to prevent any misuse.
|
Is it possible to get the doctype of the document? Seems like |
|
@NVolcz The parser has no other information, except that the root element must be |
|
@lodo1995 Pardon for the confusion. What i was trying to say is that the entity name (is that what it is called?) is needed in some application. Currently only the content is returned. But it then skips all elementEnds. |
I still don't understand...
https://lodo1995.github.io/experimental.xml/std/experimental/xml.html look at the 4th example. Your snippet looks good. The closing tag ( |
|
Sorry missunderstood the API for the dtdEmpty. <works />Does not work: <notWork></notWork> |
|
Ping @lodo1995 - how about wrapping this up within 2016? |
|
@wilzbach I'd really like to finish this up, but I really don't have any free time to work on it currently. I'm really sorry, but this will have to wait. |
|
Any update on this? (@lodo1995) |
|
As @lodo1995 seems to have moved on and left |
We could think about hosting this at dlang-community if there are concerns about having it at |
|
We should develop stricter standards for deliverables with our GSoC students. |
|
I wrote @lodo1995 what his plan are or if I can take over? |
|
Closing this now as it doesn't seem like @lodo1995 is under the living. If someone else wants to pick up the torch, please feel free to do so. |
Here is the result of these months of work.
I want to thank my mentor Robert @burner Schadek for his great help, and everybody who already gave their feedback.
This is an (almost exact) copy of my repository which is also available as a dub package.
The documentation is available here.
I would really love if feedback could focus on design considerations first, then naming issues (I'm not that good at naming things) and then small nitpicks.
I will try to keep low pressure on the testing environment by performing all further development based on your feedback on my repository (see above) and pushing here no more than twice a day.
Things still to do (work in progress):
legacy API: in my repo I have a crude wrapper that exposes the oldprobably not a good ideastd.xml, to ease transition; should it be included?domimpl.d)Wishlist:
@nogcDOM less impossible)std.container.AAwith custom allocators; again, not a blocker, but would help@nogcAppenderwith custom allocators, for the very same reason; currently this package uses a custom one.Open questions:
to include or not to include the "legacy layer" to allow use of the old API backed by the new library, to ease transition?probably not a good idea(EDIT: of course this needs @andralex approval)