Search lua-l
This index contains 143,615 documents and
1,774,615 keywords. Last update on
2023-03-09 .
- 81. Re: [hack] nil.foo = nil (score: 281)
- Author: Andrew Starks <andrew.starks@...>
- Date: Thu, 1 May 2014 22:58:52 -0500
- If you're going to hijack a thread, you may as well do it brilliantly. :) More kungfu: ```lua debug.setmetatable(nil, {__index = function(t, i) return nil end}) local t = {} local m = { m_field = "he
- 82. Re: Lookup nil table index (score: 274)
- Author: lua@...
- Date: Thu, 30 Nov 2006 20:33:53 +0100
- * On 2006-11-30 Michael Wolf <miwo@gmx.at> wrote : [ snipped code ] Yes, I use something similar at this moment ( find("thing.foo.bar.this.that") ), but for code clarity I was looking for a bit less
- 83. Re: Lookup nil table index (score: 274)
- Author: lua@...
- Date: Thu, 30 Nov 2006 17:25:06 +0100
- * On 2006-11-30 Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote : Yes, that works for me, thank you very much! -- ^X^Cy^K^X^C^C^C^C
- 84. Re: Lookup nil table index (score: 274)
- Author: roberto@... (Roberto Ierusalimschy)
- Date: Thu, 30 Nov 2006 14:03:04 -0200
- You can achive this by setting an __index metamethod for nil, but you will have to set it through C. (More exactly, you need C to set a metatable for nil. After that you can use Lua to set the metam
- 85. Lookup nil table index (score: 274)
- Author: lua@...
- Date: Thu, 30 Nov 2006 16:40:46 +0100
- Hello, I'm working on code with quite deep tables. When referring to an element in the table, I use the table keys joined by dots, eg: a = thing.foo.bar.this.that When one of the indicated elements d
- 86. Re: [proposal] Using nil/NaN as table index (score: 269)
- Author: Dirk Laurie <dirk.laurie@...>
- Date: Tue, 8 Apr 2014 21:41:26 +0200
- 2014-04-08 18:57 GMT+02:00 Peter Melnichenko <petjamelnik@yandex.ru>: Raw table indexing is just an efficient way of implementing direct search. I.e. rawget(tbl,key) is equivalent to: function lookup
- 87. Observations about a index getters (score: 263)
- Author: Andrew Starks <andrew.starks@...>
- Date: Fri, 5 Dec 2014 22:20:20 -0600
- I have an object model that I was hacking up. I decided to implement a penlight-like 'sorta private' getter/setter model. Where setting and getting can be independently controlled by prefixing fields
- 88. Re: Must "attempt to get length of a number value" be an error? (score: 213)
- Author: Philippe Verdy <verdy_p@...>
- Date: Thu, 9 May 2019 15:20:19 +0200
-
- 89. Memoizing Functions - yet another attempt (score: 198)
- Author: Andrew Starks <andrew.starks@...>
- Date: Sat, 14 Dec 2013 16:07:46 -0600
- Nah. More of a puzzlement really. Let take a closer look at that Microlight's memoize function [1]: (1) It mandates one parameter (not zero, not multiple parameters, just one, not nil, parameter) [2
- 90. Re: Memoizing Functions - yet another attempt (score: 198)
- Author: Petite Abeille <petite.abeille@...>
- Date: Sat, 14 Dec 2013 22:57:53 +0100
- Nah. More of a puzzlement really. Let take a closer look at that Microlight's memoize function [1]: (1) It mandates one parameter (not zero, not multiple parameters, just one, not nil, parameter) [2]
- 91. RE: Undefined variables returning nil (score: 192)
- Author: "Ivo Beltchev" <ivo@...>
- Date: Tue, 19 Mar 2013 17:00:49 -0700
- I've recently struggled with this problem. I want to create inheritance of environments. I set the parent environment as __index for the child environment. So when you access a variable from the chil
- 92. Re: attempt to perform arithmetic on field '_income' (a table value) (score: 189)
- Author: Choonster TheMage <choonster.2010@...>
- Date: Wed, 18 Sep 2013 23:24:47 +1000
- You need to add self as the first parameter to the functions or define them with colon syntax (which gives them an implicit first parameter self). i.e. the tax:init method could be declared like this
- 93. Re: attempt to perform arithmetic on field '_income' (a table value) (score: 189)
- Author: Dirk Laurie <dirk.laurie@...>
- Date: Wed, 18 Sep 2013 15:09:55 +0200
- Thus: function tax:init (pIncome, pRate) self._income = pIncome self._rate = pRate end 2013/9/18 Jayanth Acharya <jayachar88@gmail.com>:
- 94. Re: attempt to perform arithmetic on field '_income' (a table value) (score: 189)
- Author: Jayanth Acharya <jayachar88@...>
- Date: Wed, 18 Sep 2013 18:32:26 +0530
- And change all the tax.xxx statements to self.xxx statements. Thanks Dirk, but changing tax to self inside the functions, I get this error: attempt to index global 'self' (a nil value)
- 95. Re: Must "attempt to get length of a number value" be an error? (score: 184)
- Author: Philippe Verdy <verdy_p@...>
- Date: Wed, 8 May 2019 05:00:10 +0200
- abs(n) is as much arbitrary as the number of digits, i.e. roughly log10(abs(n) for integers... This still does not work properly for non-integers, or large integers whose integral precision is lost b
- 96. Re: Undefined variables returning nil (score: 174)
- Author: Kevin Martin <kev82@...>
- Date: Tue, 19 Mar 2013 23:29:05 +0000
- It was meant as a rhetorical question, to ask yourself. However, to comment on your suggestions: 1) The contains function is clearly a bad idea. How would you implement it? 2) The in operator is bett
- 97. Re: cannot index a table loaded as a chunk (score: 173)
- Author: Ben Sunshine-Hill <sneftel@...>
- Date: Fri, 20 Aug 2004 03:30:49 -0700
- Well, the Lua side looks fine. I suggest you check the return value of lua_dofile to see if the file is being loaded in appropriately.
- 98. Re: cannot index a table loaded as a chunk (score: 173)
- Author: "Michael Newberry" <mnewberry@...>
- Date: Fri, 20 Aug 2004 03:00:12 -0700
- I show the source code below. I understand the difference between LuaL_loadfile and lua_dofile. Originally, I tried using lua_dofile and that did not work so I tried luaL_loadfile and that didn;t wor
- 99. Re: Propsoal: a lua dialect without nil (score: 172)
- Author: Matthew Frazier <leafstormrush@...>
- Date: Tue, 15 Feb 2011 18:00:47 -0500
- I agree - right now, nil is not a first-class value. It's more like a first-and-a-half-class value. Because, as Julien Duminil mentioned above, nil has just enough first-class value properties (havi
- 100. Re: Embedded 'nil' values - a suggestion (score: 172)
- Author: "Hugh O'Byrne" <hobyrne@...>
- Date: Thu, 30 Mar 2006 13:23:35 -0500
- The merging of all of these concepts into one atomic type, however, has the collision of embedded nils - tables-as-hashes need a way to remove a key entirely; tables-as-arrays need a way to store an
Search by
Namazu v2.0.21