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

11:00 PM
So Scala has the same problem as Haskell does with records? And therefore you need a library like lens to solve it?
 
user1804599
Which problem?
 
@райтфолд That record supports suck.
 
user1804599
Please be more specific.
 
in C#, 1 min ago, by Mike Asdf
user image
6
 
user1804599
11:01 PM
Scala has no records. It has classes which can have fields. case class is syntactic sugar for classes with immutable fields, a constructor, equality and hash code and inheritance from ProductN where N is the number of fields, and an unapply method for pattern matching.
 
user1804599
scala> case class A(id: String); case class B(id: Long)
defined class A
defined class B

scala> A("42").id + B(12).id
res1: String = 4212
 
user1804599
^ Fields are namespaced.
 
That's nice.
 
user1804599
@Lenses annotation generates namespaced lenses.
 
user1804599
So @Lenses case class A(id: String) you get A.id as lens.
 
11:04 PM
It's like SQL tables!
 
How would you over a list of A to get a list of String corresponding to the ID?
 
omg why do I have to build everything myself; WHY on earth do people not include binaries
 
user1804599
scala> List(A("a"), A("b"), A("c")) map (_.id)
res3: List[String] = List(a, b, c)
 
Nice
And finally how would you set the ID to 1 for every object A of the list?
 
user1804599
With or without lenses?
 
11:07 PM
> Assignment #4 - Tic-Tac-Toe
Due: Thurs, Feb 26
Objective
Practice with classes in Java, including String libraries, command-line arguments, and inheritance techniques.
Task
Write a Tic-Tac-Toe game, which will be played and drawn with text characters on the console. This assignment is based on exercise 8.19, but the specifications here will be more specific.
 
Without
 
> This assignment is based on exercise 8.19
 
user1804599
scala> List(A("a"), A("b"), A("c")) map (_.copy(id = "1"))
res4: List[A] = List(A(1), A(1), A(1))
 
This assignment has also taken me more than 10 hours and I am not done yet.
 
user1804599
(toString sucks that's why there are no quotes in the output.)
 
11:08 PM
Is it normal for textbook problems to take more than 10 hours?
Wtf
 
If you suck anything is possible.
 
In Java yes
 
user1804599
Yeah Scala inherits (pun intended) it from Java.
 
All them wrapper classes and interfaces.
@райтфолд I figured.
 
 
user3010322
11:09 PM
Bikeshed.
 
@Jefffrey Well that's true
C++ assignments are e-z
 
user1804599
@Jefffrey In Scala, Set can be a functor, because all types have equals and hashCode defined. :D
 
user3010322
buffer_view<void> returns unsigned char* iterators. Is this a bad design?
 
That's pretty terrible
@райтфолд Set is like Set in Agda?
 
user1804599
No, Set is a type constructor.
 
user1804599
11:10 PM
Or an object, depending on whether you're in the type or the value namespace.
 
user1804599
Yeah, but it's abstract, not a concrete type.
 
user1804599
scala> new Set[Int]
<console>:8: error: trait Set is abstract; cannot be instantiated
              new Set[Int]
              ^
 
@ThePhD dunno why <void>
 
user1804599
scala> new scala.collection.immutable.HashSet[Int]
res18: scala.collection.immutable.HashSet[Int] = Set()
 
user3010322
11:12 PM
@orlp pdqsort and timsort look like the best in most cases...
 
user3010322
@sehe It's for things like D3D's ID3DBlob, which contains a void* and the size in bytes.
 
@orlp I vote for tim. Did you verify correctness?
 
user1804599
@Jefffrey Set in Agda is like * in Haskell, right?
 
user1804599
I don't think Scala has any notation for that.
 
Kind of yes.
 
user1804599
11:12 PM
dat pun
 
@sehe why would you vote for tim over pdqsort?
 
@ThePhD This situation calls for buffer_cast<unsigned char> then
 
:)
 
@sehe also, are you referring timsort being in the news as of today for having a bug?
 
user1804599
You can have higher-kinded types, though: trait Functor[F[_]] { def map[T, U](fn: T => U)(fu: F[T]): F[U] }.
 
11:13 PM
@orlp nope. is that the case? :)
 
user3010322
@sehe Hrm. So a buffer type that keeps things as void* is kind of not really that useful?
 
@sehe Yes, was #1 on hackernews and /r/programming: envisage-project.eu/…
 
@ThePhD void doesn't exist, so, it's always just poor mans's type erasure (better to do that over char* IMO)
 
@sehe funnily, my uni professor is one of the co-authors
 
@orlp I'm psychic!
@orlp at first glance it looked like the consisten win. Noticed late that that's not the case for shuffled
TBH I've never heard of timsort
 
11:15 PM
@sehe pdqsort is twice as fast in the random case, and uses O(1) memory compared to O(n) of timsort ;)
 
user1804599
scala> implicit object SetFunctor extends Functor[Set] {
     |   override def map[T, U](fn: T => U)(fu: Set[T]) = fu map fn
     | }
defined object SetFunctor
 
user1804599
@Jefffrey Set is a functor! :D
 
@orlp Is "pdq" a reference to Bach?
 
@sehe it refers to pattern-defeating quicksort
 
Ah. Sounds like a legit source of win
 
11:16 PM
@sehe as it is as fast as quicksort on average, but defeats patterns like many equal, ascending, or well, what you see in the plot :)
 
So I can safely say without Sublime Text 3 I would have shot myself in the foot and then jumpedoffacliff.gif
 
@sehe Python and Java use it.
 
Sounds like you should catch a grenade instead
@Rapptz Ah nice. Not the first time Java's sort had a bug o.O
 
user3010322
typedef T* pointer;
typedef const pointer; // T* const
 
user3010322
FML.
 
user1804599
11:17 PM
@orlp good thing you almost never sort completely random data.
 
user3010322
@sehe Fixed.
 
user1804599
@ThePhD no, that's a syntax error.
 
Syntax error indeed.
 
user1804599
Did you mean pointer const x;?
 
@ThePhD still not getting it
 
user1804599
11:18 PM
Are you an idiot? Of course that's T* const.
 
user1804599
It's the only reasonable behavior.
 
user3010322
@sehe Like. It's not const T*, which makes me sad.
 
user1804599
Never use prefix const ever.
 
make me a salad instead
 
user3010322
I want it to const the element, not the pointer. :c
 
user3010322
11:19 PM
std::add_const does it that way too. ;~;
 
@ThePhD template alias
 
user1804599
typename std::remove_ptr<T>::type const*
 
user1804599
Problem solved.
 
^
 
user1804599
@ThePhD OF COURSE IT DOES ARE YOU STUPID?
 
user3010322
11:20 PM
yes. :c
 
ARE YOU RHETORIC?
 
user1804599
OTOH C++ has lots of other special cases as well (lol void), so such moronic behaviour wouldn't have surprised me at all.
 
user1804599
OK so I have this wonderful idea.
 
implement a non-moronic c++
 
user1804599
(proc (a) b) will be transformed into (fn (a) (do b ())).
 
user1804599
11:21 PM
@sehe Puppy's already doing that to some extent.
 
> some extent
 
user1804599
Hey at least overload sets are fucking objects in Wide.
 
user1804599
So they are actually useful.
 
that's... nice I guess
 
@райтфолд you should write down all of your wonderful ideas in a doc or a gist somewhere
 
11:22 PM
@райтфолд Very useful yes
 
user1804599
@CatPlusPlus Indeed.
 
user3010322
@райтфолд That's actually my number 1 gripe with overloads.
 
user1804599
Now you can pass an overloaded function to map, for example.
 
user3010322
The fact that they can't be named is a fucking nightmare.
 
user1804599
Without constructing a redundant lambda.
 
user3010322
11:23 PM
@райтфолд I wonder if that behavior can be put into the standard.
 
user1804599
It'll probably break existing code.
 
user3010322
The C++ standard, that is.
 
user3010322
@райтфолд Maybe through a keyword?
 
user1804599
Also breaks existing code.
 
user3010322
Oh right.
 
user1804599
11:24 PM
Unless the keyword starts with two undersco… no then it'll still break existing code.
 
user3010322
Orrrr.
 
user3010322
It's done through the lambda syntax.
 
user1804599
[]foo as sugar for [] (auto&&... args) { return std::forward<???lol???>foo(args...); }!
 
user3010322
[]function_identifier
 
user3010322
Yeeeeah!
 
user3010322
11:24 PM
@Xeo Already made a paper for that but nobody's championed it. :(
 
user3010322
The only potential conflict is arrays which do [4]foo, but.
 
user3010322
@райтфолд { return foo( std::forward<dectlype(args)>(args)...); }
 
user1804599
Would the empty list be a reasonable substitute for void in a lisp?
 
@sehe Feel free to give me a hand.
 
user1804599
@ThePhD horrible spacing.
 
user1804599
11:26 PM
@Puppy does Wide have void? Is it anincomplete type?
 
@райтфолд Not semantically equivalent.
 
IM MISSING ALL THE GOLDEN COOKIES GOD
 
@райтфолд I do have void which is mostly just C++'s void at the moment but I intend to improve it, it's just not high on my to do list.
 
user1804599
Can you create local variables of type void?
 
user1804599
It'd be invaluable in generic code.
 
11:28 PM
I doubt it
like I said, fixing void is not that high on my list of priorities, but it is on that list
 
user1804599
Nice.
 
user1804599
So my new hello world looks like this
 
user1804599
enable std/io

defproc main () {
    io/println "Hello, world!"
}
 
lol defproc.
 
Main() { std.cout << "Hello, World!"; } and I haven't even looked at any Wide-specific libraries yet
 
user1804599
11:30 PM
@Rapptz it defines a function which returns unit. :3
 
user1804599
Doesn't matter here though since io/println also returns unit, although with deffn you'd have to specify the return type.
 
user1804599
But you can redefine defproc if you want, since it's just a macro!
 
Why not just def?
 
user1804599
@EtiennedeMartel def defines a name for anything
 
Why anything
 
11:32 PM
Or func
 
Why not func?
 
user1804599
you can say def main (proc () (io/println "Hello, world!"))!
 
And why slashes, of all things?
 
Terrible.
 
Is it just because "it's different"?
 
user1804599
11:32 PM
No, I love it. :3
 
You're the Programming Hipster.
 
How do you divide?
 
@райтфолд Name a couple of things that IntelliJ does better than Eclipse.
 
@райтфолд is this still that javascript replacement
 
user1804599
@EtiennedeMartel No, it's because Clojure does it.
 
user1804599
11:33 PM
@FredOverflow No idea, I've never used Eclipse.
 
@FredOverflow Doesn't forget how to render text
 
@orlp math/div(x, y).
 
Has better keyboard driven navigation
 
@Rapptz Kill me.
 
user1804599
@orlp (/ x y)
 
11:33 PM
@райтфолд But why Clojure, of all things?
Nobody uses Clojure.
 
Doesn't start up 10 minutes and doesn't require restarts every half an hour
 
Ooooooh.
 
user1804599
Lots of people use Clojure.
 
I get it.
 
Clojure isn't that bad
 
11:34 PM
You also want to design a language nobody uses.
 
user1804599
Clojure is pretty bad.
 
@EtiennedeMartel That's nonsense
 
user3010322
@FredOverflow Doesn't flake on rendering lines of text in Linux. :v
 
Fuck Eclipse
 
@Puppy I'm afraid I don't feel the vocation.
 
user3010322
11:34 PM
QtCreator does the same thing in Linux for me though
 
user1804599
It's a nice language but the Java interop is even worse than C++–Java interop.
 
@райтфолд I'm confused
 
I'm quite happy to work with the existing tools
 
you're a lisp
 
user3010322
It just... doesn't bother rendering some lines until I click / mouse over them.
 
11:35 PM
but your hello world is not an s-expr
 
fuck eclisp
 
Sexprs are p incidental
 
user1804599
@orlp it's a syntax I am designing.
 
user1804599
With significant newlines.
 
I never had those text rendering problems. Did you guys use nightly builds or something?
 
11:35 PM
You do want a syntax that maps directly to them though
 
user1804599
foo bar baz means (foo bar baz) if in global block or within { … }.
 
Lisp with significant newlines? How about a Lisp with insignificant closing parens?
 
user1804599
{ foo bar <NL> baz qux } means (do (foo bar) (baz qux)).
 
user1804599
@CatPlusPlus I don't like significant indentation.
 
I don't like dismissiveness.
 
user1804599
Only thing I struggle with is brackets.
 
user3010322
I always have a hard time with significant indentation / whitespace.
 
I think significant indentation is amazing.
Your eyes don't look at brackets.
 
user1804599
for example
 
user1804599
11:37 PM
cond [
    (< x 0) (- x)
    true x
]
 
Your eyes look at indentation levels.
 
It's kinda crap for editors
 
user1804599
The idea is that the [ is moved to before the cond and then the brackets are substituted for parentheses.
 
guys I feel like i'm fighting TzTok-Jad at this rate
 
Autoindent becomes primitive and annoying
 
user1804599
11:37 PM
But this moving must be defined better and I'm still thinking about that.
 
On wave 35 atm
 
@CatPlusPlus I don't have this experience, what do you mean?
 
user1804599
It can't be just moving it one term to the left, since with match x [ … ] it's two terms.
 
@orlp "Reindent all" is p much impossible
Because indentation is the only thing that defines blocks
So editor can do precisely nothing
 
user1804599
I like some more visual separator between blocks.
 
user3010322
11:39 PM
union {
private:
int data[2];
public:
int x;
int y;
};
 
user1804599
Like } in C++ or end in Ruby.
 
user3010322
huehuheuhuehuehuehuehuehue.
 
@CatPlusPlus why would I want to reindent things?
 
Because you're moving things around or whatever
Also if you're typing then on } editor can automatically adjust further indentation level
 
user1804599
-- I find this:
if x in y {
    a()
} -- <- nice separator here
z()

-- far more readable than this:
if x in y:
    a()
z() -- <- sudden dedent, ugly, too dense
 
user1804599
11:40 PM
But an empty line is also ugly.
 
@CatPlusPlus Whenever I move stuff around I just do a few <'s on vim and I'm done
 
user1804599
Especially in some larger pieces of code, }/ends are easier to count than dedents.
 
That's the point, you have to adjust indentation manually
 
user1804599
WTB actually implemented from __future__ import braces
 
Editing Python in vim is frustrating as shit
 
user1804599
11:43 PM
yeah
 
I don't have the same experience =/
the only thing I had to change was the indentexpr
 
to be equal to the last non-empty line
 
Try working with R#
 
user1804599
def foo():
    … # no return here

    def bar(): # this is what it does lol (no, this shouldn't be a local function)
 
11:44 PM
?
when you want to go up one level
you type a backspace
 
Also fuck it I'm shifting money around and buying R# 9 right now
 
@райтфолд typing a backspace is just as hard as typing }
if not easier
 
user1804599
@orlp now add a new function between the two.
 
user1804599
Set the cursor on the line before def bar and hit O.
 
user1804599
It'll indent.
 
11:47 PM
It's just crap
 
user1804599
Do it again, it will indent again.
 
You have to readjust the level CONSTANTLY
 
user1804599
That's three backspaces vs a single closing brace.
 
@райтфолд I go with my cursor on the line, hit o<Backspace> and start typing away
 
ALMOST 3 MILLION COOKIES PER SECOND
 
user1804599
11:47 PM
Can you turn off significant indentation in Haskell? Just wondering.
 
@CatPlusPlus ACQUIRE MORE GRANDMOTHERS
 
user1804599
I know it supports syntax with curly braces and semicolons and stuff.
 
-7
Q: Is it okay for some DICKS to downvote questions that they don't know answer to?

Deimantasso Is it okay for some DICKS to down vote questions that they don't know answer to or when they think person needs to know everything in the world?

 
user1804599
In F# you can turn it off with a preprocessor directive.
 
if color in color_names:
    print_color()

redraw()
I don't see a problem with this
 
11:48 PM
@райтфолд You can just use the desugared syntax
 
it looks uglier than it is because you chose such short names
 
Is it weird for children to hold strong references to their parents so that the parents are only destroyed once the children are?
 
Don't do that
 
pourquoi
 
I've found that in 90% of the cases where I thought about using "parent" and "child" classes that I was doing overly tight coupling.
 
user1804599
11:51 PM
0
A: Is it okay for some DICKS to downvote questions that they don't know answer to?

райтфолдNo. The terms of service require the following: Subscriber certifies to Stack Exchange that Subscriber is an individual (i.e., not a corporate entity) at least 13 years of age. A dick is not an individual, but rather a part of an individual, and is therefore not allowed to participate in t...

 
and you spend a fuckton of time coding yourself out of the mess
 
@Mysticial Lol. Dick, Tom and Harry.
 
@райтфолд +1
 
@orlp They look like units in some 2D space invaders game.
 
11:52 PM
@Mysticial they aren't? fuck
 
It's such a bad graph.
Please make another one.
 
I've been playing this game for so long
@Rapptz Can you quantify why it's bad?
 
Annoying to read.
 
That's not helping.
What information would you like to see in the graph, that you can't due to the format?
 
@райтфолд DICKS in CAPS.
 
11:56 PM
hi xD
 
user1804599
lol the other guy says "I am a dick"
 
user1804599
Should I comment "hi there, dick. wanna meet my vagina?"
3
 
@райтфолд I'm just so tempted to post a comment something like: "If you post questions about PHP, you have to expect DICKS to look at it, because only a complete DICK would use PHP in the first place."
 
MY question wasn't lacking of research(i didn't find answer anywhere) it was clear + source code and it was useful — Deimantas 10 mins ago
lol
 
11:58 PM
I was searching for 'ducks in caps' then I found this ...
 
@райтфолд Dick is a nickname for Richard.
 
@райтфолд Probably not. As I recall, the last time that was mentioned "publicly", the result wasn't entirely positive.
 
user1804599
@EtiennedeMartel Richard is a fucking idiot.
 
@orlp Candle graphs are the worst type of graphs IMO.
 
Maybe that DICKS is an acronym.
 
11:59 PM
Bought upgrade to R# Ultimate
WITH COOKIES
 
@chmod711telkitty Bad result--those are clearly geese.
 

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