View Single Post
07/14/14, 02:18 PM   #33
Xrystal
caritas omnia vincit
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 369
Originally Posted by merlight View Post
Probably the only thing I like about Lua's regular expressions is that they traded power for simplicity, so they're easy to learn. And the added benefit of learning things like this is you get better understanding of other people's code. I've had to learn myself, never used Lua and still don't like it as a language

Another shortcut:


Lua Code:
  1. newLink = newLink .. table.concat(linkData, ":", 3, 23)
Ah, now that concat didn't even cross my mind .. I always assumed table.concat was for concatenating tables not values within tables. Very interesting.

And yes, true, I am always up for learning and I do try using the table and string functions where I can but some of the more complex ones I always forget months down the line. If this was professional it would be a different kettle of fish, but this is for a game and just for a data conversion tool and not a use all the time addon But seeing as the release of this is a ways off you never know, I may rethink things and include these suggestions.

So thanks again for pointing them out and especially for explaining the gsub statement.
  Reply With Quote