Issues
- improve StructSort() to accept a comparer UDFLDEV-112Resolved issue: LDEV-112Pothys - MitrahSoft
- Support structToSorted() BIFLDEV-1655Resolved issue: LDEV-1655Pothys - MitrahSoft
- structToSorted not available in Lucee (but in CF2016+)LDEV-2662Resolved issue: LDEV-2662michael
- Supports for New Functions Implement in ACFLDEV-1809Resolved issue: LDEV-1809Michael Offner
improve StructSort() to accept a comparer UDF
Description
Details
Assignee
Pothys - MitrahSoftPothys - MitrahSoftReporter
Igal SapirIgal SapirLabels
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Sprint
Fix versions
Priority
New
Details
Details
Assignee
Reporter
Labels
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Sprint
Fix versions
Priority
Activity
Pothys - MitrahSoft21 March 2025 at 11:56
I've reviewed this ticket, and StructSort() now accepts a comparer UDF. Lucee handles the callback function more efficiently by its key, so I will close this ticket.
Pothys - MitrahSoft24 February 2025 at 12:54Edited
, I have tested this ticket with Lucee version 6.2.1.30-SNAPSHOT. When I tried to sort the structure using the StructSort()
function with a callback function, it returned an array sorted by the keys. In ACF, it returns an array sorted by the values.
Here is the code,
Zac Spitzer21 February 2025 at 14:21Edited
alas the callback signature for structToSorted is different, StructSort only accepts key1 & key2
your idea about an improved approach is solved by
Zac Spitzer27 January 2023 at 19:54
Zac Spitzer27 January 2023 at 19:33Edited
StructSort() has a horrible function interface. it can be greatly improved by adding the option to pass a comparer UDF as an arg.
IMO the new implementation should then return an ordered struct, rather than an array.