« first day (1349 days earlier)      last day (3601 days later) » 

8:00 PM
oh yawn yawn
 
user3010322
~_~
 
user3010322
FFS
 
user3010322
XAML doesn't take functions
 
user3010322
only properties and objects
 
user3010322
I'm sorely missing C++ now.
 
user1804599
Functions are objects!
 
template < class T >

I assume using T is just some standard, and that T could just as well be TYPEPARAMETER ?
 
user1804599
At least, in any sane language that features objects.
 
@Chimera All-uppercase names are conventionally reserved for macros.
 
Xeo
@Chimera no, all template parameters must be named T!
 
8:04 PM
but T is typically used for template type parameters, must like i is often used for loop indices.
 
@Chimera A convention, yes.
 
@milleniumbug ok thanks.. that's what I thought, but I didn't want to assume...
 
@LightnessRacesinOrbit sigh RAII is respected by goto so... yeah you can easily use goto very efficiently AND still get correct resource cleanup without worrying too much.
 
@LightnessRacesinOrbit lol, goto for error handling is a common idiom in C which is far better than using break in for, and he should know this.
 
Alright - I'm BSc. ScarletAmaranth now
 
8:12 PM
@milleniumbug it's nice in C++ as well, as RAII is respected, so you can let the blocks sort out cleanup
 
@milleniumbug That's like saying that shit tastes best with sugar.
 
@ScarletAmaranth Congrats, what in?
 
@Mgetz CS
 
@Puppy it does?
 
@ScarletAmaranth yay
 
8:15 PM
dunno
personally I'd rather not eat a shit, regardless of whether or not it's had sugar added.
 
@Puppy It doesn't invalidate my point.
 
I wonder if feces is edible. Bear grylls drank piss. His next feat would be eating moose crap.
 
@Puppy, goto can be really dangerous in C, but in C++ it's at worst confusing and at best useful. You don't have any of the "gonna break shit everywhere" problems.
 
@cyberspace009 Depends on the species and how you care to define "feces". The oxygen we breathe is a waste product from plants.
 
@OmnipotentEntity RAII is superior.
 
8:17 PM
@milleniumbug No, it just makes it kinda irrelevant. It doesn't really matter whether or not shit tastes better with sugar- you'd have to be insane to eat the aforementioned shit in the first place either way.
 
@milleniumbug, I agree, but the Venn diagram for goto and RAII is not a perfect overlap
 
@OmnipotentEntity The point is that C is so primitive it needs goto for error handling, and all the other goto uses are unnecessary, while C++ has RAII which eliminates the only need for goto, so it has no use in C++.
 
user1804599
I use sometimes goto for jumping out of nested loops.
 
And I refactor.
 
user1804599
If goto becomes a problem your functions are probably too large.
 
8:21 PM
breaking out of control flow is something break does suboptimally IYAM.
I'll probably (one day) introduce named loops in Wide.
 
@Mgetz yep
@milleniumbug I think he probably does. He's just being an idiot
 
user1804599
That’s fucking horrible.
 
I always read that as leningen
 
user1804599
I am rebellious! % LEIN_IRONIC_JURE= lein new sqlojure
 
8:26 PM
my brain, it's the brokens
 
my coke intake is huge during exams
 
user1804599
I am even more rebellious! github.com/rightfold/leiningen/commit/…
 
it makes me feel weird but at the same time it alleviates stress and keeps me awake
@rightfold #fuckdapolice
 
whew
 
8:33 PM
bahaha
 
Putin must be so glad that Suarez bit that guy, else he'd still be the official butt monkey.
 
this reminds me of that FF VIII playthrough
in which the guy named Rinoa "A whore" and her dog "Anal"
so the game said "A whore's limit break uses Anal"
 
@milleniumbug goto definitely has a place in C++, but only IMHO when used properly with RAII
 
looks like pre-2007 RuneScape
 
8:41 PM
I have not used goto in any compiled high-level language, or C, ever. Never found any need for it.
 
If have not used while in any compiled high-level language, or C, ever. Never found any need for it.
:P
 
@MartinJames nor by and large have I, but it is valid in certain cases. I would normally use it as a non-exceptional fail-fast
 
@StackedCrooked lol my assembly prof was like
"for's and crap like that are just special cases of do-while, useless shit that you can live without"
 
@Mgetz return false;
 
@MartinJames not always appropriate, but what I am for in most cases
 
8:45 PM
Absence of goto is not an indicator of quality.
IMO.
 
@StackedCrooked I would agree - I just never found any use for it.
I'll put 'using goto' on my bucket-list.
 
Goto is disappointing in C++. It's touted a as a powerful but dangerous feature. But in reality it's neither powerful and nor dangerous.
There are other features that are way more powerful and way more dangerous (e.g. macros).
 
I have a 120K line project that I'm working on, and I've used goto exactly once.
I thought it was 0 times, but it turns out it was exactly once.
to break out of two for loop, without breaking out of 2 more it looks like, and the code has been restructured to remove the crazy for loop stack, so it's not required anymore.e
removing it.
 
user1804599
Does the order of tables in a FROM clause matter in SQL?
 
user1804599
user> (write-stmt (select #{:t :u} [[:t :a] [:u :b] [:u :c]]))
;; => "SELECT t.a, u.b, u.c FROM t, u"
 
user1804599
8:52 PM
Woohoo.
 
Question of the day:
Damn... deleted already.
 
hi
 
@Rapptz, hi there.
 
hello
what's up
 
hi
 
9:00 PM
mostly long drawn out arguments over 9/11 and goto usage, also funny pictures and making fun of people who are wrong on the internet. Normal Lounge<C++> stuff.
 
We add return *this and return this support for our lua wrapper thing and now people want to return new instances and expect it to work automagically :(
There's only so much magic you can do
 
differentiating between a new instance and the current instance seems simple enough, it's just a pointer comparison.
 
I'm not really sure how to make new instances work
 
@Rapptz The ceiling, mostly.
 
@OmnipotentEntity You weren't kidding.
 
9:13 PM
> Normal Lounge<C++> stuff
 
user3010322
@Rapptz What do you mean? Doesn't it already work?
 
apparently not :v
And I'm not sure how it'll ever work
 
user3010322
This looks like a job for...
 
user3010322
THEPHD!!!! :D:D:D
 
9:14 PM
smacks no
 
user3010322
I'll do a more thorough job than that other person ever did.
 
user3010322
@Rapptz :C why not?
 
you can try
but I legitimately don't know how you'd make that work
 
user3010322
You'd just return the same thing as :new() would
 
user3010322
Except using a copy construction
 
9:16 PM
if by "more thorough" you mean "more thoroughly undefined"
 
@Rapptz, I have something similar working in my game already, let me see if I can figure out what's going on on your end and I might be able to help... maybe.
 
user3010322
@OmnipotentEntity WE DON'T NEED YOUR HELP HERE. D:<
 
what if you have a function returning class X but it isn't a registered userdata?
@OmnipotentEntity sure
 
user3010322
@Rapptz I'm... uh. I'm not sure. Perhaps catastrophic failure?
 
error, obviously.
 
user3010322
9:17 PM
I mean, at that point, I think it's expected the thing would crash since it would have no idea how to handle it.
 
how do you separate between those registered and non-registered?
 
stick the ones that are registered in a table in the registry, obviously.
 
cause atm the error apparently only happens at runtime (?)
 
user3010322
You don't, you just crash when somebody tries something.
 
huh, nevermind, that's much closer coupling than what I have going on.
 
Xeo
9:18 PM
great error handling, guy
 
hey man
 
user3010322
Well, how else are you supposed to do it?
 
user3010322
It's impossible to detect at compile-time if something is registered or not.
 
@OmnipotentEntity You mean the wrapper I have?
 
Xeo
Well don't just fucking crash and burn, but yield a useful runtime error? :P
 
9:19 PM
Thanks for telling me.
Informational
 
user3010322
@Xeo I guess the one way to do that would be looking for class X's metatable.
 
user3010322
And if it's not there, throwing.
 
@sehe telling you what?
 
What you told me (hint: reply-arrows).
 
here's an idea
register it if it's not already registered.
 
9:22 PM
> "Christians for ...." approved?
 
user3010322
@Puppy But you can't just "register it", because there's no compile-time reflection. To "register it", we need to know what functions you want to hook up to where.
 
if T::register, call it, else, compile-time fail.
 
Xeo
register it as a class that has nothing
@Puppy meh
 
@Rapptz, yeah, mostly we have callbacks and ways of porting data back and forth and never the twain shall meet. You might be able to make something work by setting metamethods, but you probably already are doing that (I haven't checked the code) and I'm not sure which metamethod would even be useful here.
 
user3010322
@OmnipotentEntity Yeah, we've gone a little beyond that now.
 
user3010322
9:24 PM
We've got extreme class binding going on, such that you can new a C++ class inside of lua and call member functions on it, like you're in OOP land.
 
well it does indeed crash with a useless error
 
that's not very extreme at all.
 
data.stackexchange will be offline for a few minutes while we shuffle the network a bit in Oregon.
 
lemme check with gdb
 
inb4 whole site goes offline for 5 hours
 
Xeo
9:25 PM
you've got no faith left, eh
 
user3010322
@Puppy It's extreme when you consider every other binding makes you do ridiculous template syntax or macro calls to register your stuff.
 
@Xeo Faith in statistics!
 
Xeo
@ThePhD Do you still have your function_traits shit?
 
pretty sure I removed it
or I remember removing it
 
> LINQ to XML's loading functionality is built upon XmlReader. Therefore, you might catch any exceptions that are thrown by the XmlReader.Create overload methods and the XmlReader methods that read and parse the document.
 
user3010322
9:26 PM
I think we don't use it anywhere anymore...
 
nope
still there apparently
 
Xeo
lol
 
Of course, it would be too hard to tell me which exceptions we're talking about here
 
only used for lambdas and functors
 
Instead of sending me on a fucking treasure hunt
 
user3010322
9:27 PM
@Xeo Turns out it's actually necessary in this case!
 
Xeo
I shall not concur
 
@EtiennedeMartel Those derived from XmlReaderException?
 
Xeo
@Rapptz lol "only" - exactly where it's least useful
 
@sehe Isn't that Java?
 
Xeo
and / or working
 
9:28 PM
you make it seem like I'm not aware of this
 
@EtiennedeMartel Yup. Though: msdn.microsoft.com/en-us/library/…
> XmlReader throws an XmlException on XML parse errors. After an exception is thrown, the state of the reader is not predictable. For example, the reported node type may be different from the actual node type of the current node. Use the ReadState property to check whether the reader is in error state.
 
:v
 
user3010322
There might be a way to get rid of it entirely...
 
Xeo
Yes - explicit type annotation
 
@sehe Create seems to throw a bunch of different exceptions.
 
Xeo
9:29 PM
(which is good)
 
global variables are a must some times :(
 
user3010322
The problem, however, is that the function call is delayed and comes from inside of lua. We can't get the type information at that point for what's being passed into set_function.
 
Xeo
@cyberspace009 shoo shoo
 
@Xeo Im I wrong?
 
9:30 PM
very
 
You're not wrong, you're just trying to start shit again.
 
@OmnipotentEntity Oh. We tried to make lua <-> C++ somewhat neat and clean but it's hard to do it all the time with the type erasure lua essentially employs.
 
@OmnipotentEntity No I'm not. I'm trying to solve this problem. I'm being tempted to use it.
 
Do it the official OOPâ„¢ way and make a singleton :>
 
Xeo
Global variables suck
don't use them
 
9:31 PM
A singleton is still a global.
 
Xeo
They may make your code easy now but they complicate shit horrible down the line
 
@Xeo ok
 
user3010322
If someone gives us a lambda like lua.set_function( "woof", [] (){} );, we have to handle that without them going auto fx = [](){}; lua_set_function( "woof", std::move(fx));
 
and global variables aren't so horrible as long as they're conceptually const.
 
Xeo
> :>
guess why he used that
(hint: sarcasm)
 
9:32 PM
I also added a nice little â„¢
 
user3010322
Or without requiring that someone do lua.set_function( "woof", fx, &fx::operator() );
 
@OmnipotentEntity I smell a roach, amirite
 
Ah right, I missed that, even though it pretty much had giant flaming letters pointing it it.
 
@OmnipotentEntity Yeah, well I read two articles on why is ok to use Global Variables and why it is a bad idea to use them. I will not use them. I know it will simplify the problem I'm in but I should listen.
 
user3010322
That kind of syntax breaks the Lambda Magicâ„¢
 
9:33 PM
std::cerr, std::cout, std::cin and std::clog are global objects.
 
Xeo
@ThePhD lua.set<R(T...)>("woo", fx)
 
yes, and they're terrible hacks.
 
Xeo
and deduce that it sets a function by the fact that set is passed a function type
or something like that
 
@Xeo That is something I explicitly wanted to disallow.
 
Xeo
what
why
 
9:34 PM
It's redundant
 
Xeo
Not with functors?
 
user3010322
In some cases, yes, it's redundant. But if a poly-lambda is given then it will be all too necessary.
 
Xeo
if you want to get rid of that function_traits deal
or anything like it
 
user3010322
... Except, and here's the rub: poly-lambdas can't be used, because lua can't template.
 
yeah but I'd rather have a necessary evil than do that
 
user3010322
9:35 PM
So at that point they'd have to eat the ugly syntax no matter what.
 
Xeo
overloads
Also: Poly-lambdas aren't special! (surprise!)
 
we already know
 
Xeo
it's not about lua not being able to do templates
 
lua doesn't have overloaded functions either
 
user3010322
I wouldn't mind changing it so long as we can Keep The Magicâ„¢®
 
Xeo
9:37 PM
so? what if you just want to bind one specific version of an overloaded / templated function / functor?
 
use std::function and then bind that
 
Xeo
ugh
 
user3010322
Or, lua.set_function( "woof", overloaded, overloaded::operator()<T....> );
 
user3010322
But I agree that both of these options are terrible.
 
I don't want to explicitly specify the types when it's redundant in 90% of cases :|
 
user3010322
9:39 PM
Is it possible to have a lua.set_function<T...>( "woof", overloaded ); that won't conflict with our current magic?
 
user3010322
(We don't need to specify return type as we can get that from std::result_of)
 
yeah..?
 
Xeo
I don't understand why you guys so adamantly refuse lua.set<R(T...)>(...)
 
user3010322
@Xeo I don't refuse it, I just don't want to do it with everything.
 
user3010322
It should be a disambiguator, not the default syntax.
 
9:40 PM
^
 
Xeo
@ThePhD Specifying result type can allow conversion and swallowing with void
 
user1804599
When you don’t have a unit type, your warranty is void.
 
user3010322
@Xeo True enough... maybe I can have a version that takes R and one that does not and just deduces R ?
 
you have to specify R
not specifying R is kind of retarded
 
Xeo
eh, he's not totally wrong with deducing it through result_of
 
user3010322
9:42 PM
It's just you can omit the parens if you don't specify an R.
 
er mah gerd saving a whole two characters!
 
Xeo
@ThePhD if it's a single template argument, and it has the form R(T...)
 
user3010322
Because R(T...) matches a differently than just T...
 
Xeo
@Puppy plus all the characters for the result type
 
user3010322
9:43 PM
Now my brain is swirling about C++ in the middle of work,
 
user3010322
and all I have in front of me is WPF and XAML.
 
Good.
I was afraid, for a moment, that something wasn't going to be labeled retarded.
 
user3010322
You can partial-specialize member functions, right?
 
user3010322
Oh, wait, no you can't... but you CAN check std::is_function for a single template argument
 
user3010322
Or just use overloads and matching to do the work.
 
user3010322
9:45 PM
But what if one of the arguments is a functor itself...
 
user3010322
std::is_function would false-positive...
 
@LightnessRacesinOrbit I chuckled
 
std::is_function only works with regular functions
 
Xeo
no?
std::is_function operates on function-types
 
@ThePhD are you still fighting the same windmills after... 2 years?
 
Xeo
9:46 PM
like R(T...)
 
that's... what I meant
 
@LightnessRacesinOrbit Don't inject marijuana kids.
 
what did you think I meant?
 
Xeo
Actually, not sure. But it sure sounded weird
 
user3010322
9:48 PM
So a functor doesn't trigger std::is_function
 
Xeo
2 mins ago, by Xeo
std::is_function operates on function-types
 
@LightnessRacesinOrbit The best jokes are subtle.
 
@Jefffrey Rather, don't inject one marijuana
 
Unsubtlety is _retarded_.
Is my sneakin' suspicion
 
Xeo
9:49 PM
std::function<R(T...)> -> true
std::function<T> -> false
 
user3010322
Well then, that's great.
 
user3010322
std::is_function can help us chop the two up.
 
Xeo
tag dispatch on true_type/false_type?
 
user3010322
Or just SFINAE, since we don't care about VC++
 
user3010322
And the next time sol will be able to run in VC++ is VS 14.
 
9:50 PM
I have something
Callable<T, Args...>
checks if T can be called with Args
 
user3010322
Callable will pick up on functors, which we don't want.
 
Don't know if it's useful but it's there if you want it
 
Xeo
@Rapptz He wants to distinguish set<R(T...)> and set<T...> right now
and you could do that with is_function on the first argument
(btw, if the first is a function type, require the rest-pack to be empty)
 
@Chimera You mean, like in 1994?
 
Xeo
static_assert(!std::is_function<First>() || sizeof...(Rest) == 0, "..."); kinda deal
 
9:52 PM
@LightnessRacesinOrbit Cool. Didn't it was hosted in the USA before.
 
user3010322
If someone does lua.set_function<callable>( "woof", my_func_that_takes_callable );, then Callable<T, Args...> will actually grab the callable, when all we want to do is specify that the overloaded function should just take a callable.
 
user3010322
Man this is getting complicated. :(
 
Xeo
Welp, I'm going to sleep
have fun
 
user3010322
Wait!
 
@ThePhD my code is getting complicated
 
user3010322
9:55 PM
One more design question.
 
user3010322
It's a quick one.
 
Xeo
shoot
 
[theme from final Jeopardy plays in background]
 
user3010322
Right now lua.set_function is using an "optimization" and not storing the passed in functor/lambda if it's A) a pointer (this, T*) or B) an l-value reference (*this, T&). It moves on T&&. However, std::bind and all other things copy on (*this, T&). Should we follow their behavior?
 
@RobertHarvey Good timing.
 
user3010322
9:57 PM
And if we do, how do we exempt a person from copies on (*this, T&) arguments?
 
Xeo
@ThePhD Copy by default
It's basically the only sane option
and inspect arguments for reference_wrapper
the unwrapping of those is pretty simple
 
user3010322
Hrrmph...
 
user3010322
I never liked forcing std::reference_wrapper to prevent copy... :(
 
Xeo
1 min ago, by Xeo
It's basically the only sane option
 
user3010322
I still don't know why it's the only sane option, especially if we have r-value categories now.... but.
 
9:59 PM
It doesn't seem like my PR is getting accepted.
 
Xeo
just because you pass an lvalue doesn't mean it lives longer than the bound thingy
and you don't always want to move it in there
so you'd have to manually make a copy
I find it easier to just assume copy by default and specify references
 

« first day (1349 days earlier)      last day (3601 days later) »