Path: csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!not-for-mail From: dreamer Newsgroups: comp.lang.ruby Subject: * in { |key, value| value * 2 } Date: Mon, 8 Jul 2019 15:24:53 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 24 Message-ID: NNTP-Posting-Host: panix1.panix.com X-Trace: reader1.panix.com 1562599493 12065 166.84.1.1 (8 Jul 2019 15:24:53 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Mon, 8 Jul 2019 15:24:53 +0000 (UTC) User-Agent: tin/2.4.3-20181224 ("Glen Mhor") (UNIX) (NetBSD/7.1.2 (amd64)) Xref: csiph.com comp.lang.ruby:7408 Hi all, I'm new to ruby and trying to understand this bit of code: hash.update(hash) { |key, value| value * 2} In particular what is the meaning of the value * 2? When I tried using IRB to multiply values in a hash, either I received an error or it multiplied the values and gave me the product. Any insights would be greatly appreciated. Thank you. -- -- danny lee (fka dan1mal@mindvox.com, dreamer@escape.com) "I remarked to Dennis [Ritchie] that easily half the code I was writing in Multics was error recovery code. He said, "We left all that stuff out [of Unix]. If there's an error, we have this routine called panic, and when it is called, the machine crashes, and you holler down the hall, 'Hey, reboot it.'"- Tom Van Vleck.