Team Spartan Cookies & Milk Forums
  • Issue Tracker
  • Donations
  • Search
  • Member List
  • Help

Register

Team Spartan Cookies & Milk Forums Garry's Mod Starfall v
« Previous 1 … 8 9 10 11 12 … 18 Next »
Funny Lua5.1 bug
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode
Funny Lua5.1 bug
19-11-2016, 06:34 PM, (This post was last modified: 19-11-2016, 07:07 PM by ILoveYou.)
#1
ILoveYou Offline
TSCM Member
***
Posts: 18
Threads: 7
Joined: Aug 2015
Exclamation  Funny Lua5.1 bug
Everyone knows that we cant use numbers inside variable names, but:

Code:
Table[Player:steamID()] = true

gives a output like:

Code:
Table = { STEAM_0:1:0000000 = true }

and now, how's that possible? xD

i tried to compress tables with lzw(1)table2string- 2)lzw- 3)string2table), but with this thing i'm unable to do the last point.
Find
Reply
20-11-2016, 05:02 AM, (This post was last modified: 20-11-2016, 05:02 AM by Red The Blue Color.)
#2
Red The Blue Color Offline
TSCM Super Donating Member
****
Posts: 422
Threads: 34
Joined: Feb 2015
RE: Funny Lua5.1 bug
You can use numbers in variable names in lua you just can't have it start with a number...

and the steamid is a string anyways

"with it's superior software, i have no doubt it will succeed in finding fuck all" - T-17, 2016

[Super Member] [ENCOM] т-ѕсм.Red The Blue Color™: server do you support Hitler?
[Server] srcds_linux: The probabilty is about 99.99%, so interpret that how you want to.
Find
Reply
20-11-2016, 11:56 AM,
#3
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: Funny Lua5.1 bug
I'd firstly question why you're trying to "compress tables" in the first place. Turning a table into a string and then compressing that is not a good way to encode a table.

Secondly, no this is not a Lua 5.1 bug. There's a distinct difference between a variable (which is a syntax construct) and a key in a table (which is purely data). You can have any string value as a table key, whether it would be valid to write as a variable or not. For example, these are all valid:
{
[ "function" ] = true,
[ "12345" ] = true,
[ "+" ] = true
}
Find
Reply
« Next Oldest | Next Newest »


  • View a Printable Version
Forum Jump:


Users browsing this thread:
Contact UsTeam Spartan Cookies & MilkReturn to TopLite (Archive) ModeMark all forums readRSS Syndication

Powered By MyBB, © 2002-2026 MyBB Group.