[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: math.max and math.min are not concerned with mathematics anymore
- From: Dirk Laurie <dirk.laurie@...>
- Date: Fri, 25 Sep 2015 07:03:20 +0200
2015-09-25 3:59 GMT+02:00 Egor Skriptunoff <egor.skriptunoff@gmail.com>:
> IMO, functions "math.max" and "math.min" should be removed from "math"
> library as they do not have anything common with mathematics anymore.
`max` and `min` are functions that operate on ordered sets.
These are perfectly respectable mathematical objects.
Previous versions of `max` and `min` operated on numbers.
The curiosity that the string "11" can in many places be used to
mean the number 11 is a Lua peculiarity that is being phased out.
In 5.3 you can already disable it with a configuration option.
> As "min" and "max" are applicable now for any comparable
> objects in Lua, they are better suited for global namespace.
Although I do not accept the reason, I agree with the recommendation.
`max` and `min` are extremely basic operations that are needed
often.