ruby四种魔法写法

def i(a='')
  print a
end
def love(a='')
  "Hello " + a
end
def you
  "world! \n"
end

i love you

def I
  yield
end
def Love
  yield
end
def You
  yield
  print "Hello world! \n"
end
I{Love{You{}}}

编程技巧