在Java中设计一个并发线程时使用Runnable和Callable接口有什么区别,为什么要选择一个呢?
喜欢这个:
people = []
begin
info = gets.chomp
people += [Person.new(info)] if not info.empty?
end while not info.empty?
该begin <code> end while <condition>由Ruby的作者Matz的拒绝。相反,他建议使用Kernel#loop,例如
loop do
# some code here
break if <condition>
end