Advertisement
Guest User

Untitled

a guest
Sep 15th, 2017
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Oz 0.42 KB | None | 0 0
  1. local X Drop Length L in
  2.    
  3.    fun {Length L}
  4.       case L of H|T then 1+{Length T}
  5.       else 0
  6.       end
  7.    end
  8.  
  9.    fun {Drop X N}
  10.       if {Length X} >= N then
  11.          H|T = X in case N of 1 then T
  12.                        N of 0 then X
  13.                     else {Drop T N-1}
  14.                     end
  15.       else
  16.          nil
  17.       end
  18.      
  19.    end
  20.    
  21.    L = [1 2 3 5]
  22.    
  23.    {Browse {Drop L 0}}
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement