« first day (1000 days earlier)      last day (3962 days later) » 

12:00 AM
Wait, people are thinking about using lambda symbols in syntax?
 
best part of coming home. new things on the starboard
 
@Alec that's not your code in particular. I however meet people using C and sometimes have to fix their problems, which sole reason is they're using this language.
 
Or puusibly Java uffuct.
 
@Alec Lambda expressions, they're different.
 
@R.MartinhoFernandes TBH Scala is more or less that.
 
Shit, I'm ratted.
 
@BartekBanachewicz How do you know?
(It isn't; Scala is radically different)
 
I was thinking of the physics symbol used in equations when you calculate sound waves and stuff.
 
@R.MartinhoFernandes radically, huh?
 
@BartekBanachewicz Yes.
 
12:02 AM
I think you'll still see the shortcomings of new Java, because you write in C#
and no, it won't be as good as C# and that's pretty obvious.
 
@Alec Well, comparing lambda expressions to lambda greek letter - most programmers aren't excited about lambda greek letter.
 
That would be a pain to type.
 
@BartekBanachewicz Hmm, can you fix that? I am not sure which of two possible meanings it has (present or future tense?).
 
Having to press the alt key and go to your numpad every time you want to insert one character in your syntax.
 
@Alec Copy-paste them
 
12:03 AM
Thanks.
 
Alec - you've been down the boozer as well, haven't you:)
 
@MartinJames Can you rephrase that? I don't understand your saying.
 
@Alec Meh - don't worry about it. This time of night, I emit gunge. Most loungers ignore me round about now :)
 
@R.MartinhoFernandes I went around and watched that again. Still so good.
 
I have it on my phone so I can watch it anywhere!
 
12:05 AM
ffs
> omg.lua:3: attempt to call upvalue 'f' (a nil value)
 
Ok, that might be a bit too excessive.
Hmm.
Dammit.
 
WHY COULDN'T YOU TELL ME THAT AT ONCE DASFASDFADFA
 
What's an upvalue?
Is that the funargs problems?
 
> the upvalue mechanism implements an equivalent of C static variables, which are visible only inside a particular function. Every time you create a new C function in Lua, you can associate with it any number of upvalues; each upvalue can hold a single Lua value. Later, when the function is called, it has free access to any of its upvalues, using pseudo-indices.
 
Ah, yeah, seems related then.
 
12:07 AM
Important notice to newbies here: when we're talking about C++, we don't mean strcmp, const char*, new/delete nor the other old stuff in bad tutorials
3
 
I can't fall asleep ffff
 
so basically
Something that shouldn't is becoming a part of closure
 
Yeah, that's funargs.
 
you know how to solve that?
 
> using pseudo-indices
The nightmares about Lua stack thing are back.
 
12:10 AM
You don't want it to be part of the closure?
 
@CatPlusPlus oh that's just C-related
@R.MartinhoFernandes I'm not sure
 
Copy it to a local var and capture that one.
var f_ = f
function() whatever f_
(No idea about syntax, just making it up)
 
function() foo(_f) end
 
I gotta try Semantic Merge finally some time.
 
but that's not that.
well the error's still the same
 
12:12 AM
lol
Wait, how can it if you don't use f now?
 
function make_callable(f)
    local fc = f
    local t = { __call = function(self, ...)
            fc(unpack(arg));
        end
    };
    local o = { };
    setmetatable(o,t);
    return o;
end
 
Or does this thing have reference semantics?
Does local fc = f make a copy or a reference?
 
a reference.
 
@BartekBanachewicz What does that do?
 
12:13 AM
local fc = function(...) f(unpack(arg)) end goes back to f being nil
 
I asked someone for the compiler error... heres what i got
/tmp/1373587692-1234777118/cmd.sh: line 8: undefined: command not foundMe myself and I 3 mins ago
 
Wait, wasn't it complaining about it being nil?
 
@CatPlusPlus returns an object with overloaded op()
 
@BartekBanachewicz Do you ever initialise it?
 
@BartekBanachewicz Yeah I get that, but aren't you already passing a callable in?
 
12:14 AM
@R.MartinhoFernandes it's called recursively T_T
@CatPlusPlus and how should it matter exactly?
 
erm
 
@BartekBanachewicz Wait how does capturing stuff work?
 
isn't unpack(arg) the Lua 4 way of doing it?
 
shouldn't that just be fc(...)?
 
12:15 AM
Is it by ref or by value?
 
Hey you're calling it with nil.
 
@R.MartinhoFernandes Always by ref.
 
function foo_dbg(a)
    print(a)
    print(make_callable and "ok" or "not ok")
    return make_callable(nil, foo_dbg)
end
still the same.
 
Is there a GC?
 
I doubt Lua does anything by value.
 
12:15 AM
yes.
 
Because taking a reference to an argument is bad without GC.
 
Lua is GCed and the closures are as-if-local- that is, a reference to a local variable from in a closure behaves identically to a reference to that local variable from within the function that defined it.
 
@DeadMG you can't do ... inside
 
@BartekBanachewicz Why do you pass two args if it only takes one?
 
1 min ago, by Cat Plus Plus
Hey you're calling it with nil.
 
12:17 AM
k wait I fucked it up in general
 
I still don't get the utility of turning a callable into a callable, but okay.
 
I really like having hands, yep, it's great!
 
@BartekBanachewicz Pretty sure you can. The Lua 5.1 docs indicate you can.
 
@CatPlusPlus foo "a" "b" "c"
function foo_dbg(a)
    print(a)
    print(make_callable and "ok" or "not ok")
    return make_callable(foo_dbg)
end
 
12:17 AM
@CatPlusPlus It makes one that returns itself.
 
now it crashes on third call
 
Or something.
 
@R.MartinhoFernandes No, it just calls the f.
 
it should eval a first argument, then return a functor that will eval the next argument and return the functor returning the functor
uh with functions it works all well :/
 
So you want to do currying?
 
12:19 AM
yes, but with table functors
 
Ha, I get it.
 
make_callable is a wonderful name for that.
 
You need a fix-point combinator.
 
@CatPlusPlus this just converts a function into a table functor
@R.MartinhoFernandes waaaat
 
You have a callable that calls the original function.
 
12:19 AM
yes
 
The original function doesn't return the callable.
Do the math.
 
no, wait, how it doesn't
 
it returns a new callable with identical semantics.
 
foo calls print and returns make_callable(foo)
 
@DeadMG Nope.
 
12:20 AM
yep.
it pretty clearly returns make_callable(foo).
 
You're all bad and forcing me to write this myself.
 
Oh, foo_dbg.
I was only looking at make_callable.
 
make callable should transparently convert the function into functor
what's funny is it prints "b" all well
 
Why do you need that distinction?
 
> foo_dbg"a""b""c"
a
ok
b
ok
stdin:1: attempt to call a nil value
stack traceback:
        stdin:1: in main chunk
        [C]: ?
@CatPlusPlus which distinction?
 
12:22 AM
Don't you have a debugger?
@BartekBanachewicz function/function object, I guess.
 
@R.MartinhoFernandes I do.
 
Well...
Crack it open?
 
You should take offence to that because it's flat-out wrong lol.
 
what a useful stack trace, lol.
 
Whats the rep again to see delete stuff? 10k?
 
12:24 AM
you should call it from a real script.
ye
 
@Borgleader 10k, yes.
 
You're almost there.
checks Borgleader's rep
Erm, yeah.
 
lol not really no :P Although I did make 1.1k in a week or so
ideone.com/DdNH8f I was working on an answer to that question when it go deleted.
 
That's some pretty good repwhoring there!
 
@Borgleader Exactly what I told them to do, but they seemed to ignore me.
And blamed their garbage code on Coliru.
 
12:26 AM
@R.MartinhoFernandes On my best day (July 4th), I got 260 rep :)
 
@Borgleader That's an elegant answer ;_;
 
damn, I feel kinda sick today.
 
@chris "cmd.sh: line 8: undefined: command not found" seems like something from Coliru's script.
 
I didn't eat anything strange :(
 
@DeadMG Hope you feel better soon~
 
12:27 AM
Can you get a signature of a function/callable in Lua?
 
nope
 
@R.MartinhoFernandes Well, it "worked" for me when I ran it, and I'm sure it would have worked if their code didn't have infinite recursion.
 
Because you know, currying needs finite depth.
 
What does function(self, ...) mean?
hahahaha
 
12:27 AM
a function/callable doesn't have a fixed signature.
 
hahahahha
haha
 
Otherwise you'll keep creating thunks and never evaluate anything.
 
hahahahaha
Of course it fails after two.
 
@R.MartinhoFernandes The first argument is the table the function is called on, and the second is a variadic list of arguments.
 
@BartekBanachewicz The callable eats up all the arguments.
Not sure why, but still funny.
 
12:29 AM
@R.MartinhoFernandes no return inside?
@R.MartinhoFernandes wait no that's impossible
 
@BartekBanachewicz Well, then why is it variadic?
 
@R.MartinhoFernandes I dunno, but changing that didn't help
local t = { __call = function(self, a)
        return fc(a);
    end
};
I've figured I could use return there :/
because that's what being called, right?
 
yes.
 
aaaaaand
IT WORKS
 
btw, function(self, ...) return fc(...) end is valid.
also why on earth did you make a copy of f.
 
12:31 AM
function make_callable(f)
    local t = { __call = function(self, a)
            return f(a);
        end
    };
    local o = { };
    setmetatable(o,t);
    return o;
end

function foo(a)
	print(a)
	return make_callable(foo)
end

foo "a" "b" "c"
 
@DeadMG That was some debugging fallout.
 
@DeadMG we were experimenting :F
@DeadMG 5.1 or 5.2?
 
@BartekBanachewicz 5.1.4
 
> Sometimes, a function with a variable number of arguments needs to pass them all to another function. All it has to do is to call the other function using unpack(arg) as argument: unpack will return all values in arg, which will be passed to the other function
from manual.
damn, that was nasty
thanks for help guys.
 
that's for compatibility, not what you actually should do
 
12:33 AM
@DeadMG okey.
 
@BartekBanachewicz What did you do to fix it?
 
Psst you're not supposed to evaluate the function until you reach the last argument.
 
@DeadMG line 3, added return
@CatPlusPlus what?
ah
you mean for proper currying?
 
@CatPlusPlus He's not really doing currying. Just chaining repeated calls to the same function.
 
This is not currying, this is just weird syntax for repeated call.
Yeah.
 
12:34 AM
@BartekBanachewicz You already had a return on line 3.
oh... different lines.
I see it now.
 
To be honest I just assumed it returned the last expression.
I mean, why the fuck would he forget that?
 
you're right, that's a "So obvious, it's fucking dumb" thing.
 
well, I guess that's where debugging dynamic languages can be annoying, perhaps.
 
yeah
a C++ compiler would have caught that mistake in no time.
 
blah blah blah but unit tests blah blah blah
That's what they say about it.
 
12:36 AM
@R.MartinhoFernandes assuming foo "a" "b" "c" was a unit test, it wouldn't help much :)
@R.MartinhoFernandes oh, they
the Others
 
Xeo
Question: What exactly is wrong with just return foo?
 
Well, basically dumb people that like to write unit tests for stupid details like that.
 
@Xeo Nothing. Lua absolutely supports that just fine.
 
@Xeo it works all right, I just wanted to use functors
 
@Xeo Doesn't test if it works with objects.
 
12:37 AM
@Xeo Too obvious.
 
the function version was totally easy. Puppy said Premake returns a table though
 
Xeo
mh
 
so I took the challenge
 
it doesn't
 
Btw functions that return themselves are creepy and got infinite type.
 
12:38 AM
well whatever
 
let f = f in f
 
@CatPlusPlus I think Lua can handle these types of problems
 
@BartekBanachewicz Well, it's dynamically typed, so it doesn't have to deal with anything like that.
all Lua functions return the same thing- a (potentially empty) list of expressions.
 
Talking cats are creepier ;~;
 
Xeo
@BartekBanachewicz C++ can do that too
 
12:39 AM
Hmm. let (x, y) = f x y in (x, y)
 
@Xeo well, can you return a lambda from inside of itself? :)
 
@BartekBanachewicz Wide can.
 
@BartekBanachewicz I wouldn't say it's a problem per se.
 
and a C++14 lambda can.
 
@DeadMG yeah, that's actually awsum. So does the [outerthis = this] capture work already?
 
12:40 AM
lol
 
Xeo
[]{ auto l = [](self){ return self; }; l(l); }
 
you'd probably end up capturing the outerthis by value.
 
what the.
 
not really what you want.
 
I forgot what was your syntax for capture clauses.
 
12:41 AM
you'd need [&outerthis := this] and I don't even recall if I implemented that.
 
You gotta forgive me, I'm a noob in Wide; just started coding, and Programming in Wide is kinda hard to read.
 
simple fact is, there's a stunningly low need for [=cap] or [&cap] when you have universal captures.
I might just drop that syntax altogether.
 
Xeo
@DeadMG Brevity
 
@Xeo I can't remember when I last used capture-by-val, TBH
 
@Xeo Nope.
 
12:42 AM
lol
 
I doubt I used it ever, actually.
 
Wide captures by value by default, so [=cap] is redundant.
 
@BartekBanachewicz Erm, it's super important in C++. Captures-by-reference can only be passed down.
 
@R.MartinhoFernandes down?
 
down the call stack.
 
12:43 AM
@BartekBanachewicz That book sucks. We need a Definitive Wide Book Guide and List.
 
There's a Wide book?
You know what? It's getting cold, dammit.
 
Xeo
Guess why it's hard to read
 
there's any Wide material, ever, online, except the two pages I wrote?
 
Slap a cover on it and call it a day.
 
that was the joke huh
 
12:45 AM
You can use chat.stackoverflow.com/transcript/message/10548606#10548606 as one of those blurbs they put on the back.
 
Xeo
@R.MartinhoFernandes Atleast one can't pull the "JavaScript: The Good Parts" joke on Wide then
Or maybe one could, with only a cover.
 
Xeo
Also, daaamn, almost 3am
 
lol
yeah, time to go to bed, huh?
 
I tried that and it didn't work
 
12:46 AM
I'll make foo() into proper currying tomorrow
 
@Xeo Maybe that's why it's cold.
 
Xeo
Wide, The Definite Guide -> ===
Wide, The Good Parts -> ___
2
 
Xeo
I forgot markdown doesn't like multiline
 
or maybe unicode?
 
12:48 AM
?
 
Oh hey, Steam summer sale.
 
we noticed
 
Xeo
His wallet noticed too
 
@Xeo ═══
 
I was working today okay
 
12:49 AM
Box Drawings Double Horizontal U+2550
 
Xeo
@BartekBanachewicz Whatever, too late
Also, the joke's kinda ruined on people with inferior browsers then (thanks squares)
 
@BartekBanachewicz Aw man, I remember that.
 
My first Pascal program ever used those box things for graphics.
 
@R.MartinhoFernandes from Turbo Pascal?
 
12:50 AM
It was awesome.
 
@R.MartinhoFernandes exactly.
@R.MartinhoFernandes high five
 
> Now With Trading Cards
What.
 
I had a separate program just for printing them all alongside the codes.
 
I wrote a "hacking" game with multiple windows
 
Cards are new hats?
 
12:51 AM
@CatPlusPlus Some sort of garbage.
 
@R.MartinhoFernandes I remembered the codes at some point.
 
anyway, enough.
 
@CatPlusPlus Yeah, eventually.
 
@CatPlusPlus I modified my PL codepage to have them AND polish characters at once
 
IIRC 219 was full-box.
 
12:51 AM
Ha, 205.
═══
 
╤═╦ :D
 
@BartekBanachewicz ? CP852 had them.
 
> 1999 Mode – Upon finishing BioShock Infinite, the player can unlock a game mode called “1999 Mode” that gives experienced players a taste of the kind of design and balance that hardcore gamers enjoyed back in the 20th century.
heh
 
@CatPlusPlus weird.
 
╦═╦
 
12:53 AM
@BartekBanachewicz Who needs Polish characters?
Lots of people. Especially women.
 
Xeo
Hm, Borderlands 2 10eur
 
I should stop making that reference. No one ever gets it.
 
I don't get it.
 
@Xeo Get it!
 
I'm sad about that.
I'm the king of random references. :<
 
Xeo
12:55 AM
The Steam Store is experiencing some heavy load right now. Please try again later.
 
@CatPlusPlus It's a silly joke by a group of Portuguese comedians.
 
╔════════════════╗
║ WE ARE AWESOME ║
╚════════════════╝
 
haha, fail.
 
You suck.
Third time the charm.
 
epic rendering fail.
 
12:56 AM
Welp, I guess I'm playing Bioshock: Infinite this weekend.
 
is it weird that I am trying to grow a rose bush in my cubicle?
 
@CatPlusPlus Original goes like "Who has never had a mycosis in the scrotum? Many people. Especially women. But that's not what brought us here. (...)"
@Xeo Get it!
 
Xeo
mmm, maybe
never been a fan of shooters, tbh
And neither have I been any good at them :P Coincedence? Maybe.
 
It's awesome! (And I want to play it again)
 
BTW Drew Crawford just followed me on twitter
 
12:59 AM
That reminds me that I haven't finished my run yet.
Who?
 
The author of the mobile speed article
 
Xeo
Also, I have so many things to do and catch up on... where would I possible take the time to play it?!
 

« first day (1000 days earlier)      last day (3962 days later) »