Thread Tools Display Modes
12-24-18, 01:20 PM   #1
Mayron
A Frostmaul Preserver
 
Mayron's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 275
Is there a way to find what version of Lua WoW is using?

A common problem that plagues me is not being able to control what pairs and ipairs is targetting when used with metatables. I tend to use a "proxy" table attached to a metatable and use __newindex and __index to move all key and value pairs to a separate table to better control the behaviour of data being passed to and from the table.

But this breaks pairs and ipairs and I noticed that in Lua 5.2+ you can have metamethods for these functions:
http://lua-users.org/wiki/GeneralizedPairsAndIpairs

I was wondering if this is supported in WoW, or in general how can you find out the Lua version used in WoW. I will test this out after the holidays when I have some time but doubt WoW would support it tbh.
  Reply With Quote
12-24-18, 01:28 PM   #2
Mayron
A Frostmaul Preserver
 
Mayron's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 275
Damn. Managed to test it out and sadly it's not supported. Still, is there a way to find what version of Lua is being used?
  Reply With Quote
12-24-18, 01:41 PM   #3
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,871
The last reported update I know of was from 5.0 to 5.1 with patch 2.0.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 12-24-18 at 01:44 PM.
  Reply With Quote
12-24-18, 03:00 PM   #4
Mayron
A Frostmaul Preserver
 
Mayron's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 275
Originally Posted by Fizzlemizz View Post
The last reported update I know of was from 5.0 to 5.1 with patch 2.0.
Thank you, I thought that might be the case. Looks like there won't be an update for a very long time, if ever. I know it's a giant risk for any company to update something so critically important for such a popular, valuable product. Risk management would be put on edge and they aren't really gaining any big benefit from doing so.
  Reply With Quote
12-24-18, 08:30 PM   #5
jlam
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 29
Originally Posted by Mayron View Post
Thank you, I thought that might be the case. Looks like there won't be an update for a very long time, if ever. I know it's a giant risk for any company to update something so critically important for such a popular, valuable product. Risk management would be put on edge and they aren't really gaining any big benefit from doing so.
I doubt they will ever update the version of Lua (5.1.x) that is embedded into WoW. The changes from 5.1 to 5.2 with function environments will probably break too many things that were written with that in mind.

You should be able to write your own table class with its own iterators, though they will never be seamlessly dropped in place of normal tables.
  Reply With Quote
12-25-18, 02:29 AM   #6
Mayron
A Frostmaul Preserver
 
Mayron's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 275
Originally Posted by jlam View Post
You should be able to write your own table class with its own iterators, though they will never be seamlessly dropped in place of normal tables.
I was going to do that but there are many helper functions I use which use pairs and ipairs so rather than try to avoid them I decided to add a "GetTable" method to my "proxy table" to get the "real table" that my proxy table communicates with, and then just pass the real table to these functions and pairs/ipairs.

That'll have to do for now. I've heard that 5.1 supports a metamethod for __next but I'd rather not have to always use next() for everything just for the sake of being safe.
  Reply With Quote
12-30-18, 06:58 PM   #7
thomasjohnshannon
A Theradrim Guardian
 
thomasjohnshannon's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 68
For future reference you can check the lua version in game with the following line. And as previously stated they are still running Lua 5.1.

Lua Code:
  1. /script print(_VERSION)
__________________
Thomas aka Urnn
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Is there a way to find what version of Lua WoW is using?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off