Sign in to follow this  
the_edd

[C++] bask in my awesomeness.

Recommended Posts

Quote:
Original post by MaulingMonkey
Quote:
Original post by the_edd
Quote:
Original post by loufoque
Quote:
You can define the tags yourself, but it can't check particular "nesting patterns".

With such a syntax, it could perfectly do so at compile-time.


Well what I mean is it'll check stuff like:


<html>_ <body>_<!html>_ <!body>_; // compiler error


But there's no way to tell it things like "a <body> block must appear inside an <html> block".


It should be possible to add such functionality with a healthy dose of BOOST_PP.


Perhaps you're right. But I fear the repercussions of making it just a little bit too useful for its own good!

For example, I thought it would be quite cool if you could use boost::bind style placeholders such as _1, _2, ... in order to create an XML template that you could "call" with different arguments in order to generate XML documents with small changes in content. But enough is enough. I wasn't *that* bored :)

Share this post


Link to post
Share on other sites
Quote:
But there's no way to tell it things like "a <body> block must appear inside an <html> block".

Of course there is.
Looks like you're way less awesome than you think.

Expression templates allow you to build any abstract syntax tree as a type, that you may then evaluate as you see fit at compile-time using metaprogramming.

Share this post


Link to post
Share on other sites
Quote:
Original post by loufoque
Quote:
But there's no way to tell it things like "a <body> block must appear inside an <html> block".

Of course there is.
Looks like you're way less awesome than you think.

Expression templates allow you to build any abstract syntax tree as a type, that you may then evaluate as you see fit at compile-time using metaprogramming.

*sigh*

No, he's awesome. He's definitely awesome. When he said "But there's no way to tell it things like 'a <body> block must appear inside an <html> block'" he meant in the current version of XSMELL (at least that's how I understood it). Of course he could change it so such checking would be done. But he didn't add that functionality to XSMELL, so it can't be done (yes, you could make it so it's done yourself, but XSMELL doesn't provide a way for you to do this). Really, you're over complicating everything and nitpicking way more than you need to be.

Share this post


Link to post
Share on other sites
This is more of a demonstration anyway. It isn't a serious piece of software.
Of course we can nitpick.

[Edited by - loufoque on June 28, 2009 5:38:18 PM]

Share this post


Link to post
Share on other sites
There's a difference between just nitpicking and being a dick while nitpicking. You either don't know or care where the line between the two is.

Share this post


Link to post
Share on other sites
Quote:
Original post by SiCrane
There's a difference between just nitpicking and being a dick while nitpicking. You either don't know or care where the line between the two is.


It may also be that some of the ironic sentiment of the whole thing is lost in translation (to French).

Still, it took me a long time to shake off that "way less awesome than you think" jab.

Share this post


Link to post
Share on other sites
Quote:
Original post by Hodgman
I showed your library to some senior programmers as an awesome example of abusing of operator overloading, and one thought that "std::cout << doc << '\n';" was the scary part...


"senior" according to who? :)

Share this post


Link to post
Share on other sites
Actually, this isn't very far off from the kind of thing you find in boost, except it's much more primitive.
It's not really abuse in my book.

Presenting it as an awesome piece of magic obscure and obfuscated code gives bad reputation to C++ DSEL programming.

Share this post


Link to post
Share on other sites

Quote:

Original post by loufoque
Actually, this isn't very far off from the kind of thing you find in boost, except it's much more primitive.
It's not really abuse in my book.

Presenting it as an awesome piece of magic obscure and obfuscated code gives bad reputation to C++ DSEL programming.



Belittling other people and their work is not acceptable in the General Programming forum. I suggest you start acting a hell of a lot more civil.

Edited by Michael Tanczos

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this