« first day (1542 days earlier)      last day (3389 days later) » 

5:00 PM
Last time it took 30 days for them to send it, and 15 days to arrive.
 
@LightnessRacesinOrbit It's also completely redundant because the Common Core is an American initiative.
 
Ell
@BartekBanachewicz put an infinite amount of triangles ;)
 
12 mins ago, by Lightness Races in Orbit
"Common Core" implies "USA" only to people who already know what the Common Core is. For everybody else, it implies nothing at all! It would be helpful if people asking questions about a specific country could include the name of that country explicitly in the question. — David Richerby Apr 30 '14 at 17:19
 
@LightnessRacesinOrbit That's a Puppy level of laziness right there.
 
Ell
5:15 PM
I am so confused. I wonder if the W3C validator caches input or something
 
@sehe Robot deleted the one message: reddit.com/r/RandomActsOfBlowJob
 
Do you guys know any useful overload of the < and > operators where (a < b) && !(b > a) is possible?
 
Ell
 
@orlp is possible as in...?
 
@AlexM. Not possible, it's trivial to craft an example where it's possible.
Where it's useful/wanted/logical.
 
5:19 PM
@AlexM. a is smaller than b, but b isn't bigger than a
 
< and > are pretty much opposites in any situation I've seen
 
What I'm hinting at is that for future programming language design that includes operator overloading, wouldn't it be sufficient to just allow overloading of < and change b > a to a < b everywhere in the AST
 
(a < b) && !(b > a) not translating to T && T is well...
I wouldn't like to work with that
that's about it
can't think of an actual example
where < and > have no duality
@orlp you can have > without < though
a > b can be used as an operator for... "a goes into b" or something like that
with < not making sense
and not existing
so you need to allow both to be overloaded
 
You could argue from a programming language design POV that that niche is filled by >> / <<
 
Ell
@orlp > isn't necessarily used for ordering though
boost spirit probably uses them for something interesting
 
5:23 PM
you can spawn niches all you want to try and prove your claim
not allowing the overloading of ">" because you imply that if "<" exists then so must ">" and be its opposite, is wrong
 
@Ell In my imaginary programming language boost spirit would work mostly through macros rather than overloads
 
Ell
that's fair
 
@AlexM. Is it?
That's what I'm asking
 
yes
 
[needs citation]
 
5:24 PM
you need citation for what
you need citation for me saying that if the programmer overloads "<" then it doesn't necessarily mean he wants to overload ">" too and make it "<"'s opposite
 
@AlexM. I wouldn't mind one for hopping down to Spain/Portugal.
 
@AlexM. exactly, some example where this happens
 
you can overload an operator between an object of type A and an object of type B as rhs, right?
 
Ell
yeah
 
yay working in my native C++ again
 
5:30 PM
dunno then, something like a > b which makes a troll of type A move to a tile of type B and returns the troll's new state in that tile
you can't move a tile into a troll
a < b (tile goes into troll)
or troll takes tile in
 
Ell
A -> B move a to b
 
also a.moveToTile(b)
I was asked for examples and I gave one
 
Ell
I am so confused
 
@orlp I want to say 'yes', but can't think of one right now
 
Ell
validator is complaining about extraneous <p/> but editor is highlighting them as a pair
 
5:33 PM
@orlp Hang on, are you sure that example is correct? (a < b) && !(b > a) is what you get from a bog-standard strict weak ordering, isn't it?
 
Ell
how can it be extraneous if the editor pairs them up? >.<
 
@AlexM. At the risk of sounding arbitrary, I don't think that's a valid use case my imaginary language should support (without you defining it yourself with macros)
@LightnessRacesinOrbit what does bog standard mean?
 
not sure what you want then
I certainly don't know how your imaginary language must work
it's your imaginary language after all
 
@Ell Your editor doesn't validate HTML. It matches tag names only. The validator has probably spotted that you can't have those elements inside a P node, automatically closed the <P> before them, then found the original </P> to be extraneous.
@orlp usual. normal. uninspiring.
 
@LightnessRacesinOrbit No, regular ordering is (a < b) && (b > a)
a is smaller than b so b is bigger than a
 
5:35 PM
the point of operator overloading is to allow the programmer to give a point to the operators he chooses
not sure what there is to gain from assuming that ">" will always hold a relationship to "<" and not allowing the programmer to overload it
 
The gain is that you don't have to duplicate implementations
 
which is such a huge amount of work
 
I hate boilerplate
 
it's an unneeded optimization
at most I'd be ok with something like...
 
Boilerplate takes 0 effort to write, but takes just as much effort as regular code to eliminate while debugging
 
5:38 PM
type operator<(some params) : dual operator > { return ! (< params) }
{ }
not sure if it makes sense how I've written it
 
Ell
@LightnessRacesinOrbit well I'll be damned you're right
 
at least let the programmer specify with less boilerplate that one of the operators has <-> relationship to the other
 
Ell
I wonder why you can't have lists inside paragraphs
 
i.e. you can get from < to > and from > to <
== can have dual operator != returning !(==) or something
shit, I said something stupid :P
you don't want <-> relationships
because then it's a loop between operators
-> is ok
like == -> !=
and < -> >
 
@Ell thank you
 
5:42 PM
Ok, I have an idea
 
@VáclavZeman oh hey, something to do on wednesdays!
 
also keep in mind that for <
 
@AlexM. !(a < b) is a >= b, not a > b.
 
@sehe lol
 
>= can be a dual too
 
5:42 PM
by default the language implicitly defines ==, !=, >, <= and => from <
 
@Griwes yeah
 
you can overload these implicitly defined operators
and you can specify to delete them as well
 
@Ell not the same tags, confusing comment delims, CDATA/PCDATA elements, cyrillic letters?
 
implicitly defined for... any types?
 
Ell
@sehe <ul>s aren't allowed in <p>s apparently
I wish the validator had told me this though
 
5:44 PM
@AlexM. any type that defines <
 
this is like an IComparable interface or sth
welp, I can't think of any actual example of a situation where < having no relationship to > can't be countered with a "better" operator
you should ask on SO or codegolf or sth
 
that's my point :P
 
probably not on codegolf
 
I'm all for flexibility
 
I also wanted to say that "better" is subjective
 
5:46 PM
but allowing < to be independent of > is really stretching it
 
troll -> tile can make sense to someone more than troll > tile makes (and vice-versa)
so there you go
 
you could even argue that > is human syntactic sugar for <
 
@orlp expression templates!
@orlp nope ^
 
@sehe oh cmon, everyone knows ^ is syntactic sugar for v
 
you may want to ask on math.se
if there's a funky math chapter
where a is "less than" b but b is not >= a
and for math uses of "<"
I saw some repurposed operators in different chapters but forgot where
 
5:52 PM
@orlp also, (nan < nan) == (nan > nan)
 
@sehe that's not a counterexample
what would be interesting is if (nan < nan) != (nan > nan)
because then you could argue < being different than >
 
I don't agree
36 mins ago, by orlp
Do you guys know any useful overload of the < and > operators where (a < b) && !(b > a) is possible?
 
@orlp what does NaN < NaN return in your language?
inb4 NaN
 
@AlexM. I have no idea since I haven't introduced NaN or floats
@AlexM. I'd probably follow IEEE754
 
you do realize that you give us no details
 
5:54 PM
@orlp you asked to be introduced
 
and then you ignore any examples as "not according to my language"
right?
 
No.
 
sehe's example was spot on
but then "my language doesn't have NaN"
 
But technically, you asked for (a < b) && !(b > a) and not (a<b) != (a>=b) so yeah, you're right
 
(nan < nan) == (nan > nan) is different from (nan < nan) && !(nan > nan)
 
5:54 PM
@AlexM. ^
 
sehe made a mistake
I'm not being picky
 
@orlp from*
@orlp You are, though, since the original formulation is very likely (somewhat) arbitrary :)
 
@orlp that makes sense, nvm
 
22 mins ago, by Lightness Races in Orbit
@orlp Hang on, are you sure that example is correct? (a < b) && !(b > a) is what you get from a bog-standard strict weak ordering, isn't it?
 
Nope
(a < b) && (b > a) is strict weak ordering
(a < b) && !(b > a) is an abomination
@sehe I just chose a reasonably formal requirement that would demonstrate the need for seperately overloadable < and >
 
5:57 PM
Everyone here is getting confused by your very unnatural (and also imprecise) way to "formulate" implication using &&
@orlp There's never a /need/. If you /need/ to implement a webserver, then all the language need is a "do_webserver_application" program.
So, it's not about "need" alone. It's also about consistency
Aaaand. Expression templates, again. The return types need not even be the same.
 
what exactly does (a < b) && (b > a) do it looks like it's always false to me
 
@AlexM. is the point
 
∃a,b (a < b) => !(b > a) then?
 
Implication is => (that's hella confusing in programmer land, but eh)
 
@AlexM. It's only always false if you consider < to be the same function as > with the arguments reversed
which is exactly my point
 
5:59 PM
and I'd expect strict weak ordering to have something to do with things being ordered
 
"Is it ever useful to not consider < the same function as > with the arguments reversed?"
 
E*X*P*R*E*S*S*I*O*N* *T*E*M*P*L*A*T*E*S
 
MY TROLL AND TILE EXAMPLE
 
HELP
 
for which you think "->" is a better operator
but w/e
I don't particularly buy the "->" is better idea
 
6:01 PM
_ <html> _ <body> _ <_/body> _ <_/html> _ it almost feels natural!
 
it's better if you don't ignore the bias caused by you seeing ">" and "<" as comparison operators
because that's how you learned math
and that's where they're used the most
 
@sehe aren't macros better suited to this, though?
I would much prefer to specify such things through compile-time string parsing and AST modification than operator overloading
 
I can't believe you're doing all this to save the programmer 2 minutes caused by writing his own opposite operator
 
Of course not
I'm doing this because I'm a perfectionist, and because I find it fun
if I didn't find mental experiments/arguing about this sort of thing fun then I wouldn't do it
yes, I'm weird
 
he'd be more busy being afraid that your implicit overloading of the other operators when he just overloaded "<" might cause bugs lol
silent bugs at that
 
6:05 PM
@AlexM. that's only possible if this programmer is not using strict weak ordering
in which case it should be very obvious that he's missing operators to define his non-standard ordering
 
"dude you forgot to specify that you don't want to have ">=" automatically implemented for you, shit"
 
When do you not want that, though?
 
you're going in circles
 
When you're doing funky enough shit that you'll remember to not to
 
welp
I'm off home
dunno if you'll ever find an answer
I think my troll and tile answer was ok
the only thing against it is that another operator feels more natural
but "<" and ">" feel unnatural in any other context than comparisons by default
due to the bias caused by how you've used them until now
and in comparisons they must all exist
so if you want to reserve "<" and ">" to comparisons only in your language
then yes, only overload one of them
 
6:10 PM
what do you all typically use for a c++/stl reference? cppreference.com? cplusplus.com?
 
Ell
@Pris en.cppreference.com
 
I know surprisingly few statically typed languages
 
I also know surprisingly little English
 
@Ell Lists are block level. They're "paragraphs" in their own right.
 
6:14 PM
I feel like static typing is superior, but building a proper type system is hard.
 
> engish
hometime
 
Anguish
 
kinda nice to be back at work tbh
 
I also feel that macros are way underrepresented in compiled static languages, compile time should feel like a dynamic language that produces a static executable
 
I want to pitch a language to replace Python as our primary webdev thing
 
6:16 PM
What parts of Python would you replace, and what would you keep?
 
I can only think of Scala tbh, because CLR languages have Mono deployment headaches
And well I don't want to write Java
 
@orlp huh? I'm not explaining this:
Expression templates is a C++ template metaprogramming technique in which templates are used to represent part of an expression. Typically, the template itself represents a particular kind of operation, while the parameters represent the operands to which the operation applies. The expression template can then be evaluated at a later time, or passed to a function. The technique was invented independently by Todd Veldhuizen and David Vandevoorde. For example, consider a library representing vectors with a class Vec. It is natural to want to overload operator- and operator* so you could write Vec...
 
And lol I'm not even gonna say C or C++
@orlp The part where there's no type checking done by the compiler
 
@sehe I feel expression templates are the exact opposite way of what you want
@CatPlusPlus So a static language with the niceties and speed of dev of Python?
 
Otherwise I'd be fine with trying to move to Python 3
Speed of development is a function of familiarity
But yeah type inference is mandatory
 
6:19 PM
@sehe You want built-in syntax to change syntax (top-down), not build more syntax within the rules of existing syntax
(and when I say "you" I mean the general "you", not specifically you)
 
Guess there's also typed variants of some Lisps
 
my problem with dynamic languages is that it ignores that all data inherently have some type
 
Not really?
That'd be an untyped system
 
ok, let me rephrase that
actually
let me scrap that and start over
dynamic languages associate the type with the actual data, and consider variables to be just tags to that data
However, how we usually program is one tag = one data, and almost always is one tag = one type of data
consider a function that takes an argument x
how often do you reassign x with data that not only has a new value, but has a new type?
 
Scala has some silly bits, but I can't come up with anything better
 
6:25 PM
@HansKlünder I suggest you just take a look at my answer then :) libmagic has been a separate thing since forever (like one doesn't suggest to look at the source of bash for input line editing; you'd look at libreadline) — sehe 9 secs ago
Seriously. Answer accepted, an no-one even mentioned the canonical answer (libmagic)
 
that's my problem too
deep down I feel static typing is the way to go
 
I'm not proposing Haskell because lol
 
0
A: C++: How to check type of files without extension

seheUse libmagic. Libmagic is available on all major platforms (and many minors). #include <boost/filesystem.hpp> #include <boost/range.hpp> #include <iostream> #include <magic.h> using namespace boost; namespace fs = filesystem; int main() { auto handle = ::magic_open(MAGIC_NONE|MAGIC_COMPRE...

 
but I just can't come up with a scheme that works
 
I don't have patience for that
 
6:26 PM
Needs to be the accepted answer, IMO
 
Let alone to push entire company through that
 
and I'm afraid to just start somewhere and add bits
because then you end up with C++
 
@orlp Scheme of what
 
@orlp the exact opposite way to do what? And what did I want, according to you?
 
There are perfectly fine type systems already invented
 
6:27 PM
8 mins ago, by orlp
@sehe You want built-in syntax to change syntax (top-down), not build more syntax within the rules of existing syntax
 
I'm looking for a language though
 
8 mins ago, by orlp
(and when I say "you" I mean the general "you", not specifically you)
 
Actual usable language
 
@orlp Oh you meant, what you want :) I agree. Boo, Nemerle, syntactic macros. Lovely shit. C++ doesn't have it. I'd do it in Factor if I cared for elegance
 
@CatPlusPlus it's not just the type system
 
6:28 PM
@orlp data doesn't always necessarily have inherent types; usually in certain polymorphic scenarios
 
@orlp ugh. It's nice to try to say what you mean :)
 
Boo would be an option but CLR
I really don't want to deal with Mono deployment
 
@ScarletAmaranth then it still has a type, you're just (re)interpreting it
 
@orlp sure; you see, I am a proponent of static typing and think dynamic typing is a disgrace, but that's not what you had originally said
 
Subtyping is a form of dynamic typing too
 
6:29 PM
This is one thing that bothers me too
I'm still not convinced by OOP
 
Subtyping is awkward; parametric polymorphism is bettar
OOP has "nothing to do" with subtyping
 
@orlp why on earth would you let that bother you. Non-conformance?
 
simple object OOP I understand the use of, but I consider this more "user-defined" types
the entire inheritance bullshit I haven't really been able to put to use
other than a hack for the type system to allow different types in a datastructure
 
I don't care much for 'grr inheritance'
It's a code sharing mechanism
Well behaviour sharing maybe is a better term
 
you're confusing subtyping with inherirtance, @orlp
 
6:32 PM
I might be
Is it because my view is clouded by C++ implementing subtyping through public inheritance?
 
class T : U {}; T is NOT a subtype of U, believe it or not
(becuase i inherited privately)
 
Oh god
Private inheritance in C++ is not inheritance
 
It's syntactic sugar for composition
 
don't confuse inheritance with subtyping
 
6:33 PM
Subtyping is inheritance
 
subtyping is simply a preorder relation on types
nope; it's not
 
in C++ it is?
 
Fuck C++
 
@orlp no; you can inherit privately for example
 
That's neither subtyping nor inheritance
 
6:34 PM
agreed
 
But you can't say "C++ calls something that's not inheritance inheritance therefore this thing is not inheritance"
 
"Subtyping in C++ is public inheritance"
there? pedantic enough?
 
Show me subtyping that's not inheritance
 
that's easy
 
uhoh
 
6:37 PM
there's a "famous" example of dequeue - it has 4 operations (push front, pop front, push back, pop back); you can therefore create a stack(push front, pop front) and a queue(push back, pop front)
 
And it's not inheritance because
 
oh, that's inheritance
but it'snto subtyping
 
What
 
"easy"
 
6:38 PM
queue doesn't support all of the operations of dequeue
it can't be a subtype
it describes a broader set of values (in a sense)
inheritance simply lets you reuse implementation
 
so is deque a subtype of stack, because it supports all its operations?
 
yes, dequeue is a subtype of stack
you can use it to emulate any stack
so whatever working on stack can work on a dequeue - it simply won't use the other two operations
T <: T' is a preorder relation (reflexive, transitive) on types; that's all it is really
inheritance is an OOP concept on the other hand
 
Maybe
Your code is broken if you can't substitute inherited type where base type is used so whatever really
 
I would end that sentence after broken
 
Ell
6:49 PM
> including singletons, hingletons, mingletons and fingletons
 
> singletons, hingletons, mingletons and fingletons
 
Ell
@Griwes ;)
(too late bro)
 
Welcome to 2011
Jul 10 '11 at 19:31, by Cat Plus Plus
> First, GSD doesn't only detect singletons; it detects four different types of global state, including singletons, hingletons, mingletons and fingletons (see the usage section for descriptions).
 
lol
 
Lounge<C++> never forgets
 
Ell
6:52 PM
lol
 
user1804599
I want a cherrie can.
 
Higgsleton - the God class.
2
 

« first day (1542 days earlier)      last day (3389 days later) »