flang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.
Fuzion
•
Idioms
•
Idiom # 100: Sort by a comparator
Idiom # 100: Sort by a comparator
See
programming-idioms.org
:
Code
items.sort c
What are effects?
Running Example
ex100 is items := [ "siebenundvierzig"; "elf"; "null"; "acht"; "fünfzehn" ] c (string, string) -> bool := a,b -> a.byteLength <= b.byteLength say (items.sort c) # passing the lambda directly to sort avoids # specifying its type: # say (items.sort (a,b -> a.byteLength <= b.byteLength))
What are effects?
next: NYI: Idiom # 101: Load from HTTP GET request into a string