« first day (1449 days earlier)      last day (3503 days later) » 

11:00 PM
It's all bullshit, period.
 
maths are always good to know
 
@AndyProwl Presumably X models C<X>, and Y models D<Y>?
 
yes
 
user1804599
I love cycling in drizzle.
 
Xeo
@AlexM. The ending was a troll. :< Need volume 5 of the novel animated! NEEEED.
 
11:02 PM
seems like a plain OR failure to me.
two perfectly good call candidates -> OR failure.
just like every other situation with ambiguous calls.
 
Ell
Do you think overloading by return type would be useful?
 
no.
 
Ell
I guess you can already do it with templates
 
@Ell Polymorphic constants
 
@Puppy that's what I thought. But I was also wondering whether the concept definitions themselves were not ill-formed, since they were referring each other
 
11:05 PM
nope.
 
ok. Thanks for helping
 
if I had X that modeled D<Y>, or D<int> or something, it would not be ambiguous.
 
user1804599
@Ell Yes.
 
there's nothing inherently ambiguous about those two overloads.
 
right
 
user1804599
11:06 PM
@Ell You can write amazing generic functions when that is possible.
 
Ell
I like the idea of multiple dispatch also
 
user1804599
Free function single dispatch is already incredibly useful.
 
user1804599
Hmm, maybe it can be implemented with macros and a global.
 
I am unaware of any compelling situations for multiple dispatch
the only examples I've ever seen of it are terrible Square : Shape crap.
(and even then it was only useful because their design was bad)
 
user1804599
No more visitor pattern boilerplate.
 
11:11 PM
you can drop that already.
 
user1804599
Better separation of concerns.
 
user1804599
Though single dispatch (not on this) handles that fine in most cases.
 
all cases, as far as I am aware.
 
user1804599
dynamic_cast if-else chains suck.
 
use a typeid jump table.
 
user1804599
11:13 PM
try/catch/catch/catch/catch/catch/catch XD
 
Ell
Writing a table sucks as well
 
really?
 
Ell
Native multiple dispatch is better than a table
 
I think that a completely extrusive external table[typeid(T)] = [](T* t) { /* stuff */ }; is fine.
especially given a helper that de-duplicates T, say.
 
Ell
I guess it can be done nicely
 
user1804599
11:16 PM
Not std::type_index?
 
I think that a std::type_info implicitly converts to one.
 
user1804599
OIC.
 
user1804599
Ah yeah implicit clittor.
 
std::unordered_map<std::type_index, std::function<std::shared_ptr<Expression>(Analyzer& a, Type* lookup, const Parse::Expression* e)>> expression_handlers;
template<typename T, typename F> void AddExpressionHandler(F f) {
    expression_handlers[typeid(const T)] = [f](Analyzer& a, Type* lookup, const Parse::Expression* e) {
        return f(a, lookup, static_cast<const T*>(e));
    };
}
 
11:17 PM
@Puppy corner cases probably. C++ has survived without multimethods so far, so perhaps leaving off multiple dispatch won't be a tragedy
 
I've been slowly eliminating all the dynamic_casts from my codebase.
I have a few where I don't think it makes sense to remove them, but most of them I'm cleaning out.
 
Ell
They have their uses
I'm going to try and write a nice multiple dispatcher tomorrow
 
user1804599
Why the fuck is type_index in <typeindex> and not in <typeinfo>?
 
no idea
@Ell Can't really be done portably.
 
user1804599
What.
 
11:27 PM
you can't search base classes of typeids.
 
user1804599
> main.cpp:8:81: error: wrong number of template arguments (1, should be 4)
 
which is bad and wrong.
 
user1804599
It's std::map. :|
 
well, std::map definitely takes 4 template arguments, and passing it 1 is definitely an error.
 
user1804599
It should default.
 
11:28 PM
it defaults the last two.
 
user1804599
Oh wait I should pass two.
 
@rightfold Needs two arguments.
 
you definitely need to pass at least two arguments.
 
user1804599
Then clang should say "should be at least 2," not "should be 4."
 
11:29 PM
should be 4, 2 of which could be defaulted
 
Ell
Should be at least 2
 
well, I agree that the diagnostic could be a little clearer (Patches Welcome!) but it's not really incorrect.
 
@rightfold Probably. Actually, you do need to pass 4, just 2 of those can come from the default values specified in the header (but even when you're using default values, those values need to be passed--i.e., the compiler normally has to generate code to push those values, then make the call).
 
2 mins ago, by Andy Prowl
should be 4, 2 of which could be defaulted
 
That's definitely a technicality that shouldn't be exposed to the user though.
 
11:32 PM
Evening
 
why do you do this to me
 
@JerryCoffin Pretty sure it can be as-iffed away.
 
@Sofffia Hmm...Somehow I suddenly feel the need for an afternoon snack.
 
user1804599
As-if rule is silly.
 
@Sofffia o.o dayuum... i just ate and now im hungry again, damn you
 
11:34 PM
how is as-if silly?
it's clearly the fundamental rule of program optimization.
 
user1804599
Because it's already implied by the lack of implementation details in the standard.
 
user1804599
It doesn't specify what 1 + 2 should be compiled to, only how it should behave.
 
that doesn't make as-if silly, it only makes it explicitly stated.
 
@Puppy Not easily. To do so, it'd need to 1) figure out that evaluating those arguments had no side effects, and and 2) generate code with (essentially) overloads for the different number of parameters. Both might be possible, but I've yet to see a compiler actually do it.
 
@JerryCoffin Clang can do it.
at least, I'm pretty sure it can do it.
 
11:36 PM
@Puppy I'll take your word for it (but we've been starting to do things with Clang/LLVM at work, so I might be looking at it again soon).
 
user1804599
Pretty sure you sure are pretty.
 
on this, you can feel assured that I have vastly too much experience with Clang's code generation.
 
How is job going, Puppy?
 
it's not going too badly.
but I really need to gain proper accomodation in Bristol.
 
user1804599
Kerststol > Bristol
 
11:40 PM
I used to watch a tv serie set in Bristol.
 
user1804599
Though a briestol doesn't sound too bad.
 
I feel like I know the city.
 
Have you been there?
 
user1804599
> Pressure 1016mb
 
user1804599
I'm under pressure. :(
 
11:41 PM
I had a True Bristol Experience on Friday
a tourist asked me where Template Meads was
 
user1804599
I love Earth.
 
What the hell is a "True Bristol Experience"?
True Bristol Experience™
 
@Nooble M5 out of there.
 
Is there a correlation between being a sad man and owning a nice set of sad songs?
 
Definitely Not
@MartinJames M5?
 
11:43 PM
Maybe everybody has the same amount of sadness to distribute in different sections of their life. So if you listen to sad songs you are actually an happy man.
What the hell am I talking about?
Good night.
 
Good Night!
Sweet dreams...
 
@Nooble Autobahn.
 
Ell
@andy thanks
 
@MartinJames Ahh...
 
Ell
11:44 PM
That PDF really is. Beautiful. Its so nice
I can't get over how great it looks
All the text and figures and layout is just beautiful
 
@LightnessRacesinOrbit That kid is one hardcore badass
 
Ell
I'm keeping it for reference
 
he's a little scrote
 
user457812
PDF where? Does it have comic sans? A lack of comic sans is a lack of beauty.
 
user457812
Comic sans is the the metric by which we judge the beauty in this world.
 
11:46 PM
Comic sans is life.
 
17 mins ago, by Andy Prowl
@Ell related: http://www.stroustrup.com/multimethods.pdf
 
@Nooble s/hardcore badass/fucking twat/
 
Ell
I wonder if anyone is pushing for open methods
I guess concepts and modules are much more in demand
 
So I saw one of those Google Street View Cars in the street
I made a really stupid face
Glad I'm not there in streetview
Good thing the car was just passing by
 
@Ell no prob
@Ell would be nice, but not terribly needed IMO
probably nobody bothered to write a proposal
or maybe it was rejected because of interactions with other language features
 
Ell
11:56 PM
The one you linked seemed like a very good proposal
And bjarne himself is behind it
 
at least a draft
also:
20
A: why there are no multimethods in c++?

sbiStraight from the horse's mouth: "I rejected multi-methods with regret, because I liked the idea, but couldn't find an acceptable form under which to accept it." Bjarne Stroustrup, The Design and Evolution of C++ (p297) And later: "Multi-methods is one of the interesting what-ifs of ...

 

« first day (1449 days earlier)      last day (3503 days later) »