Thread overview | |||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
January 19, 2002 DML? | ||||
---|---|---|---|---|
| ||||
Some more ideas/questions concerning DML (D XML =)): What's with blocks? We had a discussion here conserning them earlier, but the problem is even wider. How does the XML-to-D converter differentiate between else-if and other cases? I'd expect it to give different outputs: if (a == 1) foo(); else if (b == 2) bar(); --- but --- if (a == 1) foo(); else while (b == 2) bar(); I believe most programmers put if on the same line with else in such cases... so the converter must be able to detect this case and process it properly. Is XSLT capable of doing such things? |
January 19, 2002 Re: DML? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pavel Minayev | "Pavel Minayev" <evilone@omen.ru> wrote in message news:a2aglg$3fk$1@digitaldaemon.com... > Some more ideas/questions concerning DML (D XML =)): > > What's with blocks? We had a discussion here conserning them earlier, but the problem is even wider. How does the XML-to-D converter differentiate between else-if and other cases? I'd expect it to give different outputs: > > if (a == 1) > foo(); > else if (b == 2) > bar(); > > --- but --- > > if (a == 1) > foo(); > else > while (b == 2) > bar(); > > I believe most programmers put if on the same line with else in such cases... so the converter must be able to detect this case and process it properly. Is XSLT capable of doing such things? > Do you mean that you would expect the resulting .d code to look like this? if (a == 1) foo(); else while (b == 2) bar(); If this is what you mean, then yes, the XSLT stylesheet could definitely do such things. It all depends on the way you structure the XML data how far you can go in tweaking the layout of the code though, so thinking up a good standard is important. And actually, I don't put the while on the same line than the else in such a case. I would lay it out like this: if (a == 1) foo(); else { while (b == 2) bar(); } Or at most leave out the curly braces. But the same XML code should be able to produce both of these results in combination with the right XSLT stylesheet. :) -- Stijn OddesE_XYZ@hotmail.com http://OddesE.cjb.net __________________________________________ Remove _XYZ from my address when replying by mail |
January 20, 2002 Re: DML? | ||||
---|---|---|---|---|
| ||||
Posted in reply to OddesE | "OddesE" <OddesE_XYZ@hotmail.com> wrote in message news:a2cs4l$1o01$1@digitaldaemon.com... > Do you mean that you would expect the resulting .d code > to look like this? I expect it to look like I've written it there - else-if should be on one line, and else-while (or whatever else) - on two different. |
January 20, 2002 Re: DML? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pavel Minayev | "Pavel Minayev" <evilone@omen.ru> wrote in message news:a2dnlf$29h0$1@digitaldaemon.com... > "OddesE" <OddesE_XYZ@hotmail.com> wrote in message news:a2cs4l$1o01$1@digitaldaemon.com... > > > Do you mean that you would expect the resulting .d code > > to look like this? > > I expect it to look like I've written it there - else-if should be on one line, and else-while (or whatever else) - on two different. > > It should definitely be possible to tweak this kind of settings if the DML spec was designed right. -- Stijn OddesE_XYZ@hotmail.com http://OddesE.cjb.net __________________________________________ Remove _XYZ from my address when replying by mail |
January 21, 2002 Re: DML? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pavel Minayev | It would be entirely up to the XSLT stylesheet to determine how to render in HTML (turning DML into D really only needs to be done by the compiler). XSLT is pretty powerful, so I'm sure it can be done. I've done a tiny little bit of playing with some of this just to have something concrete to work with; it's not pretty or polished, but it does give you a flavor of what's possible. Take a look at http://jdanielsmith.org/DML Dan "Pavel Minayev" <evilone@omen.ru> wrote in message news:a2dnlf$29h0$1@digitaldaemon.com... > "OddesE" <OddesE_XYZ@hotmail.com> wrote in message news:a2cs4l$1o01$1@digitaldaemon.com... > > > Do you mean that you would expect the resulting .d code > > to look like this? > > I expect it to look like I've written it there - else-if should be on one line, and else-while (or whatever else) - on two different. > > > |
January 21, 2002 Re: DML?: WOW | ||||
---|---|---|---|---|
| ||||
Posted in reply to J. Daniel Smith | "J. Daniel Smith" <j_daniel_smith@deja.com> wrote in message news:a2hud6$202q$1@digitaldaemon.com... > It would be entirely up to the XSLT stylesheet to determine how to render in > HTML (turning DML into D really only needs to be done by the compiler). XSLT is pretty powerful, so I'm sure it can be done. > > I've done a tiny little bit of playing with some of this just to have something concrete to work with; it's not pretty or polished, but it does give you a flavor of what's possible. Take a look at http://jdanielsmith.org/DML > > Dan > > "Pavel Minayev" <evilone@omen.ru> wrote in message news:a2dnlf$29h0$1@digitaldaemon.com... > > "OddesE" <OddesE_XYZ@hotmail.com> wrote in message news:a2cs4l$1o01$1@digitaldaemon.com... > > > > > Do you mean that you would expect the resulting .d code > > > to look like this? > > > > I expect it to look like I've written it there - else-if should be on one line, and else-while (or whatever else) - on two different. > > WOW! This is exactly the kind of stuff I was thinking about. Check this out people, it shows some of the power of DML real well. Dan, do you have a lot of experience wit XML? I know what it *can* do but not really *how* to do it. Way cool this! :) -- Stijn OddesE_XYZ@hotmail.com http://OddesE.cjb.net __________________________________________ Remove _XYZ from my address when replying by mail |
January 21, 2002 Re: DML?: WOW | ||||
---|---|---|---|---|
| ||||
Posted in reply to OddesE | "OddesE" <OddesE_XYZ@hotmail.com> wrote in message news:a2i4qg$246k$1@digitaldaemon.com... > "J. Daniel Smith" <j_daniel_smith@deja.com> wrote in message news:a2hud6$202q$1@digitaldaemon.com... > > > I've done a tiny little bit of playing with some of this just to have something concrete to work with; it's not pretty or polished, but it does > > give you a flavor of what's possible. Take a look at http://jdanielsmith.org/DML > > > WOW! > This is exactly the kind of stuff I was thinking about. > Check this out people, it shows some of the power > of DML real well. So... how do you use that viewer link? Salutaciones, JCAB |
January 22, 2002 Re: DML?: WOW | ||||
---|---|---|---|---|
| ||||
Posted in reply to Juan Carlos Arevalo Baeza | "Juan Carlos Arevalo Baeza" <jcab@roningames.com> wrote in message news:a2i7mi$2601$1@digitaldaemon.com... > "OddesE" <OddesE_XYZ@hotmail.com> wrote in message news:a2i4qg$246k$1@digitaldaemon.com... > > > "J. Daniel Smith" <j_daniel_smith@deja.com> wrote in message news:a2hud6$202q$1@digitaldaemon.com... > > > > > I've done a tiny little bit of playing with some of this just to have something concrete to work with; it's not pretty or polished, but it > does > > > give you a flavor of what's possible. Take a look at http://jdanielsmith.org/DML > > > > > > WOW! > > This is exactly the kind of stuff I was thinking about. > > Check this out people, it shows some of the power > > of DML real well. > > So... how do you use that viewer link? > > Salutaciones, > JCAB > Juan, Click on elsif.xml and when the page opens, copy the address to the clipboard. Go back and click on viewer.htm, then paste the address into the edit field. Select HTML or D and click View to view the results. Ofcourse, the D code looks messed up in the browser, but the HTML code looks fine. Walter, how should I read the syntax specifications for D on your site: Syntax Grammar? For instance, should I read decl_def: import class_decl_def struct_decl_def union_decl_def enum_decl_def As: "A decl_def consists of any of these elements in any order"? I think a good DML specification should mimic your syntax grammar as close as possible. A DML version of the above could be: <decl_def> <import> </import> <class_decl_def> </class_decl_def> <struct_decl_def> </struct_decl_def> <union_decl_def> </union_decl_def> <enum_decl_def> </enum_decl_def> </decl_def> Could you point me to a good resource where I could learn to read the grammar rules on your page? Thanks. -- Stijn OddesE_XYZ@hotmail.com http://OddesE.cjb.net __________________________________________ Remove _XYZ from my address when replying by mail |
January 22, 2002 Re: DML?: WOW | ||||
---|---|---|---|---|
| ||||
Posted in reply to OddesE | "OddesE" <OddesE_XYZ@hotmail.com> wrote in message news:a2k6hl$dql$1@digitaldaemon.com... > > "Juan Carlos Arevalo Baeza" <jcab@roningames.com> wrote in message news:a2i7mi$2601$1@digitaldaemon.com... > > "OddesE" <OddesE_XYZ@hotmail.com> wrote in message news:a2i4qg$246k$1@digitaldaemon.com... > > > > > "J. Daniel Smith" <j_daniel_smith@deja.com> wrote in message news:a2hud6$202q$1@digitaldaemon.com... > > > > > > > I've done a tiny little bit of playing with some of this just to have > > > > something concrete to work with; it's not pretty or polished, but it > > does > > > > give you a flavor of what's possible. Take a look at http://jdanielsmith.org/DML > > > > > > > > > WOW! > > > This is exactly the kind of stuff I was thinking about. > > > Check this out people, it shows some of the power > > > of DML real well. > > > > So... how do you use that viewer link? > > > > Salutaciones, > > JCAB > > > > Juan, > > Click on elsif.xml and when the page opens, copy the address to the clipboard. Go back and click on viewer.htm, then paste the address into the edit field. Select HTML or D and click View to view the results. Ofcourse, the D code looks messed up in the browser, but the HTML code looks fine. Ok. So I had tried it right. But I just get "Error on Page" in the status line of IE. :-P Salutaciones, JCAB |
January 22, 2002 Re: DML?: WOW | ||||
---|---|---|---|---|
| ||||
Posted in reply to Juan Carlos Arevalo Baeza | You need the new(er) XML objects which support the 1999 XSLT specification; the ones that are part of IE 5.0 support the old (and now poorly documented) XD XSL transform. Also, you can just type "elseif.xml" into the text field - the full URL isn't needed. Dan "Juan Carlos Arevalo Baeza" <jcab@roningames.com> wrote in message news:a2ke01$ijm$1@digitaldaemon.com... > "OddesE" <OddesE_XYZ@hotmail.com> wrote in message news:a2k6hl$dql$1@digitaldaemon.com... > > > > "Juan Carlos Arevalo Baeza" <jcab@roningames.com> wrote in message news:a2i7mi$2601$1@digitaldaemon.com... > > > "OddesE" <OddesE_XYZ@hotmail.com> wrote in message news:a2i4qg$246k$1@digitaldaemon.com... > > > > > > > "J. Daniel Smith" <j_daniel_smith@deja.com> wrote in message news:a2hud6$202q$1@digitaldaemon.com... > > > > > > > > > I've done a tiny little bit of playing with some of this just to > have > > > > > something concrete to work with; it's not pretty or polished, but it > > > does > > > > > give you a flavor of what's possible. Take a look at http://jdanielsmith.org/DML > > > > > > > > > > > > WOW! > > > > This is exactly the kind of stuff I was thinking about. > > > > Check this out people, it shows some of the power > > > > of DML real well. > > > > > > So... how do you use that viewer link? > > > > > > Salutaciones, > > > JCAB > > > > > > > Juan, > > > > Click on elsif.xml and when the page opens, copy the address to the clipboard. Go back and click on viewer.htm, then paste the address into the edit field. Select HTML or D and click View to view the results. Ofcourse, the D code looks messed up in the browser, but the HTML code looks fine. > > Ok. So I had tried it right. But I just get "Error on Page" in the status > line of IE. :-P > > Salutaciones, > JCAB > > > |
Copyright © 1999-2021 by the D Language Foundation