code logs -> 2007 -> Mon, 23 Jul 2007< code.20070722.log - code.20070724.log >
--- Log opened Mon Jul 23 00:00:14 2007
--- Day changed Mon Jul 23 2007
00:00
<@Chalain>
Bjarne Stroustrup made a lot of people spit out their coffee when he said that C++ should be written in ps fonts to enhance readability.
00:00
<@Chalain>
...and then went on to write an entire book in that style and produced some really freaking READABLE C++ code.
00:00
<@Serah>
Sounds like a dane :p
00:10 Forj [~Forj@Nightstar-17168.ue.woosh.co.nz] has joined #code
00:11
<@ToxicFrog>
Hmm. I need API advice on getopts()
00:11
<@ToxicFrog>
So far I'm thinking two different signatures (short and long): getopts(argv, "ab:c?def") is the short form.
00:12
<@ToxicFrog>
The long form would be something like: getopts(argv, { "a", "arg-one" }, { "b", "arg-two", true }, { "c", "arg-three", false }, ...)
00:13 JohnBDoe is now known as AnnoDomini
00:14
<@ToxicFrog>
...hmm. The return signature I was thinking of breaks for stuff where order of arguments is important, though.
00:14 * ToxicFrog reimplements it as a iterators
00:46
<@ToxicFrog>
Gmm.
01:20
<@ToxicFrog>
Arghsjgksjdhfjshdfgas
01:43 AnnoDomini [~farkoff@Nightstar-29170.neoplus.adsl.tpnet.pl] has quit [Quit: Astro Cat will play for you... the Symphony of Space.]
02:14 Thaqui [~Thaqui@Nightstar-26619.jetstream.xtra.co.nz] has quit [Ping Timeout]
02:50 Thaqui [~Thaqui@Nightstar-8027.adsl.xtra.co.nz] has joined #code
02:51 mode/#code [+o Thaqui] by ChanServ
03:13 Thaqui [~Thaqui@Nightstar-8027.adsl.xtra.co.nz] has quit [Ping Timeout]
03:20 Thaqui [~Thaqui@Nightstar-8027.adsl.xtra.co.nz] has joined #code
03:20 mode/#code [+o Thaqui] by ChanServ
03:38 Thaqui [~Thaqui@Nightstar-8027.adsl.xtra.co.nz] has quit [Quit: This computer has gone to sleep]
03:46 Thaqui [~Thaqui@Nightstar-8027.adsl.xtra.co.nz] has joined #code
03:46 mode/#code [+o Thaqui] by ChanServ
03:56 Thaqui [~Thaqui@Nightstar-8027.adsl.xtra.co.nz] has quit [Quit: This computer has gone to sleep]
04:41 Thaqui [~Thaqui@Nightstar-17986.jetstream.xtra.co.nz] has joined #code
04:41 mode/#code [+o Thaqui] by ChanServ
05:36 Vornicus-Latens is now known as Vornicus
06:21 ReivClass [~reaverta@Admin.Nightstar.Net] has quit [Ping Timeout]
06:22 You're now known as TheWatcher
06:22 DiceBot [~Reiver@Nightstar-894.ubs-dsl.xnet.co.nz] has quit [Ping Timeout]
06:28 Reiver [~reaverta@Admin.Nightstar.Net] has joined #Code
06:28 mode/#code [+o Reiver] by ChanServ
07:53 ChalcyLaptop [~Forjadon@Nightstar-17168.ue.woosh.co.nz] has quit [Ping Timeout]
07:54 Forjadon [~Forjadon@Nightstar-17168.ue.woosh.co.nz] has joined #code
07:54 mode/#code [+o Forjadon] by ChanServ
08:00 Forjadon is now known as ChalcyLaptop
09:05 AnnoDomini [~farkoff@Nightstar-29170.neoplus.adsl.tpnet.pl] has joined #Code
09:06 mode/#code [+o AnnoDomini] by ChanServ
09:12 Forjadon [~Forjadon@Nightstar-17168.ue.woosh.co.nz] has joined #code
09:12 mode/#code [+o Forjadon] by ChanServ
09:14 ChalcyLaptop [~Forjadon@Nightstar-17168.ue.woosh.co.nz] has quit [Ping Timeout]
09:14 Forjadon is now known as ChalcyLaptop
09:39 Forjadon [~Forjadon@Nightstar-17168.ue.woosh.co.nz] has joined #code
09:39 mode/#code [+o Forjadon] by ChanServ
09:39 ChalcyLaptop [~Forjadon@Nightstar-17168.ue.woosh.co.nz] has quit [Ping Timeout]
09:40 Forjadon is now known as ChalcyLaptop
10:09 Forj [~Forj@Nightstar-17168.ue.woosh.co.nz] has quit [Quit: Gone]
10:09 AnnoDomini [~farkoff@Nightstar-29170.neoplus.adsl.tpnet.pl] has quit [Ping Timeout]
10:16 AnnoDomini [~farkoff@Nightstar-29028.neoplus.adsl.tpnet.pl] has joined #Code
12:10 ChalcyLaptop [~Forjadon@Nightstar-17168.ue.woosh.co.nz] has quit [Connection reset by peer]
13:03 MyCatVerbs [~rb6822@Nightstar-23831.cs.bris.ac.uk] has joined #code
14:27 ToxicFrog [~ToxicFrog@Admin.Nightstar.Net] has quit [Operation timed out]
14:31 ToxicFrog [~ToxicFrog@Admin.Nightstar.Net] has joined #code
14:31 mode/#code [+o ToxicFrog] by ChanServ
15:09 Reiver is now known as ReivZzz
15:15 * ToxicFrog checks in six changelists totaling over two thousand changed files
15:16 * Serah eats them.
15:53 * ToxicFrog tries to figure out a way to implement multi-argument memoization using recursion
15:54 * Serah eats it.
15:55
< AnnoDomini>
Obviously, you need to use a three-hand, moss-covered gredunza.
16:16
< MyCatVerbs>
http://www.zedshaw.com/rants/programmer_stats.html <-- I love this title.
16:45 MyCatVerbs [~rb6822@Nightstar-23831.cs.bris.ac.uk] has quit [Client exited]
17:01
<@ToxicFrog>
<Plouj> nothing is impossible
17:01
<@ToxicFrog>
<Plouj> just non-trivial
17:01
<@ToxicFrog>
<ToxicFrog`> What about solving NP-Hard problems in deterministic polynomial time?
17:01
<@ToxicFrog>
<Plouj> touche
17:32 Vornotron [~vorn@64.252.105.ns-12999] has joined #code
17:33 Vornicus [~vorn@Admin.Nightstar.Net] has quit [Ping Timeout]
17:49 You're now known as TheWatcher[afk]
18:02 Vornotron is now known as Vornicus
18:10
<@ToxicFrog>
Done: table.resize table.dump table.print string.split string.trim string.join string.rfind pairs ipairs type printf eprintf fprintf sprintf fd:printf math.da?(tan|cos|sin) oct
18:11
<@ToxicFrog>
In progress: table.copy table.clone getopts memoize string.interpolate
18:11
< Vornicus>
What are these that you have completed?
18:13
<@ToxicFrog>
I'm tidying up my util.lua for another release.
18:13
< Vornicus>
"math.da?"?
18:13
<@ToxicFrog>
Read it like a regex.
18:14
< Vornicus>
RIght, but...
18:14
< Vornicus>
math.dsin?
18:14
<@ToxicFrog>
math.dtan, math.datan, math.dcos, math.dacos...
18:14
<@ToxicFrog>
Trig functions that use degrees instead of radians.
18:14
< Vornicus>
aha
18:14
<@ToxicFrog>
The ones with a are the arc-equivalents.
18:14
< Vornicus>
yeah, got that.
18:15 * Vornicus wonders what (sin|cos|tan)h look like in degrees; the existing versions are slaved to radians
18:16
< Vornicus>
(they are, iirc, i * sin(i*x) )
18:19
<@ToxicFrog>
No idea.
18:19
<@ToxicFrog>
Anyways, the totally bastardly remaining ones are getopts and memoize.
18:20
<@ToxicFrog>
table.copy and table.clone are fairly simple, as is string.interpolate.
18:21
<@ToxicFrog>
Hmm.
18:22
<@ToxicFrog>
Table.copy: preserve metatable links, yes/no?
18:22
<@ToxicFrog>
Table.clone: copy metatables, yes/no?
18:23
< Vornicus>
Sounds right
18:23
<@ToxicFrog>
...that doesn't help
18:23
< Vornicus>
I don't know, really
18:24
< Vornicus>
I don't have the foggiest clue about what the metatable does and why you would want to copy them or link to them.
18:24
<@ToxicFrog>
Hmm. I think yes to both, though.
18:24
<@ToxicFrog>
Metatables control operator overloads, basically
18:24
<@ToxicFrog>
If you want to alter the behaviour of an object, you populate a table with stuff, then attach that to the object as a metatable.
18:24
<@ToxicFrog>
Multiple objects can share the same metatable, too, which is handy.
18:25
<@ToxicFrog>
So, the question is, when shallow-copying a table, should it share any operator overloads posessed by its parent?
18:25
< Vornicus>
Should, yes.
18:25
<@ToxicFrog>
And when deep-copying, should metatables get deep-copied as well?
18:25
< Vornicus>
I don't know about that.
18:26
<@ToxicFrog>
I think yes; the purpose of clone is to create something that is identical in shape and behaviour, but fully distinct.
18:26
< Vornicus>
that would cause, if I understand it, things that get cloned to have, essentially, a different class.
18:27
<@ToxicFrog>
(on the other hand, if your metatable refers to _G or something, you just ended up creating a copy of your entire program state)
18:27
< Vornicus>
yeah
18:30
<@ToxicFrog>
And deciding on class based on metatable is...not always correct.
18:30
<@ToxicFrog>
That's how the utility functions in lauxlib do it, but that means you can't stuff object-specific stuff into the metatable.
18:33
< Vornicus>
well, okay.
18:34 * ToxicFrog rearranges things so that table.copy() is now variable-depth, defaulting to infinity
18:37
<@ToxicFrog>
Oh, recall FuncTables from the other day...
18:37
<@ToxicFrog>
The flip side of that: TableFuncs.
18:37
<@ToxicFrog>
That is to say, functions that have members you can manipulate.
18:51 AnnoDomini [~farkoff@Nightstar-29028.neoplus.adsl.tpnet.pl] has quit [Quit: The purpose of writing is to inflate weak ideas, obscure poor reasoning, and inhibit clarity.]
19:08 You're now known as TheWatcher
19:21 Forj [~Forj@Nightstar-17168.ue.woosh.co.nz] has joined #code
19:25
<@ToxicFrog>
table.copy done, ditching table.clone for the time being.
19:53 ToxicFrog [~ToxicFrog@Admin.Nightstar.Net] has quit [Operation timed out]
19:53 Forj [~Forj@Nightstar-17168.ue.woosh.co.nz] has quit [Ping Timeout]
19:54 ToxicFrog [~ToxicFrog@Admin.Nightstar.Net] has joined #code
19:54 mode/#code [+o ToxicFrog] by ChanServ
20:27 Vornicus is now known as Vornicus-Latens
21:27 Netsplit Blargh.CA.US.Nightstar.Net <-> DeepThought.NY.US.Nightstar.Net quits: @Serah, EvilDarkLord, @ReivZzz, +KarmaBot, @Thaqui, @ToxicFrog, @Pi, Vornicus-Latens, @jerith, Raif, (+1 more, use /NETSPLIT to show all of them)
21:42 Pi [~sysop@Nightstar-6875.hsd1.wa.comcast.net] has joined #Code
21:42 Chalain [~chalain@Admin.Nightstar.Net] has joined #Code
21:42 Raif [~corvusign@Admin.Nightstar.Net] has joined #Code
21:42 ReivZzz [~reaverta@Admin.Nightstar.Net] has joined #Code
21:42 Vornicus-Latens [~vorn@64.252.105.ns-12999] has joined #Code
21:42 jerith_ [~jerith@Nightstar-21563.slipgate.za.net] has joined #code
21:44 jerith_ is now known as jerith
21:48 Thaqui [~Thaqui@Nightstar-17986.jetstream.xtra.co.nz] has joined #code
22:05 mode/#code [+o Pi] by ChanServ
22:05 mode/#code [+o Chalain] by ChanServ
22:05 mode/#code [+o TheWatcher] by ChanServ
22:05 Serah [~Z@87.72.35.ns-3885] has joined #Code
22:05 mode/#code [+o Serah] by ChanServ
22:05 KarmaBot [~fark.off@87.72.35.ns-3885] has joined #Code
22:06 mode/#code [+v KarmaBot] by ChanServ
22:06 Thaqui is now known as NSGuest-328
22:06 jerith is now known as NSGuest-330
22:06 ToxicFrog [~ToxicFrog@Admin.Nightstar.Net] has joined #code
22:06 mode/#code [+o ToxicFrog] by ChanServ
22:07 NSGuest-330 is now known as jerith
22:07
<@ToxicFrog>
A winner is me!
22:07
<@ToxicFrog>
I has a memoize() that works on varargs functions.
22:15
<@ToxicFrog>
http://lua.pastey.net/71206
22:19
<@ToxicFrog>
There has got to be a better way, though.
22:19
<@ToxicFrog>
Probably involving curry.
22:23 * jerith hands ToxicFrog a chicken madras.
22:26 * ToxicFrog consumes it utterly
22:26 You're now known as TheWatcher[T-2]
22:27 * jerith hands ToxicFrog a lamb vindaloo?
22:28 Forjadon [~Forjadon@Nightstar-17168.ue.woosh.co.nz] has joined #code
22:29 mode/#code [+o Forjadon] by ChanServ
22:29 Forjadon is now known as ChalcyLaptop
22:31 You're now known as TheWatcher[zZzZ]
22:48 NSGuest-328 is now known as Thaqui
22:50 AnnoDomini [~farkoff@Nightstar-29028.neoplus.adsl.tpnet.pl] has joined #Code
22:50 mode/#code [+o AnnoDomini] by ChanServ
23:10 jjlehto3 [~jjlehto3@Nightstar-2194.vipunen.hut.fi] has joined #code
23:10 jjlehto3 is now known as EvilDarkLord
23:18 gnolam [lenin@Nightstar-13557.8.5.253.se.wasadata.net] has joined #Code
23:18 mode/#code [+o gnolam] by ChanServ
23:20 ChalcyLaptop [~Forjadon@Nightstar-17168.ue.woosh.co.nz] has quit [Ping Timeout]
23:25 Forjadon [~Forjadon@Nightstar-17168.ue.woosh.co.nz] has joined #code
23:25 mode/#code [+o Forjadon] by ChanServ
23:25 Forjadon is now known as ChalcyLaptop
23:33 gnolam [lenin@Nightstar-13557.8.5.253.se.wasadata.net] has quit [Quit: Zzzzzzzzzzzzzzz]
--- Log closed Tue Jul 24 00:00:01 2007
code logs -> 2007 -> Mon, 23 Jul 2007< code.20070722.log - code.20070724.log >