• Create Account

## [C++] bask in my awesomeness.

42 replies to this topic

### #21e‍dd  Members

Posted 25 June 2009 - 01:37 AM

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".

Posted 25 June 2009 - 02:21 AM

Big Smile... Big Smile!! Sir well done!! And a massive thank you!

### #23dbzprogrammer  Members

Posted 25 June 2009 - 10:10 AM

I'd love to see this for LOLCAT too.

### #24MaulingMonkey  Members

Posted 25 June 2009 - 05:51 PM

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.

### #25iMalc  Members

Posted 25 June 2009 - 10:17 PM

Sick! [cool]

### #26e‍dd  Members

Posted 25 June 2009 - 11:59 PM

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 :)

### #27Wan  Members

Posted 26 June 2009 - 12:40 AM

Finally we can make MMORPGs in HTML!

</epic>

### #28NotAYakk  Members

Posted 26 June 2009 - 06:30 AM

This should definitely be pushed to boost for an april 1st rollout of a new engine. :)

### #29/ loufoque   Banned

Posted 27 June 2009 - 11:07 AM

Quote:
 But there's no way to tell it things like "a block must appear inside an 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.

### #30Cornstalks  Members

Posted 27 June 2009 - 11:18 AM

Quote:
Original post by loufoque
Quote:
 But there's no way to tell it things like "a block must appear inside an 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.
[ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]

### #31/ loufoque   Banned

Posted 27 June 2009 - 11:38 AM

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]

### #32SiCrane  Moderators

Posted 27 June 2009 - 11:48 AM

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.

### #33Antheus  Members

Posted 27 June 2009 - 11:53 AM

And that thread points out another scary library.

### #34e‍dd  Members

Posted 27 June 2009 - 12:35 PM

Quote:
 Original post by SiCraneThere'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.

### #35Oberon_Command  Members

Posted 27 June 2009 - 01:47 PM

### #36Hodgman  Moderators

Posted 27 June 2009 - 08:38 PM

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...

### #37/ owl   Banned

Posted 27 June 2009 - 09:30 PM

Quote:
 Original post by HodgmanI 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? :)

### #38Hodgman  Moderators

Posted 27 June 2009 - 09:40 PM

Job-description... and pay-cheque size?

Depressing, I know ;(

### #39/ loufoque   Banned

Posted 28 June 2009 - 12:03 PM

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.

### #40ApochPiQ  Moderators

Posted 28 June 2009 - 12:34 PM

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, 26 February 2013 - 06:41 PM.