Jump to content

  • Log In with Google      Sign In   
  • Create Account


[C++] bask in my awesomeness.

  • You cannot reply to this topic
42 replies to this topic

#21 e‍dd   Members   -  Reputation: 2105

Like
0Likes
Like

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

Sponsor:

#22 RoadToRuin   Members   -  Reputation: 145

Like
0Likes
Like

Posted 25 June 2009 - 02:21 AM

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

#23 dbzprogrammer   Members   -  Reputation: 100

Like
0Likes
Like

Posted 25 June 2009 - 10:10 AM

I'd love to see this for LOLCAT too.

#24 MaulingMonkey   Members   -  Reputation: 1556

Like
0Likes
Like

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.

#25 iMalc   Crossbones+   -  Reputation: 2250

Like
0Likes
Like

Posted 25 June 2009 - 10:17 PM

Sick! [cool]

#26 e‍dd   Members   -  Reputation: 2105

Like
0Likes
Like

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

#27 Wan   Members   -  Reputation: 1366

Like
0Likes
Like

Posted 26 June 2009 - 12:40 AM

Finally we can make MMORPGs in HTML!

</epic>

#28 NotAYakk   Members   -  Reputation: 876

Like
0Likes
Like

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   -  Reputation: 92

Like
0Likes
Like

Posted 27 June 2009 - 11:07 AM

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.

#30 Cornstalks   Crossbones+   -  Reputation: 6966

Like
0Likes
Like

Posted 27 June 2009 - 11:18 AM

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.
[ 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   -  Reputation: 92

Like
0Likes
Like

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]

#32 SiCrane   Moderators   -  Reputation: 9328

Like
0Likes
Like

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.

#33 Antheus   Members   -  Reputation: 2389

Like
0Likes
Like

Posted 27 June 2009 - 11:53 AM

It made reddit.

And that thread points out another scary library.



#34 e‍dd   Members   -  Reputation: 2105

Like
0Likes
Like

Posted 27 June 2009 - 12:35 PM

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.

#35 Oberon_Command   Crossbones+   -  Reputation: 1781

Like
0Likes
Like

Posted 27 June 2009 - 01:47 PM

Thread bookmarked. [grin]

#36 Hodgman   Moderators   -  Reputation: 26967

Like
0Likes
Like

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   -  Reputation: 364

Like
0Likes
Like

Posted 27 June 2009 - 09:30 PM

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

#38 Hodgman   Moderators   -  Reputation: 26967

Like
0Likes
Like

Posted 27 June 2009 - 09:40 PM

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

Depressing, I know ;(

#39 loufoque   Banned   -  Reputation: 92

Like
0Likes
Like

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.

#40 ApochPiQ   Moderators   -  Reputation: 14102

Like
0Likes
Like

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.






PARTNERS