Website | Source

Examples

# A quicksort implementation
fn qsort(data)                                       
    let [x, ..data] = tbl(data)                      
    if (len(data) == 0)                              
        return [x]                                   
                                                     
    let small = filter(fn(y) -> y <  x, data)        
    let large = filter(fn(y) -> y >= x, data)        
    return qsort(small) ++ [x] ++ qsort(large)       


Tags: language   embedded   native  

Last modified 07 October 2024