fuzion-lang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.
Fuzion
•
Idioms
•
Idiom # 28: Sort by a property
Idiom # 28: Sort by a property
See
programming-idioms.org
:
Code
items.sort a,b -> a.p <= b.p
What are effects?
Running Example
ex28 is item (p i32, q String) is redef as_string => "$p $q" items := [ item 47 "siebenundvierzig"; item 11 "elf"; item 0 "null"; item 8 "acht"; item 15 "fünfzehn" ] say (items.sort_by (a,b -> a.p <= b.p))
What are effects?
last changed: 2024-07-01
next: Idiom # 29: Remove item from list, by its index