« first day (561 days earlier)      last day (4377 days later) » 

11:00 PM
Hey I forget did Han fire first?
 
Hangul is a nice alphabet.
 
@classdaknok_t You need ; after the label, IIRC.
 
trolling attempt: fail
 
@Cat no, a colon.
@ScottW we have three levels, universiteit, HBO and MBO. Delft is universiteit. I can do at most HBO.
 
I simply got my GED, screw highscool!
 
11:02 PM
Yeah. On high school you have three corresponding levels. But you can't choose them. Your grades choose them.
I got NEP: no education possible.
:P
 
@RMartinhoFernandes hey, what's it feel like having such a high rep that you don't need to continuously troll for it and can instead only answer questions that are interesting?
 
@classdaknok_t After the label, not as part of the label, silly.
 
@Cat neither. A label isn't a statement.
 
I.e. void foo() { label: } is wrong, needs to be void foo() { label: ; }
 
11:04 PM
@stdOrgnlDave I've always only answered questions I felt like answering.
 
Because you have to label a statement.
 
The only thing that changed is that I don't prowl for new questions so often.
 
yes, let us bottomfeeders get some action
 
I always put non-null statements after labels, so I didn't know, ok?
 
11:05 PM
anyone used setjmp() and longjmp() legitimately in the recent past?
 
@ScottW yeah, TU Delft.
 
@classdaknok_t You use labels?
 
@R. I did in C a year ago.
For cleanup.
@ScottW I guess so.
 
@classdaknok_t Wait, What?
 
oh please don't get into a 'goto is evil' spiral :-(
 
11:06 PM
goto is good for cleanup in C.
 
@R. C doesn't have RAII, remember?
 
goto is good for stupidly complicated loops, too. that is, being able to break from multiple levels, that kind of thing
 
void a() { foo a = create_foo(); if (!a) goto end; bar b = create_bar(); if (!b) goto end; do_stuff(a, b); end: if (a) destroy_foo(a); if (b) destroy_bar(b); }
 
You very rarely need that, @std.
 
Boilerplate, but what did you expect, it's C.
 
11:07 PM
And if you do, you are doing some thing wrong.
 
@classdaknok_t I started learning C++ about one year ago, and before that I used C#. I doubt I touched C last year, other than when writing a couple blog posts about class exercises (which don't involve setjmp/longjmp at all, luckily)
 
Cool got it working
replace: ^p *
With:
^p represents a line break.
 
@classdaknokt I don't know what kind of highschool C++ you're doing but every now and then I do actually need to do a semi-complicated loop.
 
Hm. I started learning C++ in January. Before I was a C fanboy.
 
You can always factor the loop out to a named function.
 
11:10 PM
@std break stuff down into functions and you can just return.
 
sigh...
 
Or simplify the flow so it doesn't need silly tricks.
 
Named functions can clarify code too, because you have a name.
 
Loops? Who the heck needs loops?
 
I know
 
11:11 PM
@stdOrgnlDave hehe :)
 
RECURSION FTW!
 
Toucan Sam needs loops
 
Loops are overrated.
 
int main(int a){printf("%d "a-1);a<1000&&main(a+1);}
who needs loops?
 
Reusable encapsulated iteration patterns FTW.
 
11:11 PM
Recursion is what's overrated
 
Loops are imperative.
2
 
@std disallowed in C++.
 
@classdaknokt DUH
 
@Pubby Recursion isn't rated.
 
@StackedCrooked pure functions are imperative too.
 
11:12 PM
I concur with @StackedCrooked. on a scale of 1 to 10, recursion isn't on it.
 
PureFunctionFactorySingletonFactoryFactoryAllocators are underrated.
 
@StackedCrooked this variation was worthy of my star. So you still got something out of a good pun
 
on a scale of f(1) where f(x) = f(x+1) and f(10) = 0 recursion is _|_
 
honestly, I don't understand why we don't just ditch this whole backwards-compatability-with-C++-before-C++11 thing and just make a different language
 
11:14 PM
C++2.0
 
I'll call it Coxen
 
@stdOrgnlDave Everyone has tried. Most people just end up making something worse.
see D, Java, C#
 
for the large amount of time the latest standard was called C++0x
 
Let's make E
 
11:15 PM
@DeadMG I know, but it is a bit of a sad commentary on how much C++ has changed...
 
@DeadMG Don't forget WideC!
 
@sehe It's a little more funny than my previous variation: "Haskell is imperative".
 
@Pubby That hasn't been made yet :P Also, I dropped the "C" from the end.
 
We still don't have C flat ... till then ...
 
want to know what's really sad? the like two people on Wikipedia who go around editing every article to include examples in D so it looks like the language is relevant
 
11:16 PM
@StackedCrooked I noticed that. Hence my comment
 
@stdOrgnlDave What's sadder is that nobody has done it properly.
you'd think that it would be dead simple to make a better C++
 
C++11 never has examples :(
 
all you'd have to do is strip the C junk and not make any major mistakes
 
@Pubby What? It does! Look here: en.wikipedia.org/wiki/C%2B%2B11
 
@Pubby A language doesn't have examples. (I'm playing pedant :D)
 
11:16 PM
Remove the 30000 byte memory restriction from Brainfuck, add system calls and you have a decent, minimal, good, simple, no-crap Turing complete programming language.
 
but instead people do rubbish like universal base classes and value/reference types and all that rubbish
 
@ScarletAmaranth enharmonically equal to B
 
@RMartinhoFernandes On other pages I mean
 
A good programmer doesn't need examples
 
C++11 is an example for a programming language.
 
11:17 PM
A good programmer can look at the Boost examples and understand them
 
@classdaknok_t To be honest, even br*infuck has some crap. , and . are entirely unecessary.
 
D♭ ≅ C♯, C♭ ≅ B (germans would call that H...)
 
@R. When there are syscalls, yes they can be removed.
 
How do you think those poor sods running around Wikipedia editing it so it has D examples trying to make it look relevant feel when we roll back their changes?
 
@classdaknok_t I mean even without syscalls, , and . exist only for convenience. They don't affect Turing-completeness.
 
11:19 PM
Lisp doesn't have any of it.
 
@R. Yeah, but without them Brainfuck would be useless.
 
@stdOrgnlDave Superior. And rightly so.
 
Lisp doesn't have any of it, including any practical programs ever
 
@classdaknok_t Why? It can input from and produce output in the memory tape.
 
"hey Lisp is so great! I'll go program in it!" (two years later) "man this language is awesome! wait, you want an actual program?"
 
11:20 PM
@stdOrgnlDave Except, I don't know, tons of elisp code.
 
Well, if C is C4, then C++ is C5 ... a whole octave higher!
 
@R. It must be usable on normal PCs at least. We don't have Turing machines.
 
@classdaknokt hey guess what mr. super-pedant, go f*ck yourself, just because you're jealous of my Turing machine
I'm going to go play Crysis on the Difference Engine now
 
@stdOrgnlDave Wanna play online ? I go get my abacus.
 
@std I'm sorry, my thingy is not bendable enough to fuck myself.
 
11:22 PM
@ScarletAmaranth not unless you play hero academy
@classdaknokt I'm not generally one to comment on these matters, but if it is bending it that is stopping you, you may wish to see a doctor
pah, I just made the pun of the decade, and nobody gets it. computer history illiterates, all of you. get off my lawn which I'm drawing on a TI/99-4A
 
@std act normal.
 
@stdOrgnlDave I created a Tetris in Lisp. It was pretty straightforward. I mean no mind-bending at all.
 
@StackedCrooked just now?
 
Lol.
Yeah, it only took me 74 seconds.
 
that's about how long it takes me to write the logic for tetris
 
11:25 PM
@StackedCrooked since Lisp is popular in the field of AI, your Tetris clone must have excellent AI.
 
OK
"Lips is popular in the field of AI"
LIES
 
Cakes?
 
@classdaknok_t It didn't have an AI. It did post your score to an online database though, and then displayed the global top 10 at Game-Over.
 
everyone seems to be quoting that from the 1970's. almost nobody who does serious AI research uses Lisp exclusively or even mainly
 
Oh great, GCC is segfaulting on trivial code again.
 
11:27 PM
@RMartinhoFernandes I wouldn't exactly call those nested pointers 'trivial'
 
template <typename T,
          EnableIf<Bool<true>>...>
void f() { std::cout << "one"; }
template <typename T,
          DisableIf<Bool<true>>...>
void f() { std::cout << "two"; }
int main() {}
Looks pretty trivial to me.
 
wait, C++11 lets you >> now? most vexing parse is gone!?
 
lol, this is ill-formed though.
 
@stdOrgnlDave MVP and >> are two different issues.
 
11:29 PM
most vexing parse is the OTHER vexing parse
 
MVP isn't gone, but >> is.
 
@Luc how?
 
yay!!! time to make my code pretty again!!!!
 
Now that we have tuples, does that mean that don't need typelists anymore?
 
@classdaknok_t Bool<true> is not dependent.
@StackedCrooked I've been (ab)using std::tuple instead of e.g. boost::mpl::vector and surprisingly it can work for a lot of purposes.
 
11:30 PM
@RMartinhoFernandes I can see why GCC segfaults on that, you're slipping past the parser front-end
 
Yeah, I just thought that I can typedef a tuple instead of making a type list.
 
who here has ever actually had a real problem with the most vexing parse?
 
I had. Then I fixed it.
End of story.
 
Fucking function declaration instead of default constructor call. -_-
 
@classdaknokt Boost value_initialized<T> can help.
 
11:32 PM
OK BAI ALL
 
@LucDanton Oh, damn. Feel so stupid. It segfaults on the well-formed thing I intended though.
 
@StackedCrooked Or brace-initialization.
But it's just something to get used to.
 
@classdaknok_t That too.
 
@RMartinhoFernandes Ah, the joys of UB in your compiler.
Don't know if UB is even allowed though lol.
 
template <typename T,
          EnableIf<Bool<true, T>>...>
void f() { std::cout << "one"; }
template <typename T,
          DisableIf<Bool<true, T>>...>
void f() { std::cout << "two"; }
int main() {}
This one does not have UB.
 
11:35 PM
I wonder if implementing quantum mechanics requires reliance on UB.
 
@stdOrgnlDave weird definition of pretty
 
But it doesn't segfault either. Fuck, what am I paying attention to?
 
Oh how I love it when Xcode doesn't do code completion inside of templates you haven't instantiated anywhere.
 
@RMartinhoFernandes Compiles for me, although since I don't have the same Bool<value, T...> I'm using meta::DependOn<Bool<true>, T>.
 
@LucDanton Yeah, it compiles for me too. I'm not thinking straight, apparently.
 
11:37 PM
@StackedCrooked mostly, now we just call it by a different name?
 
Ah, EnableIf<Bool<true>> anywhere segfaults it.
 
WAIT
I thought you wan'ted to talk about code - it's on the starboard!
 
@RMartinhoFernandes Nice find. I'm blaming aliases.
 
With RANDOM we could have a random type factory.
 
@StackedCrooked ??
 
11:40 PM
Double underscores...
 
Oh, we can have that already, then. __TIME__ can work as a compile-time entropy source.
 
Cool!
 
I wrote a constexpr function to turn it into a number somewhere on this chat.
 
Mar 22 at 17:55, by R. Martinho Fernandes
Mar 8 at 10:12, by R. Martinho Fernandes
constexpr int get_seed(const char* time = __TIME__, int multiplier = 3600) {
    return *time? (((time[0]-'0') * 10 + (time[1]-'0')) * multiplier) + get_seed(time+3, multiplier/60): 0;
}
 
That's buggy though. Should be return time[0]*36000 + time[1]*3600 + time[3]*600 + time[4]*60 + time[6]*10 + time[7];
 
11:43 PM
Can the result of constexpr be used as a type param?
 
@StackedCrooked Yup. That's the deal with constexpr
 
As a non-type param.
 
So string literals can be ... Awesome!
 
Though using a random number generator in a pure funcional language without a state monad is awkward.
@StackedCrooked Not really.
 
That's what you did in the constexpr.
 
11:45 PM
@RMartinhoFernandes hehe. I failed to notice
 
@StackedCrooked Yes, but it produces a number.
 
Everything is awkward without monads.
 
If I wasn't fighting the compiler right now, I'd be building a TMP state monad.
 
Mongolia ftw.
 
@RMartinhoFernandes Literal types are crippled. Why bother?
 
11:51 PM
@LucDanton Fun.
But yeah, that literal types business is damn annoying.
And Bartosz already did it, it seems. bartoszmilewski.com/2011/07/11/monads-in-c
 
Doesn't look like it's compile-time.
 
Didn't look at it in detail, but it seems to use Return and Bind metafunctions.
template <typename T,
          EnableIf<Bool<true, T>>...>
void f() { std::cout << "one"; }
template <typename T,
          DisableIf<Bool<true, T>>...>
void f() { std::cout << "two"; }

int main() {
    f<int>(); // clang says this call is ambiguous
}
 
So, an empty pack of a type that it has not bothered to think about?
 

« first day (561 days earlier)      last day (4377 days later) »