lua-users home
lua-l archive

Search lua-l

This index contains 143,604 documents and 1,774,497 keywords. Last update on 2023-03-08 .

Query: [How to search]

Display: Description: Sort by:

Results:

References: [ lua (Too many documents hit. Ignored) ] [ array: 5396 ] [ indexing: 1373 ]

Total 296 documents matching your query.

21. Re: String indexing again (score: 254)
Author: <jgiors@...>
Date: Mon, 20 Dec 2010 11:21:43 -0700
This is a good point. The behavior could be modified by changing __index to a function which generates an error when the index is a number (and otherwise falls back to the current behavior), but I'm
22. Re: 1-based indexing in Lua or the one without zero (score: 250)
Author: Oliver Kroth <oliver.kroth@...>
Date: Tue, 24 Apr 2018 13:54:00 +0200
Am 23.04.2018 um 18:58 schrieb Axel Kittenberger: Related, about point three. When pacing (aloud) a distance I normally see people step at the star and count "one, two, three...", no "start" or "zero
23. Re: String indexing again (score: 250)
Author: Axel Kittenberger <axkibe@...>
Date: Mon, 20 Dec 2010 22:26:01 +0100
This conflicts with thihs: Since then an index should return a byte. To refer to the OP, if you shoot at the manual, I'd go for this sentence, In 2.2 "String represents arrays of characters.". A stri
24. Re: Request for Lua 6 to have 0-based indexing (score: 247)
Author: Spar <developspartv@...>
Date: Mon, 15 Nov 2021 01:20:14 +0300
Offset is actually what can't relate to Lua. Lua doesn't have pointers for offset being useful. Also you mentioned Love2D: LuaJIT compensates 0th key, it's an array part as  well. On 15 Nov 2021, 01:
25. Re: 1-based indexing in Lua (score: 247)
Author: Dirk Laurie <dirk.laurie@...>
Date: Fri, 30 Mar 2018 07:55:04 +0200
018-03-29 17:30 GMT+02:00 Dong Feng <middle.fengdong@gmail.com>: This comment is perceptive. For files, it's always an offset, since a file has a position. When it comes to ordinals, most natural lan
26. Re: 1-based indexing in Lua (score: 247)
Author: Dong Feng <middle.fengdong@...>
Date: Thu, 29 Mar 2018 15:30:24 +0000
On Thu, 29 Mar 2018 at 01:52 Axel Kittenberger <axkibe@gmail.com> wrote: > Moreover, it is not strictly correct to say that Lua has 1-based indexing. Mixed 1-based and 0-based indexing is the worst p
27. Re: String indexing again (score: 247)
Author: HyperHacker <hyperhacker@...>
Date: Mon, 20 Dec 2010 16:49:31 -0700
Yes, I realize the problem there. Can't think of a sane way to resolve that... still, I don't see why we can't support read-only indexing with a brief explanation in the manual of why assignment isn'
28. Re: String indexing again (score: 240)
Author: <jgiors@...>
Date: Mon, 20 Dec 2010 16:42:26 -0700
<...snip...> <...snip...> __newindex will not work since it does not have access to named variable "s" [in my example]. It only receives a pass-by-value copy of the string, and (as Drake Wilson repl
29. RE: modifying lua for table indexing with fixed point variables (score: 239)
Author: "Jerome Vuarand" <jerome.vuarand@...>
Date: Mon, 28 Apr 2008 11:24:47 -0400
Shouldn't you instead modify the table construction code so that {"one","two","three","four","five"} use indices 1<<16, 2<<16, 3<<16, 4<<16 and 5<<16 ? That would solve any indexing issue. You would
30. Re: So I had this weird idea to solve the indexing problem (score: 234)
Author: Oliver Kroth <oliver.kroth@...>
Date: Tue, 11 Jun 2019 11:05:45 +0200
Hi, I guess it must be for i=0, #array do ... end as array[0] does not count in # -- Oliver for i=0,#array-1 do print(array[i]) end

Search by Namazu v2.0.21