In Ruby, are there any differences between Proc.new { 'waffles' }
and proc { 'waffles' }
? I have found very few mentions of the second syntax.
From testing using irb
, I haven't found any obvious differences. Is the second syntactic sugar for the first?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…