Ho appena letto il seguente codice:Cos'è questa sintassi Ruby?
class Dir
def self.create_uniq &b ### Here, & should mean b is a block
u = 0
loop do
begin
fn = b[u] ### But, what does b[u] mean? And b is not called.
FileUtils.mkdir fn
return fn
rescue Errno::EEXIST
u += 1
end
end
io
end
end
ho messo la mia confusione come commento nel codice.
Secondo la [Guida Rubino Stile] (https: // GitHub .com/bbatsov/ruby-style-guide) si dovrebbe * "Preferire' proc.call() 'su' proc [] 'o' proc.() 'sia per lambdas che procs." * – Stefan
@Downvoter: Spiegare il tuo downvote. –