- Curse Premium
Member for 12 years, 1 month, and 25 days
Last active Wed, Jul, 29 2020 09:04:33
- 0 Followers
- 14 Total Posts
- 0 Thanks
May 30, 2013First of all thanks Adirelle, I appreciate that you took the effort to review the code.Posted in: Libraries
The reason that ipairs is not used it is because it is noticeably slower than the equivalent for loop, and the len local, while not used inside the loop in every function, it is used in some, and writing all the loops in the same form should make the code more uniform and easier to read, while having no performance cost.
As for not using pairs(), I have tried to make every function that would make sense to be used on a table to work on tables, but otherwise I believe that it is better to use the keys() and values() functions if you only want to work on the keys or values of a table, rather than silently ignoring the keys.
I believe find_first_of and first_last_of are o(n*m) at the moment (m being the number of different values to search for) rather than o(n²), so it shouldn't be _that_ bad, but yeah I agree that making a lookup map should be even faster, I'll run some tests and change it.
Apr 27, 2013Made the following changes:Posted in: Libraries
- added merge, a function for merging tables
- added zip_with
- changed sort and shuffle to return copies, renamed in-place versions with the suffix _inplace, removed sorted and shuffled
- equal and clone are shallow by default, added deep option
- clone now works with tables instead of just lists
Apr 26, 2013Posted in: Libraries
I don't like the name invert, does not feel intuitive.
The name is taken from underscore.js. In the context of this library (one that mainly works on lists and tables) I think it is good enough, but I am open to suggestions.
min and max could optionally take a comparator function.
Both of these functions are implemented on terms of reduce, for example min is a call to reduce(list, math.min), so the rationale there is that if you need something more specialized you should use reduce instead.
Some names are strange, for example reverse returnes a copy, while shuffle does so inplace. Maybe reversed would be a better name?
In the spirit of functional programming, all the functions should return copies. The exceptions are sort and shuffle, which work in-place by default for performance (but both have versions that return copies). Probably I should make sort and shuffle returns copies by default, and name the versions that work in-place something else ?
It is unclear (from the api) whether the following will terminate:
It won't, I will make the documentation more clear about that.
equal takes an argument for shallow or not, why doesn't clone do?
I am thinking that the best option to fix that would be making equal shallow by default. Additionally I am going to change clone to work with tables instead of only lists.
Also some usage examples might be nice.
I will add some once the API is locked, it is a lot of work and I don't want to make changing things harder at this point. Meanwhile, if you don't mind terse code, there is a tests.lua file in the repository and in the packaged files that contains a few tests for all of the functions, and it may serve as usage examples as well.
Apr 26, 2013LibFunctional-1.0 is a library that provides a set of functions that allow a more functional style of programming in lua, such as map, filter and bind. Its main purpose is to replace the most commonly used loops with calls to descriptive functions, therefore making the purpose of the operation clearer and increasing the code readability.Posted in: Libraries
I'll be tagging a version soon, therefore locking the API, unless someone wants to request a change.
Oct 29, 2010In the current version of Grid, third-party status modules aren't being added to the "Debugging" page in the options. IIRC Ace2 Grid added them by registering ADDON_LOADED and checking for the X-GridStatusModule tag, however as far as I can tell it is not done anymore.Posted in: Grid & Grid2
Is this the intended behavior ?
Jun 8, 2008It doesn't seem to detect Flask of Distilled Wisdom, Buff Enough keeps telling me that I'm missing flask/elixir when using it. Changing the ID in spells.lua to:Posted in: General AddOns
BuffEnough.flasks["Distilled Wisdom"] = GetSpellInfo(17627)
seems to fix the problem. I guess the ID has changed in some recent patch.
Apr 25, 2008slaren posted a message on GridIndicatorCornerText - More text indicators for GridGreat, thank you :).Posted in: Grid & Grid2
Apr 24, 2008slaren posted a message on GridIndicatorCornerText - More text indicators for GridGridIndicatorCornerTextPosted in: Grid & Grid2
This addon adds four text indicators to the corners of Grid. Personally, I use it to display incoming heals and the number of hots, you might find another uses.
How to use it: As any other indicator, you will be able to configure it under the frames section of Grid. You can also change the font and font size from the advanced menu.
Thanks to kunda for GridIndicatorText3, from which this addon has been created.
EDIT: Removed file, download from the svn to get the latest version.
Apr 11, 2008A few features I would love to see:Posted in: General AddOns
-Disable fading of old chat text
-Changing text alignment (so that it sticks to the right side)
Also having more control over the fonts, like adding borders or shadows, but that's something minor.
Apr 11, 2008I'm having this problem with the configuration options not fitting in the frame:Posted in: General AddOns
Is there a way to have the configuration show in a standalone frame, not binded to the blizzard's UI?
Thanks though, looks like it's going to be a great addon!
Edit: Also having the same problem than Kyron when using macros, and I also got this error: Chatterbox\Modules\ChatLink.lua:30: bad argument #1 to 'gsub' (string expected, got nil)
- To post a comment, please login or register a new account.