Capturer un bloc dans un objet donne un proc ou une lambda. Même classe Proc, même .call — et deux comportements opposés : la lambda exige la bonne arité et son return est local ; le proc s'arrange de tout et son return sort de la méthode englobante. Une fonction, ou un fragment ? Choisis. Capturing a block in an object gives a proc or a lambda. Same Proc class, same .call — and two opposite behaviors: the lambda demands the right arity and its return is local; the proc shrugs everything off and its return exits the enclosing method. A function, or a fragment? Choose.
Le premier numéro est libre. Débloque tout The Ruby Loop — tous les volumes, à vie — pour 5 €, paiement unique. The first issue is free. Unlock all of The Ruby Loop — every volume, forever — for €5, one-time.