Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn with<T,R>(v: T, f: f(T) -> R) -> R {
- f(v)
- }
- fn some_func(a: uint, b: uint) -> uint {
- with(
- fn&(x: uint) -> uint { a + b + x }
- ) {|helper|
- helper(22)
- }
- }
- fn some_func(a: uint, b: uint) -> uint {
- let helper = fn@(x: uint) -> uint {
- a + b + x
- };
- helper(22)
- }
Add Comment
Please, Sign In to add comment