« first day (1588 days earlier)      last day (3362 days later) » 

7:00 AM
filter([](auto) { /* */ }, r); // I think 'r' is easy to forget here
not sure why though
also the C++ algorithms have predicates as the last argument
 
eh, for ranges/sequences I think it’s typically consistent—but overall yeah it’s not rare at all for a function to have one more good candidate for auto-currying.
 
For example, uh, OCaml: filter : ('a -> bool) -> 'a list -> 'a list but nth : 'a list -> int -> 'a.
 
Oh that’s nasty
 
Actually that's the only example that comes to mind so forget it :D
 
Still, the fact that e.g. Python which doesn’t auto-curry filters in the same order is the sort of thing that motivated me. Makes sense, no?
 
7:04 AM
I really appreciate how fast github source search is in a repository.
 
@Rapptz They also follow different naming traditions. E.g. copy_if is a lispish filter, sort of.
 
But in C++ it's usually the predicate at the end of the arg list as Rapptz already mentioned
 
transform is no algorithm I’ve ever heard of, either
 
@LucDanton We're talking about argument order though, not naming :p
 
1 min ago, by Luc Danton
Still, the fact that e.g. Python which doesn’t auto-curry filters in the same order is the sort of thing that motivated me. Makes sense, no?
Motivation was to have filter(pred, r) look the same as it does elsewhere, or close to (e.g. ML-looking filter pred l).
 
7:05 AM
Yes, that's a sound argument
 
So yes, the naming was part of it.
 
I get that.
I've been in the same boat.
 
@Rapptz mapM and forM perform the same thing, but accept their argument in opposite orders.
To get back to template type arguments (which I don’t care for as much), I think Rust does Filter<I, Pred>. I’ll have a look. Yeah that’s it.
 
How's rust coming along btw, I kinda lost touch
 
@AMostMajestuousCapybara It’s really consolidating what it has. Kinda anxious to see blue sky research picking up once again post-1.0 though.
I don’t like the error-handling story very much.
 
7:12 AM
Hadn't they settled for Result<T>?
 
So far it was more Result<T, Error> which implies closing off the universe of errors (which is an enormous red flag for me). It’s been generalised for error types that can survive a roundtrip to and from Result<T, Error>.
That still means a lot of visible machinery when massaging results with different errors so far, so post-1.0 might possibly see some language-level help for that.
 
Hmmm. I'm still going to wait a bit for the dust to settle.
 
D also filters the typical way. Altogether, Python, D, ML/Haskell are what I try to be consistent with for ranges.
 
But who said that currying on the pred was more common than on the range? :p
 
7:27 AM
dunno
 
lol a C++ library that uses exception specifications
 
Wanna bikeshed range ops? I’m trying out position-based ranges with begin()/end()-like operations.
 
7:44 AM
Sure
 
Working fine here.
 
I have a local copy so I’m still seeing the same thing you do
 
green = ?
 
It can be expressed in terms of some of the others, so a range implementer doesn’t need to care.
 
7:50 AM
3
Q: Will creating a text file in vi change my computer?

BJsgoodlifeI know that Linux is an operating system built on text files. What I would like to do is create a file using vi of all the various commands I have learned. That way I could find each individual command very easily using the / in vi. But I only want to do this if it doesn't change the way that my ...

And people say Linux users are more savvy.
 
Who says that
 
@Maxpm What (ill-informed) people say that?
 
@Maxpm Are you perhaps aware that billions of people use Linux
 
> I know that Linux is an operating system built on text files.
What does this even mean?
 
7:52 AM
You take a pile of text files
You put Linus on them
And bam, you get a fully-fledged OS
 
top kek
 
I was going to make a joke about sitting on a NAS while writing Linux :(
 
@AMostMajestuousCapybara Reminds me of this video
 
I really wish windows had a nicer builtin way to switch between headphones and speakers
I have to right click the sound icon -> playback devices
choose the device I want and then click set as default
 
7:58 AM
@AlexM. Are you a programmer or what
 
I'm not going to write a plugin
or a program
if I wanted a program I'd have downloaded those that already exist :A
 
That’s what computers should be doing anyway.
 
@AlexM. Yeah. Just plug it in and plug them out.
 
@Rapptz This editing
It's too perfect
 
@Rapptz lol @ python
 
8:02 AM
@Rapptz I prefer ones that stick close enough to the truth that (especially on older stuff) you spend at least a second or two thinking: "Hmm...is that right?"
 
I like the over-exaggerated comedy.
 
> Václav Zeman
a month ago

WTF?
 
That's the best part.
The people who fall for it
 
@Rapptz The comments...
Jeez...
> Liked, favorited, commented, showed my mom, raised kids and taught them your advice, divorced my wife, married a guy, divorced the guy, had a rave for 5 days and subscribed
 
@Rapptz Did you go full Niebler? I remember the annoyance of having to find a foo_type/foo pair of names for the functor type and functor object respectively, so I’m wondering what you use.
 
8:11 AM
If a class is declared with a virtual destructor but is never used polymorphically, will it still carry a vptr and vtable?
 
Virtual functions are ODR-used.
 
@AMostMajestuousCapybara classes never carry a vtable
 
Yes, ofc, I mean the instances.
@LucDanton Thanks.
 
@AMostMajestuousCapybara You could have the most complicated classes and functions defined in a program, but if at the end of the day all it does is int main() { return 0; } the compiler can very well take advantage of that and ignore all the rest.
 
struct foo { virtual ~foo() {} }; >= size of a pointer :(
 
user1804599
8:20 AM
Hello.
 
user1804599
@AMostMajestuousCapybara So?
 
@LucDanton Yeah I tend to like function objects.
I do namespace detail { struct foo; } now a days.
 
I could go namespace functors { struct filter { … }; } static constexpr auto& filter = constant<functors::filter>; I suppose.
 
@райтфолд rightfold I missed you <3
 
user1804599
I didn't miss you.
 
@Rapptz Btw what about that bikeshedding? I’m not really fond of equal_pos and equal_start etc. I was thinking of at_start instead but that makes it look misleadingly similar to at.
 
What does it do? Check if they're in the same position?
 
Yah, they’re counterparts to the iterator a == b, a == start (or a == begin()), a == stop.
 
Why not overload operator==?
 
Because there is a range argument as well. Sorry, the table was hastily done :s it’s supposed to be member syntax, and it’s all pseudo-code.
 
8:29 AM
morning chicken legs
 
@LucDanton Not sure tbh.
 
No matter, nothing sed won’t be able to solve later on. Much more interesting stuff to do right now anyway.
Any opinion on whether an ADL wrapper should prefer a member function implementation or a free function implementation?
That is if you have a type for which x.begin() and begin(x) are both valid, which would you prefer adl::begin(x) perform?
 
8:44 AM
anyone know if there's a mobile version of chat.stackoverflow.com?
 
Yes there is and it sucks
 
well, using the main version is not exactly a pleasent ride
 
I'd argue it's better IMO
 
user1804599
@Rapptz lol
 
user1804599
c'est terrible
 
9:01 AM
@LucDanton member of course!
 
@sehe I used to have it the other way around, but I find hard to justify. No telling what kind of ADL is going on after all.
 
@LucDanton begin(x).
std::begin is already auto begin(T t) -> decltype(t.begin()).
 
unless it’s not
 
When's that?
 
@Rapptz I don’t really follow the logic. std::begin is not an alternative to calling the member: we would just be calling the member directly if that was all we’re interested in.
@Rapptz arrays
 
9:06 AM
@LucDanton Why would I use adl::begin(x) if std::begin(x) does the same thing?
Maybe I'm misreading.
 
It performs ADL on your behalf. The 'what if the type provides both ways' is one scenario. adl::begin(x) === x.begin() iff x.begin() is the only thing valid; adl::begin(x) === begin(x) iff begin(x) is the only thing valid; and adl::begin(x) === x.begin() when both are.
 
Hey guys!
 
Oh both ways.
 
In addition to that when ADL is performed an overload for arrays is in scope.
 
9:09 AM
Can you guys help me closing my question here? One more vote to close it. stackoverflow.com/questions/27886295/… Thank you!
@AMostMajestuousCapybara Hey!
 
done
 
Thank you!
 
np
 
Ops, I thought closing a question would delete it.
 
nop
 
9:10 AM
In any case I figured I can have using member = overload_set<0>; using free = overload_set<1>; and then have the overloads use free or member as appropriate. Then I can change my mind later. I.e. programming 101 I guess.
 
@LucDanton lol this trick
 
Well it’s better than integral promotions or what have you. Also I keep the ordering the right way around. cc @Xeo
 
Xeo
pff
 
0
Q: How can I see the jobs I applied to in Stack Overflow Careers?

anuI got a call for an interview for a position and I wanted to review the job requirements etc. How do I see the history of companies I applied to?

lol
 
So is there any chance moderators will delete my question if I ask them to do it?
 
9:12 AM
If I use that trick I feel like I've hit rock bottom.
 
@Xeo i.e. same as yours :Þ
0 being best
right?
 
@CeceXX Closed, negative votes question tend to get deleted over time, but not always.
 
@AMostMajestuousCapybara Okay, thank you. Hopefully my question will be deleted soon.
 
I don't think you can delete questions with answers with upvotes.
 
@CeceXX In some cases it happens. E.g. if the question used to contain sensitive information (which remains visible in the edit history, even when on hold).
 
Xeo
9:14 AM
@LucDanton I'm still not sure which way is the best. With 0 being best (priority ordering), you have an arbitrary limit, with 0 being worst (weighted ordering) you always have to mention the limit at chosing time
 
I use 0 is the best.
 
Yeah it’s all a toss-up. So of course we must all be opinionated about it.
 
priority ordering is the easiest
 
Else you can terminate at std::numeric_limits<int>::min() and start at 0 as a convention so you have room both ways ;)
^recommended for compiler haters
 
Xeo
lol
 
9:16 AM
@LucDanton that. Also, intuitively I'd favour member implementations in general: std::find vs. member T::find() - usually the latter is more specialized (I know it's a different interface too, but still, conceptually "member is more optimal" is a ground).
It is interesting though if you wanted swap(std::vector<T>) to really do something structurally differently from swap(std::vector<U>)... o.O
 
@sehe The opposite argument is more appealing to me: if I’m less specialised, my code works for more stuff. Which I’ve always felt is a major point of generic programming.
 
In that case might as well make everything free-standing
 
Well I say 'argument' but it’s more of a feel-good fallacy for what we’re doing. But that may precisely be what blind-sided me the first time around.
@AMostMajestuousCapybara ikr
 
@LucDanton How does this apply to an ADL helper
The helper is the part that does the dispatching to be generic. Can't really blame it for calling specific
 
'more appealing', 'more sway', but ultimately wrong
 
9:21 AM
We're kind of headed that way with so many of the container-members being added as free function
 
name two
 
eh, size, insert
 
What container has distance as a member, and what does that do?
 
I forgot what they wanted to add. There's already begin, end, next cbegin and cend, also size, what else? empty? insert? erase? Can't remember.
 
@LucDanton I have that too of coruse, only for SO i'm frequently still considering s.begin() instead of begin(s)` because I get too many "it doesn't compile" responses
 
9:28 AM
that’s lose-lose :(
 
@sehe yuck
 
meh. It's fact of life. Also, my connection to chata is extremely flaky
 
> (heck, I invented hashtables before I learned that they had already been invented) and other important data structures, and I might even know some tricks that they don't teach in school.
watch out, we got a badass over here
 
@BartekBanachewicz I know it's going to grind you gears, but my first 'game' is going to be one monolithic file, doing lots of dirty manual opengl stuff :P Well... I'm not going to make it harder for my self, I'm just not going to make it all neat and fancy till later.
 
9:45 AM
Doing std::error_code overloads is quickly reaching my daily boilerplate limit.
Maybe a macro will help there.
 
@thecoshman what I can tell you...
an ability to craft good design fluently cames with experience
 
> The only reliable fix is to change your username so that it doesn't end with "-". Apologies for the inconvenience.
@Rapptz It’s not supposed to work, you’re the one with the bug!
 
I'm not having issues though.
lol
 
I assume that’s what being hinted at by 'reliable', maybe there’s something or someone going above and beyond from GH until your end.
@Rapptz Can you resolve that ip for me?
 
I don't know how to get that on Firefox so I tried getaddrinfo and it failed
 
9:56 AM
lol
What was the error_code :D
 
11001
host not found probably
Alright.
23.235.44.133
 
heh, 404
 

« first day (1588 days earlier)      last day (3362 days later) »