![]() |
|
Thread locks too soon |
Johan Halmén
Member #1,550
September 2001
|
A tiny crowbar. It's amazing how it fits in the smallest places and allows me to insert a heavier crowbar and finally demount things in my old house without destroying stuff very much. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Years of thorough research have revealed that what people find beautiful about the Mandelbrot set is not the set itself, but all the rest. |
DanielH
Member #934
January 2001
![]() |
Johan, years of research should have revealed that it is a red (x button) not a (red x) button. Reminds me of those stupid Jaden Smith memes. "When you clean out a vacuum cleaner, you become the vacuum cleaner" |
Johan Halmén
Member #1,550
September 2001
|
And when I get a divorce, my wife becomes a vacuum cleaner. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Years of thorough research have revealed that what people find beautiful about the Mandelbrot set is not the set itself, but all the rest. |
Chris Katko
Member #1,881
January 2002
![]() |
{"name":"XbqnLL8.jpg","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/4\/3\/43966bf65b1394cada8ed25edb4b43fe.jpg","w":1194,"h":879,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/4\/3\/43966bf65b1394cada8ed25edb4b43fe"} {"name":"jK2x8KD.png","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/d\/1\/d104263feb281e6e50bee3034d449bd3.png","w":469,"h":350,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/d\/1\/d104263feb281e6e50bee3034d449bd3"} -----sig: |
Bruce Perry
Member #270
April 2000
|
Isn't Peter Griffin a cartoon character? -- |
Chris Katko
Member #1,881
January 2002
![]() |
He is? -----sig: |
Eric Johnson
Member #14,841
January 2013
![]() |
Aren't we all cartoon characters every now and again?
|
Gideon Weems
Member #3,925
October 2003
|
Eric Johnson
Member #14,841
January 2013
![]() |
Adult Goku or kid Goku? I favor kid Goku, as I enjoy Dragon Ball over Dragon Ball Z.
|
Erin Maus
Member #7,537
July 2006
![]() |
In Lua, setmetatable returns the table, so you can do something like this: t = setmetatable({}, metatable) Which is less verbose than this: t = {} setmetatable(t, metatable) Similarly, table.remove returns the removed entry, so you can do this: return table.remove(stack, #stack) Instead of this: result = stack[#stack] table.remove(stack, #stack) return result But table.insert doesn't return the inserted entry, which is annoying. So I can't do this: return table.insert(stack, { foo: 1, bar: "baz" }) Instead, I have to do this: t = { foo: 1, bar: "baz" } table.insert(stack, t) return t Which seems inconsistent. --- |
bamccaig
Member #7,536
July 2006
![]() |
I don't think it is. In the former cases the return value was something that you didn't necessary have already. You had a metatable and an index, but not the table and value, respectively. Whereas with the insert, you already have the value that you're inserting. Would this work: return table.insert(stack, { foo: 1, bar: "baz" }), stack[#stack] I think it might. In any case, while it's convenient to have clever shortcuts to things, they often can be difficult to understand at a glance which can result in more bugs. In actuality, splitting things up makes them much easier to understand. And it's not that much more to type. It's also easier to debug or extend. For example, it's not exactly obvious what 'setmetatable' would return. Why not the metatable? Or maybe the previous metatable? You have to memorize the API to know that it returns the table itself. And if you forget that you could end up with some obscure, misbehaving code that doesn't stand out. -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
Erin Maus
Member #7,537
July 2006
![]() |
I don't have a reference to the values because it's passed directly to table.insert without being stored in a local variable prior. I really don't think the concise examples are any less readable than the verbose ones. It's not like I'm cramming 100 operations in a single line. I've never had problems reading Lua code formatted as such before. --- |
DanielH
Member #934
January 2001
![]() |
Not even spring yet and we hit 93°F today (33.9°C). They also predict his weekend will be warmer. |
Eric Johnson
Member #14,841
January 2013
![]() |
I hope the heat and humidity are low tomorrow. I live in Louisiana and have to drive into Mississippi tomorrow in a car without air conditioning.
|
Bruce Perry
Member #270
April 2000
|
Our weather here in the UK has been very windy. I'm a little windswept, short and stout. -- |
Gideon Weems
Member #3,925
October 2003
|
Eric Johnson
Member #14,841
January 2013
![]() |
Gideon Weems said: Interesting, as I mostly hear the opposite. Did you experience Dragon Ball first? I don't remember exactly. I saw them both pretty close to one another, so it's all a blur. But I resonated more with Dragon Ball and its quirkiness more so than the action of Z. If I were to go back and re-watch one of them, it'd be Dragon Ball.
|
Bruce Perry
Member #270
April 2000
|
Gideon, I like your brain BRAAAAAAAAAAAIIIIIIIIIIIIIN -- |
bamccaig
Member #7,536
July 2006
![]() |
HIS EYES ARE UP... Oh, no, that's right. His eyes are right there. Carry on. -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
Bruce Perry
Member #270
April 2000
|
bambams \ó/ -- |
Gideon Weems
Member #3,925
October 2003
|
Bruce Perry
Member #270
April 2000
|
What's that from? And how does your brain strike for this one: i_ò/ -- |
jmasterx
Member #11,410
October 2009
|
You guys were so busy fussing over the 1000th reply, you completely forgot about the 1024th post Agui GUI API -> https://github.com/jmasterx/Agui |
bamccaig
Member #7,536
July 2006
![]() |
McLuserSaus. -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
Gideon Weems
Member #3,925
October 2003
|
|
|
|