« first day (1567 days earlier)      last day (3372 days later) » 

10:00 PM
How did it find the match..?
 
I think the point was: it didn't?
 
@StackedCrooked It didn't. That was the problem.
 
@sehe I mean how did it manage to consider two unrelated types to be equal?
 
it didn't.
 
It didn't. variants were involved
 
10:01 PM
it came back and said that the type was not in the variant.
 
@sehe The one I use is slightly more, erm, "configurable" (it requires you to specify an id<T>() before a lambda for Ts (and that matches all variants of cvref-qualifiers), but if it says id<volatile T> instead, then it only matches volatiles). Handy little thing, that.
 
my point is that it's true that I made a dumb in this case, but boost::get could have told me in advance, since that get could never have succeeded.
 
@Griwes short intro?
 
@Puppy You are boost::geting from a variant?
 
@Puppy Oh, so you got a runtime error instead of compile-time!
 
10:02 PM
@sehe ?
 
Do you have one? Your prose got me turned off
 
That's stupid.
 
@sehe I'm not sure what you mean. :D
 
Code talks
 
@Griwes Yes.
@StackedCrooked Yes, a rather surprising one since I'd literally just inserted into the variant of the exact same type I was trying to get out.
 
10:04 PM
http://stackoverflow.com/questions/28244509/missing-interface-definition-when-using-native-ui-automation-api?noredirect=1#comment44851249_28244509

Someone to help them?
 
It should be easy to detect at compile time.
 
All I have is the implementation, pretty much. I'm pretty sure there are some things that could've been made smarter or shorter or simpler, but hey, it works.
 
Even in C++03 land.
 
@Puppy Why? :/
 
Because it's his thing.
 
10:06 PM
@πάνταῥεῖ already did. Left my most constructive comment and upvote
 
@Griwes Why shouldn't I? Those visitor thingies are super awkward.
 
@Puppy No they are not, as long as you have a sane way to make them.
I.e. as long as you have a way to turn a regular lambda into one.
 
Using boost::get<> spells special casing and defeats the purpose of variants for me (in terms of generic programming)
 
^ this
 
@sehe It's not generic programming, so.
 
10:07 PM
@Griwes Not critical. You can easily use local structs these days. I rarely use the lambda trick
 
If you know it's meant to be some specific T, then visit and actually properly assert when it doesn't match.
 
@Puppy Well, you have the maintenance issue now :)
 
I could go back and lambdaifiy the case into a visitor
and I might do if I encounter more of them
 
Yeah, good luck maintaining that boost::get!
 
@sehe Too much boilerplate. Also you can't inline a local struct into an expression.
 
10:08 PM
Who cares :)
 
but generally speaking I boost::get because lambdaifiying gets rid of the control flow.
 
I'm not overly attached to making everything inline
 
you can't continue from in a visitor, for example.
 
@sehe visit([&](const auto & value) -> unit { print(value, os, indent + 4); return {}; }, expr.expression_value);
This line looks sweet.
 
@Puppy Which is what made me say this:
15 mins ago, by sehe
With a few routines and patterns, it's ok for me. Key is, to make the visitor functors that accept the variant(s) themselves, for me anyhow
 
10:09 PM
If I had to add one more line defining some struct, that spelled template one time too many... it would be less sweet. At least in my humble opinion.
 
(also subsequent message w/ example)
IOW, just hide the apply_visitor call. BAM, usual function composition restored
 
@Griwes Right, but I actually need to handle all the other cases specially.
 
Another good trick is to bind n-ary visitors. Bound static visitors are fair game with apply_visitor
 
so I could have visit<T>([](T t) { stuff; }, [](auto&&) { other stuff; }, expr);
but that's not so sweet.
 
This makes it natural to write e.g. print(std::cout, ast_node) without the eternal tedium of writing a stateful function object
 
10:11 PM
Apparently this is the only Japanese song to ever become a worldwide hit.. I don't think I heard it before, but it sounds vaguely familiar..
 
@Puppy ...I could show you how I solved that, but seems I haven't pushed my initial analyzer code yet, and I don't have it here.
@Puppy Why the <T>?
 
@Griwes How else would it know which one to call the first for, and which is the "rest"?
 
@StackedCrooked Gangnam Style, 1960's version?
 
This is how I construct "type switches".
 
10:13 PM
thank god for progress.
 
@Puppy lol
 
ok, who the fuck tried to create a void variable.
oh wait, I did.
 
@Puppy So, using my thingie, that'd be make_visitor(id<T>(), [](T t){ stuff; }, default_id(), [](auto &&){ other stuff; });.
Which I think is neat.
 
@Griwes why the id thing?
can't you just make a make_visitor([] (int) { ...}, [] (string) { ... }, ...)?
 
10:16 PM
@Puppy you did?
 
@AndyProwl I feel it gives me some additional flexibility.
 
@StackedCrooked I unconditionally tried to create a temporary to place the return value of a function into.
 
@Griwes Perhaps it would if you could specify more types (e.g. id<int, string>): is that the case?
 
how would you define comparison between two voids..? :)
 
@AndyProwl Say, I had a function overloaded for multiple types, but for one of those it's callable on, I want to call something else. make_visitor(id<T>(), something_else, default_id(), default_function);.
 
10:17 PM
I wrap the whole shit in friendly little functions, e.g.
 
@AndyProwl Oh hey. That'd be neat.
 
My void is bigger than your void.
 
namespace { // detail
    template <typename T>
    struct implicit_convert : boost::static_visitor<T> {
        template <typename U> T operator()(U&& u) const { return std::forward<U>(u); }
    };
}

Ref getVal(std::string& name) {
    return boost::apply_visitor(implicit_convert<Ref>(), map[name]);
}
My moot is bigger than your moot.
 
@AndyProwl Thanks for the idea. :D
 
you might like this ^
 
10:18 PM
@Griwes I think that would be make_visitor([] (T) { ... }, [] (auto) { ... })
 
@TonyTheLion Seen it :) He's good
 
@Griwes lol no problem
 
@sehe :)
 
as long as it's a 1-1 relationship then the id thing is redundant IMO
 
@AndyProwl What if something_else is also an overloaded function?
I do not want to have to wrap it in a silly forwarding lambda :P
 
10:19 PM
I play the same piece. Slightly less controlled. He plays it basically without pedal
 
@sehe Not sure what the difference with or without pedal
 
@Griwes Wait not sure I follow, if something_else is overloaded you cannot just write something_else in there, can you?
Can't take the address of an overloaded function
 
@AndyProwl ...object with overloaded call operator?
You know what I meant :P
 
ah, ok
 
@TonyTheLion More forgiveness (because otherwise you'd hear that some passing notes were held inequally long)
 
10:20 PM
@Griwes Impressive, but seems more like showing of his skills than playing music.
 
Excellent regularity requires excellent technique
 
@Griwes I think I see what you mean now
like, why it gives you flexibility
 
@sehe ah I see
 
@StackedCrooked That's some mis-reply :P
 
@StackedCrooked Disagree. It's a showpiece/etude (one of 21 etudes) so there's that
 
10:21 PM
I'm thinking of learning piano
 
@StackedCrooked I've heard much more by him (dunno if it's from the same vid?) and he's really something different than most.
 
@AndyProwl Also look at the three further tests, they also show some additional features there.
 
Not that everything he touches is somehow gold, but he's a kid
 
@Griwes from the same file you mean?
 
10:23 PM
@AndyProwl Yes.
 
There's currently an airing anime about a young kid participating in piano concours. And his dead mother.
 
user1804599
Interesting.
 
user1804599
This is tail-recursive in Lua: function() return f() end but this isn't: function() f() end, since the latter has to insert return nil at the end of the function.
 
@Griwes I don't know, honestly it seems to me most of the time a make_visitor that just takes N lambdas is all you need, and it has less syntactic overhead
 
@рытфолд How fascinating.
 
user1804599
10:25 PM
Absolutely.
 
2
A: Transforming trees in C++

seheBecause I thought a comment was not going to be enough to convey all that information: @Jack you can (Sean Parent: should) use shared_pointer<const Node> there, and copy as required for changes. Immutability for the win! That said, perhaps you can do without the inheritance altogether? Make t...

 
@AndyProwl Maybe. Maybe not. I'm happy with my ids :D
 
^ this one has a sample of a visitor that rebinds itself to a binary functor invocation
(so we can have two levels of the 'tree' present in the parameters)
 
@Griwes Sure. In fact the two approaches can co-exist
 
^^ Also for @BartekBanachewicz I guess.
"Immutahbilitay for the win" :)
 
10:26 PM
@AndyProwl Yeah. Say, make_visitor(no_tags, ...); (or the other way around).
 
@AndyProwl Agreed. Less is more.
Generalized type pattern matching is a cool thing, but I'd like to see it /not/ conflated with visitor factories
 
@Griwes One thing: the visitor with two overloads, one for int& and one for int: shouldn't that be ambiguous when you provide lvalues?
 
Also, most of that would probably be in Concepts in the future
 
Sean Parent only answers questions from interesting people.
 
1 answers
 
10:28 PM
@sehe Yeah
 
@sehe the high quality of your sample code made me give you an upvote
 
ISTR there were 2 "Sean Parent" SO accounts once upon a time
:D
Dat wording
 
@sehe the lengthiness of your answer made me stop reading
 
@AndyProwl No, because I defined the semantics to throw that ambiguity away. :D
 
But I'm sure it's good.
 
10:29 PM
Jerk
 
@Griwes Ah, I see
 
@AndyProwl Also... it matches the first.
:D
(That is, the first thing that matches is matched. :D)
 
Understood
 
Yeah. I like raffling of examples like that, because it makes me proficient at "clumsiness" of it all.
Somehow I'm more motivated to find elegant/concise solutions when I'm trying to exposition an idea to someone else.
 
hmmmm
"Gangnam Style by Hitler"
 
10:31 PM
This really helps when I design the APIs for my own code, because my "cruft" tolerance is higher, but I get really happy when I can "hit the sweet spot"
 
2
what could possibly go wrong.
 
All this SO wanking is the finger exercise I need (?) to be "on top of it"
 
user1804599
Lua y u no or=.
 
@Puppy really well done, surprisingly
Unlike my typing accuracy
 
it wasn't that bad, really
 
10:33 PM
@Puppy how do you end up there?
 
Ask Bratek.
He might have accidentally used it instead of orcs
 
Stacked linked "60's Gangnam Style", so I watched Gangnam Style, and this was one of the videos on the side.
and I have to admit, the title "Gangnam Style by Hitler" just begged to be clicked on.
 
@Puppy lol
 
I can see how that would work for your particular personality :/
 
it just really sums something up about the world today.
 
10:34 PM
@Puppy yea the title just warrants the click
 
@Puppy Well, the Japanese sided with the Germans during WWII.
On the other hand, Psy is from Korea.
 
the nationalities have nothing to do with it.
 
@Puppy Focus on the orcs!
 
it's just a video of Hitler singing Gangnam Style.
enough said, frankly.
 
@TonyTheLion keming strikes again: She warrants the click
 
10:37 PM
and the author did everybody the service of pulling from more than just the memetic four minutes of Downfall.
 
@rightaway717 The apply_visitor expects a unary functor (in this case). It calls that functor with the concrete element value contained in the variant. Now, because our function expects two arguments, we bind the second to ref(out) so a unary bound functor remains that is compatible with apply_visitor. — sehe Dec 29 '14 at 14:55
This was actually a more simple/compelling example of binding a visitor to an out iterator
 
@Puppy "singing"
 
Performing it. Doing a rendition
 
It's very staccato.
 
user1804599
LuaJIT FFI is nice.
 
10:40 PM
Interpretation
 
user1804599
It parses C declarations.
 
@Puppy What music do you like? Link?
 
He likes Britney.
 
user1804599
So you can just say this:
 
user1804599
ffi.cdef("int printf(const char *fmt, ...);")
ffi.C.printf("Hello %s!", "world")
 
10:42 PM
@рытфолд you can be the most hardcore man on this planet. Always coding!
 
He's reading.
 
@рытфолд Because we really really really want to marry stringly typing to insecure native API calls
 
@рытфолд It's called "Clang".
@StackedCrooked unowatimeen
 
@sehe It's a dynamic language. So I think it doesn't really matter that it's passed as a string.
 
user1804599
@Puppy No, it's not.
 
10:44 PM
Because it would be a runtime error either way.
 
user1804599
It's called LuaJIT.
 
@StackedCrooked Of course it matters; it's just that people pretend it doesn't.
 
@StackedCrooked the called prototype isn't in a dynamic/managed runtime
 
whereas we all know that static language master race would never permit such shit.
static language peasants probably would though.
 
But, ..it can't be checked at compile time because there is no compile time.
Oh, wait , which language are we talking about?
 
10:45 PM
@StackedCrooked That's the issue at hand, yes.
 
user1804599
There is definitely a compile time.
 
5 mins ago, by рытфолд
LuaJIT FFI is nice.
 
@JohanLarsson Anything that's rockin'.
 
link?
 
there is no one link that can summarize the strange amalgamation that is my musical library.
 
10:46 PM
 
@JohanLarsson I suspect he isn't a big music fan.
 
But he is a rocking fan
 
ah, now I get it
 
on the squaking noise
 
right now I am listening to youtube.com/watch?v=2Lu54TlnPRg at maximum volume.
 
10:47 PM
Fans need Greasin'
 
5 minute suspension for that pun right?
 
Xeo
@thecoshman Not yet
I'll prolly have the 13th towards the end of my stay, though
 
I watched The Interview recently
there's one scene in it with some truly rockin' music for about five seconds.
 
I still need to see it.
 
I hunted down the track after an hour of searching and was most disappointed to find that the rockin' only lasted that five seconds and the rest was shit.
 
user1804599
10:49 PM
I like (* and *) better for comments than /* and */.
 
guess not everybody can be Bear McCreary
 
user1804599
Because they are much easier to type.
 
@StackedCrooked but he flames my stuff :)
 
he's just rockin it :P
@sehe @рытфолд fun video examples..
 
user1804599
lol Amsterdam
 
10:55 PM
@StackedCrooked meeste dingen zijn ok voor mij. Deze niet though:
> Bestemmeling: mag wel
Wut o.O
 
I don't see why not..
 
user1804599
lol bestemmeling
 
Ik heb wel goesting
 
@StackedCrooked klink als stommeling
@StackedCrooked That's no issue
 
user1804599
10:57 PM
@sehe which is a synonym for "Belg" so it fits quite well.
 
...
 
user1804599
 
pony wins
 
user1804599
„,
 
user1804599
10:58 PM
In Dutch we use „such quotes” when writing.
 
@StackedCrooked the vid examples interview fully non-native Dutch people
 
user1804599
At least, I do.
 
user1804599
They taught me this in high school.
 
I was gonna say
 
@рытфолд Haven't used them since high school (which ended for me in 1999).
 
10:59 PM
@рытфолд I taught myself this in high school
@StackedCrooked Oh. You're so young (~3-4 years in it :))
 
user1804599
Abuse of monospace fonts?
 
user1804599
Oh my.
 
@sehe I suppose it hard to find natives..? :P
 
Wel die willen de straat voor ons kuisen he
 

« first day (1567 days earlier)      last day (3372 days later) »