Guest User

Untitled

a guest
Sep 19th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. fn with<T,R>(v: T, f: f(T) -> R) -> R {
  2. f(v)
  3. }
  4.  
  5. fn some_func(a: uint, b: uint) -> uint {
  6. with(
  7. fn&(x: uint) -> uint { a + b + x }
  8. ) {|helper|
  9.  
  10. helper(22)
  11.  
  12. }
  13. }
  14.  
  15. fn some_func(a: uint, b: uint) -> uint {
  16. let helper = fn@(x: uint) -> uint {
  17. a + b + x
  18. };
  19. helper(22)
  20. }
Add Comment
Please, Sign In to add comment