« first day (421 days earlier)      last day (4541 days later) » 

7:17 PM
 
user406009
What is it with people who think they are using C, but are actually using C++?
http://stackoverflow.com/questions/8466554/define-length-of-global-array-in-a-function
 
Stupid question: How can I concatenate numbers?
(Ints)
 
One after the other.
 
user406009
You mean like turn 5 + 3 = 53?
 
@EthanSteinberg Probably the same thing as with people who think they're using C++, but are actually using C.
 
7:21 PM
@EthanSteinberg Yes
 
std::to_string(5) + std::to_string(3)
 
@KianMayne long slow correct version using stringstreams.
 
user406009
Two ways:
Easy way = turn to strings, add strings , turn to integer
 
@CatPlusPlus I thought that but isn't that dirty
 
user406009
Hard way = each additional number is multiplied by 10
 
7:22 PM
lol hard way
 
user406009
Like 5 * 10^1 + 3 * 10^ 0 = 53
 
Why do you want to "concatenate" numbers, anyway?
 
@KianMayne Dirty? That does exactly what you asked.
 
user406009
Hard way is much faster, but actually requires thinking.
 
@RMartinhoFernandes I know but it feels hackish
 
7:23 PM
huh? thinking? I thought this was a programmer's chat room?
 
@EthanSteinberg Yeah I just thought of this
 
@KianMayne Hackish? What are you trying to do anyway?
 
user406009
Super bold that "much", string to integer and back is very expensive.
 
Are you actually dealing with numbers, or sequences of digits?
 
Meh, the premise is silly, going out of your way to optimise it is doubly so.
 
7:25 PM
@RMartinhoFernandes Solve the problem I mentioned last night where a is divisible by 1, a & b is divisible by two up to a & b & .. i is divisible by 9, the ampersand being a fictional concatenation operator
 
Yeah, that's very practical problem.
I can see why you would spend hours optimising it.
 
@CatPlusPlus It was from a quiz
 
I would never have guessed.
 
@CatPlusPlus Meh it's not hours I only just started writing :L
 
Are a, b, and such arbitrary numbers or 0 ≤ x ≤ 9?
 
7:27 PM
@RMartinhoFernandes Yes, that's exactly what they are sorry
 
Er, "exactly" what?
1) Arbitrary, or 2) between 0 and 9?
#1 or #2?
 
I'll go with #3.
 
I'm not reading today: 2
 
Fuck yeah, it compiles.
 
I fail at reading somewhat, too.
 
7:35 PM
it's so much easier to focus when it's not freezing cold
 
@DeadMG No heating?
 
there is heating, it's just not very aggressive
a problem that I just resolved
 
Did you punch the heater in the face?
 
You mean the heating is very slow?
 
no, it's on a timer and the timer doesn't involve being on very often
so I turned it on manually
 
7:46 PM
manual override ftw
 
also, I finally decided to introduce function as a keyword
 
I demand fun!
 
user406009
@DeadMG function is too long of a keyword.
 
user406009
Make it shorter
 
no
it doubles as the type of functions, as it were
 
7:48 PM
But that's not fun.
 
hmm, actually, I'm not sure that's tremendously helping
I only succeeded in swapping one ambiguity for another
 
user406009
I agree with RMartin, we should be able to type programs that inspire fun.

fun work = fillOutPaperWork;
fun cleaning = cleanOutGarage
 
the irony is, I think that C syntax would actually work better for me
 
OMG.
NOOOOO!
Don't give in!
 
well, I no longer have C++'s constructor syntax
so there's nothing for it to be ambiguous with
 
7:51 PM
@EthanSteinberg JavaScript has a function keyword and it is working just fine.
 
@DeadMG How do you construct things?
 
var := int(5); for example
I decided it was dumb to have both var := int(5); and int var(5); when they both do the same thing
 
Oh, I see.
 
Does var := 5; also work?
 
of course
 
7:53 PM
I guess := is for initialization and = is for assignment? Or do you use <-?
 
Xeo
@DeadMG So explicit ctors require var := type(val); and conversion ones have var := val;. Do you actually have explicit ctors?
 
uh
conceptually, I do
I probably forgot to add them to the language
 
Xeo
heh
 
:P
 
7:54 PM
var := val; isn't a conversion
it's type inference and then copy (or move) construction
 
@Xeo var :) val; was neat.
 
lol
 
lol
 
Xeo
@RMartinhoFernandes Heh
 
although I prefer to use T as a placeholder for "some type"
 
Xeo
7:55 PM
I don't think it would be widely accepted though
 
since type is a keyword now
 
Xeo
Oh, yeah, how do your lambda expressions look like?
 
the same as C++
 
Xeo
Okay
 
although I buffed them in the same way I buffed every other function- polymorphic, and named arguments
 
7:55 PM
@DeadMG With a bunch more type deduction on top, I expect.
 
oh yeaaah, you bet
 
Xeo
[](auto x){ std.out(x); }
 
no, skip the auto
 
Xeo
btw, how does your IO look like?
 
atm, I'm going to use Standard.IO.Output << "Hello, World!";
but that's just a library design and I can rework it whenever I WANT
 
Xeo
7:56 PM
Wow, long names :(
 
std::cout << std::roman << 124; // prints CXXIV
 
so what?
using isn't totally broken
if you don't want to type it, then using Standard;
or using Output = Standard.IO.Output;
 
That looks like C#.
 
no
 
Xeo
But you kept the iostream thread-unsafe interface with shift operators, eh?
 
7:58 PM
it looks like a language in which using isn't broken
 
Yes, it does.
 
one example of which happens to be C#
@Xeo Thread safety and operator choice have absolutely nothing to do with each other.
 
Xeo
@DeadMG Tell me how you want to get the operator<< interface inherently thread-safe
 
@Xeo: It's no less or more thread safe than obj.Write(arg)
you do know that, right?
 
Format string based interfaces are better.
 

« first day (421 days earlier)      last day (4541 days later) »