lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I think I have an acceptable way of doing this. Will go in with the
next version.

Paul.

On Wed, Jun 13, 2012 at 11:59 AM, Eric Wing <ewmailing@gmail.com> wrote:
> If you allow a user defined function, don't worry about the caller.
> Then it becomes their problem to deal with the hard cases if they need
> them. (If they do, then they probably have a specific solution that
> will work for their own problem.)
>
>
>
> On 6/13/12, Paul K <paulclinger@yahoo.com> wrote:
>>> Maybe it is possible to allow an user defined (set of) sort function(s)?
>>> e.g. "sortkey=my_sorter_function"
>>
>> It may be possible to do that, but it's not clear what the caller
>> would do in this case either.
>>
>> It *may* be possible to sort the tables based on their serialized
>> *values*, which would be consistent, but the logic for that was
>> getting too complex, so I removed it.
>>
>> I'm considering another option, which is to sort the serialized
>> values, but it has its own challenges as the order in which those
>> values are produced is always the correct one for deserialization and
>> the sorting may break that.
>>
>> In the end, it may be one of the rare cases not worth worrying too much
>> about.
>>
>> Paul.
>>
>> On Wed, Jun 13, 2012 at 11:22 AM, Frank Meier-Dörnberg <frank@md-web.de>
>> wrote:
>>> Am 13.06.2012 20:12, schrieb Paul K:
>>>>
>>>> Unfortunately, when tables are used as keys, I can only ...
>>>
>>> Maybe it is possible to allow an user defined (set of) sort function(s)?
>>> e.g. "sortkey=my_sorter_function"
>>> --
>>> Cheers
>>> Frank
>>>
>>
>>
>
>
> --
> Beginning iPhone Games Development
> http://playcontrol.net/iphonegamebook/
>