« first day (1775 days earlier)      last day (3172 days later) » 

5:01 AM
@LucDanton I know why they're fundamentally different. One carries the implication that the "value" it contains "lives" in a variable-container while the other makes no guarantee of that--it can take a int&& which also discards the "variable-container" connotation.
 
@VermillionAzure That’s nonsense.
 
@LucDanton I'm going to write out my understanding and then you can correct me
 
Forget about references. Let’s use ints, longs, and braces to catch narrowing conversions.
 
@LucDanton The lambda captures the int i, so that means that it automatically "starts" with the reference in its scope/environment
It then returns the value, which is not a reference.
 
@VermillionAzure Irrelevant whether true, false, or nonsensical.
 
5:03 AM
below captures the lambda directly, which means it starts with it in its scope
WAIT NO
It captures the value
 
Let’s use this example instead, it’s one less capture.
 
It then returns the evaluated form of the lambda, but widens the output to a long value
 
Alright, let’s get rid of captures.
 
@LucDanton I know, int -> long
 
5:05 AM
 
@LucDanton yes I know about widening conventions
 
kay
 
@LucDanton What are you trying to show me
 
Now, note the naming convention: below is called that because it’s the one that calls above. In fact, maybe I should have named it caller.
 
@LucDanton What am I missing here
 
5:06 AM
I want you to write a function caller that calls another one—but not for its results, for feeding it an argument.
 
> but not for its results, for feeding it an argument.

Wait what
what does that mean
 
Right now we have return { above() }; inside below—I want instead return above({ /* something */ });.
So that means we will have void above(/* something */) {} instead, too.
 
Good start. We’re going from returned values to arguments (i.e. fed values) though. So things that looked like X foo(); I want them to look like void foo(Y);.
 
@LucDanton I don't understand what this means
 
5:10 AM
Where we had int above(); before I want either void above(int); or void above(long);. Likewise below. You can try different combinations.
 
@LucDanton But that won't work
Because you need to return a long for below()
 
Likewise below. Now it’s void(something).
 
@LucDanton Do you want to do capture or something with references?
 
We don’t care about returns now. It’s about passing in an argument.
No captures, we’re using functions. No references, only int or `long.
 
@LucDanton You can't if you want to return something
 
5:12 AM
Of course inside main we’ll have to use below(something) instead of below(). Gotta start with an initial argument.
@VermillionAzure We don’t. It’s all void returns now.
 
I don't understand what you want of my
 
Humour me and do it mechanically if that’s what it takes.
2 mins ago, by Luc Danton
Where we had int above(); before I want either void above(int); or void above(long);. Likewise below. You can try different combinations.
We’re writing new, different functions.
The one thing we keep is that below calls above.
 
@LucDanton But now you can't call above as the return value of below because above returns void
 
@VermillionAzure Did you try?
What does it look like to call a function?
 
I don't understand.
And I'm running out of time; I need to bus it and I'll lose the internet on my laptop
 
5:14 AM
Yeah, we’re using the braces to watch our values. But our values are now the arguments.
 
I don't understand where this is going
I'll just ask a SO question already
 
Don’t.
 
You'll get blasted into oblivion.
You don't have a question, essentially.
 
So, since our values are the arguments, that’s where we put the braces: foo({ the-value })
Instead of return { the-value };. Does that make some sense to you?
 
@LucDanton not remotely
 
5:15 AM
k, gimme a sec to think of something then
Guess we’ll go with derived-as-base then.
 
@LucDanton I can't code anymore; I need to get off the laptop
 
no more braces
We’re still doing conversions and handling values. It’s all deliberately plain.
 
slicing intended?
 
@ArneMertz Everything plain.
does this error make sense to you—we’ve flipped what each function returns
Welp, another time maybe.
 
Mobile
Yes it does
But references vs values are a different story
 
5:22 AM
@VermillionAzure Forget about references. We don’t need them.
 
Just tell me the direct and see if I understand
 
If you change the functions to take values rather than give values, then the relationship there is between the parameters is opposite of the relationship there was before between the returns.
 
Yes, that's splicing
 
That is not the fundamental difference.
See, this is why I wanted you to figure out a_caller by yourself.
 
I see derived -> base and information lost
 
5:26 AM
Yeah.
So we can’t write the functions the other way around—a_function taking derived, a_caller taking base.
 
But a base can be cast to a derived, right?
Likewise , int -> long
 
@VermillionAzure Just to make sure: we’re precisely not converting base to derived. It’s always derived to base. If we had mad a mistake, the compiler would yell at us. You can try, too.
 
But I can't try because mobile
 
Well, that puts a hamper. Hands-on experiment really helps a lot. The functions write themselves out, so to speak.
@VermillionAzure I won’t answer because I don’t want to run into 'casting', whatever that is. We’re doing conversions and we can’t convert a base to derived.
 
So you're saying that std::function wont take a reference because of the same reason long cannot be coerced to int
 
5:30 AM
Ultimately std::function<Sig> calls something, so it plays the role of a_caller.
 
But it'll just pass int& into int. That's a valid call
 
Hang on. Coliru is taking some time.
@VermillionAzure correct
 
Oh hhhhhhhhhhhhhhhj
nvm brain fart
 
Finally.
 
Somehow I assumed the function called the wrapper
So the answer is that std::function called the wrapped function, not the other way around
...
If you pass an rvalue to a function that takes a value, what happens? Does the argument value just cease to exist assuming we do not manually preserve the value?
 
5:39 AM
@VermillionAzure Zero will never cease to exist.
Inasmuch as it can be said to be existing.
 
...okay my bad I meant is the value still preserved anywhere or is it truly out of scope
 
ICE-Hunt, day 4 -.-
 
@VermillionAzure Same difference.
'Value' in the C++ sense might as well be 'value' in the mathematical sense.
 
Is the lvalue dead
 
@ArneMertz I’m sure they have time tables and everything.
 
5:42 AM
The container
The value corpus
 
I don’t understand the question.
 
Fart escalated to a shart.
 
If I move a value into a function that takes a regular value, what happens to the argument value in scope/memory
We are free to treat the rvalue as an expiring value but by pa
I'm missing an axiom here
Nvm
 
Scope and memory do not apply to values. See: value in the mathematical sense.
 
@VermillionAzure if it has value semantics, it will bepreserved, because the called function made a copy
 
5:44 AM
Also, if you want scope and memory, read the C++ spec on scope. It is very specific and unambiguous.
All your whys are there. And every question of "why not" can be answered because it is not in defined in the spec. Or defined as a no-no. Or sometimes UB.
 
Right uhh
So what happens when you convert l to rvalue again?
You allow people outside to "steal" it's contents or something
 
No. You 'get' a value. It’s handwavy like that because it’s a very fundamental thing.
 
And you don't care about the lifetime of the original or something like that?
 
You are referring to move semantics.
 
@VermillionAzure No such thing.
 
5:48 AM
Yes I know they're related but I must be confusing r with xvalue
 
You’re confusing objects/variables with values; and possibly objects/variables with expressions.
 
I'm very confused
 
int i = 0; int j = 0; // two objects, one value
 
Yes I know but
So I guess what's the relationship of both to xvalues?
 
'both' being what, the objects?
 
5:50 AM
lvalue and rvalue
 
What does gl stand for?
 
An xvalue is an expiring object, referenced through rvalue references and will go out of scope once the function which digested it does.
generalized lvalue, which is lvalue of xvalue
 
@VermillionAzure There’s no exact answer but the folklore is that it’s a generalized lvalue.
 
As the graph shows
 
5:52 AM
btw any time you see 'lvalue' or 'rvalue' it means 'lvalue expression' or 'rvalue expression'. They’re not mathematical values.
 
and it is also used to confuse OpenGL users.
 
So it's an lvalue that can be accessed only by rvalue semantics because it will no longer reference something that exists after it goes out of scope
But lvalues are not xvalues so hence we have glvalue to split the name
 
@VermillionAzure No. The arrow between e.g. 'glvalue' and 'lvalue' means 'an lvalue expression is a kind of glvalue expression'.
 
An lvalue is a glvalue is an expression.
An xvalue is a ( glvalue || rvalue ) is an expression.
 
But what is a glvalue? What makes it different?
 
5:56 AM
Get it?
 
@VermillionAzure Well each (or most) of the C++ expressions have a definite value category.
E.g. if the declaration int i = 0; is in scope then the plain (sub)expression i is an lvalue expression. By definition.
 
So when we talk about conceptual lvalues, it's glvalues. But the semantic lvalue is the non-xvalue lvalue concept
I'm trying to build a framework for understanding and rationalization
 
I’ll file what you just said into 'more nonsense'.
 
oh, come on, man.
 
@ElimGarak Not a first offence.
 
5:59 AM
I'm trying to understand why we need glvalue to define semantics and how it makes sense to have it or think about it when I understand it.
I suppose I'm trying to create an axiom-like mental model for myself based on intuition supposed by reason in order to support the actual semantics
6
 
Dat last sentence.
 
Aka I wanna dumb it down to a point where I can get it through the dumb definition and not memorize a set of rules
 
I don’t know if or why we need them. Presumably it may make some wording easier—it’s very common for the Standard to define things which purpose is to define other things. Not everything is aimed at the end programmer. The Standard itself is not aimed at the end programmer.
I almost never think about the glvalue expression notion.
@VermillionAzure It’s already dumb.
 
@LucDanton maybe to you, who already understands it
 
No, it’s not personal. There is no underlying secret to unlock, there is no understanding.
 
6:02 AM
People like to generalize shit. If something can be systematically analyzed, people are going to do it. Lvalues and Xvalues are under the same glvalue banner because xvalues are usually named rvalue references, which are lvalues with the notion that the object they are referencing is going out of business at scope's end.
I cannot make it dumber.
 
Would you guys say that having two functions:

template<typename T>
void Fun(T* t, ...);

template<typename T>
void Fun(shared_ptr<T> t, ...);

In the same class (the functions are named the same they are overloads) is bad? Both functions behave slightly differently, the difference is documented
Should I name them differently to be extra clear
 
The Standard has a big list of expressions. Some of them it files under 'lvalue expressions', some of them under 'xvalue expressions', some of them under 'prvalue expressions'. You can choose to use 'glvalue expressions' to refer to both 'lvalue expressions' and 'xvalue expressions' if you want.
That’s it.
 
@ElimGarak and this further convinces me that I can abstract xvalues as lvalues that must be rvalhes because they're expiring and not going to act as a container for a value after it expires
 
Don't abstract anything. Let the guys who work on the spec do it for your right now. There's time.
 
But I cannot understand without abstraction
 
6:04 AM
It's already at abstraction level 9000
 
But it's not; they have a set of arbitrary rules that have no meaning explicitly
 
@Prismatic It’s fine, it’s a nice use of partial ordering if that’s what you’re wondering about.
 
glvalue is just a convenience which you can use to refer to both without actually qualifying which if the context is clear enough.
 
If understanding is implicit, I must perform transformation on the data and concepts given to me in order to being it into a form where understanding is implicit
 
@VermillionAzure Yeah. It’s all language-lawyer stuff to make things work. Very boring and tedious.
 
6:06 AM
@LucDanton and this is why reading the standard is not conducive to building understanding, and therefore, learning
 
Yes. Don’t read it.
 
@LucDanton partial ordering? my concern was its easy to call Fun(thing.get(),...) when you meant to call Fun(thing,...). Since smart ptrs cant be implicitly converted to a raw pointer I can have the functions overload properly but it seems a little shaky
 
@Prismatic ghetto solution: create new derived class with templated operator T*
 
@Prismatic To make things simple, something that looks like T* will never look like shared_ptr<T> no matter the choice of T, and vice versa. Hence you have a nice partitioning of the possible argument types, which is very easy to reason about for either the compiler or the programmer. That’s really what you want from programming languages.
(Regarding your particular use of partial ordering.)
 
@LucDanton ironically the smart pointers are supposed to be conceptual substitutes for raw pointers at its root
 
6:10 AM
@Prismatic You can still choose for separate functions if their functionality is that different. We can’t tell that from the signatures alone though.
@VermillionAzure More nonsense.
 
@VermillionAzure Smart pointers are supposed to be tools for programming chumps not to shoot themselves in the foot and bleed memory all over the place. They also signify valuable ownership info, leaving raw pointers to serve a better, less dangerous purpose.
They're not a substitute by any stretch of the imagination.
 
@LucDanton Intuition, abstraction, and understanding is important for all design... Even for meta-design and thinking
 
@VermillionAzure Nonsense inbound. :P
 
@VermillionAzure 'X is nonsensical' does not mean 'X is wrong/incorrect'.
 
sometimes vermillionazure sounds like a markov chain generator gone amock
 
6:12 AM
^
 
then again so does the standard lol
 
If I had to pick a human to fail the reverse Turing test (assuming he is human), that is who I’d choose.
 
To be truthful, intuitive languages are successful presumably because they increase ease of production
But what causes increased ease of production
 
Vermillion, who booted you this morning with the verbose flag?
 
@ElimGarak lol wut
I should really study science of understanding
 
6:16 AM
Or you know, real science.
 
@ElimGarak Education is a real science
Unfortunately the word itself is loaded with connotations
 
If you cannot measure/quantify anything, it's not a science.
Measurement is the only criterium of truth. Everything else is something else*.
Not to be unnecessarily inflammatory.
 
6:48 AM
Mawning, Xeo.
 
The view from the #yandex office in Novosibirsk, RU. Not bad! http://t.co/pofuCJDNlZ
Erm. In my humble opinion that's either not a flattering picture, or that city really has all the flair of, say, Almere
Moanings everyone
 
That's a depressing, pic. Looks something out Metro 2033.
 
Novosibirsk... right. Top of my vacation list for, well, actually, never.
 
Also, Chernobyl.
 
@ElimGarak Higher up the list than Novosibirsk.
 
6:51 AM
@ElimGarak Makes you wonder whether that is the uninhabited part...
 
My next vacation. :Đ
 
Owned car 28 mon, saved +$5,600 in gas to date. + added solar whch cut elec bill by 30%. @TonbyMcConnell @RichardDawkins @drg1985 @solarcity
This also. She's talking about a Tesla, obviously. And catelessly mixing in "added solar"
 
Ahahah
 
@ElimGarak You don't intend to have any, then
 
True. Mass Effect Andromeda not coming before early 2017.
 
6:54 AM
@ElimGarak "Check your privilege" comes to mind.
 
Saved $5600, paid $70000.
 
She doesn't boast how long it will take for those 30% to repay the investment on solar alone. Never mind how much tax has been dodged raising the money for the car
 
Personally, I've been trying to find a way to get a Dodge Charger, the new one, into my country. But we have some weirdly high emissions taxes on top of everything else. Always some goddamn issue. But the government that brought it is going down soon, so.
 
@R.MartinhoFernandes In benchmark_function, why do you split concept and model?
 
MaybeT is not in mtl, blows my mind
 
6:59 AM
@ElimGarak Same everywhere nl.wikipedia.org/wiki/…
@MaiLongdong Good mornings
 

« first day (1775 days earlier)      last day (3172 days later) »