[#59462] [ruby-trunk - Bug #9342][Open] [PATCH] SizedQueue#clear does not notify waiting threads in Ruby 1.9.3 — "jsc (Justin Collins)" <redmine@...>

9 messages 2014/01/02

[#59466] [ruby-trunk - Bug #9343][Open] [PATCH] SizedQueue#max= wakes up waiters properly — "normalperson (Eric Wong)" <normalperson@...>

11 messages 2014/01/02

[#59498] [ruby-trunk - Bug #9352][Open] [BUG] rb_sys_fail_str(connect(2) for [fe80::1%lo0]:3000) - errno == 0 — "kain (Claudio Poli)" <claudio@...>

10 messages 2014/01/03

[#59516] [ruby-trunk - Bug #9356][Open] TCPSocket.new does not seem to handle INTR — "charliesome (Charlie Somerville)" <charliesome@...>

48 messages 2014/01/03

[#59538] [ruby-trunk - Feature #9362][Assigned] Minimize cache misshit to gain optimal speed — "shyouhei (Shyouhei Urabe)" <shyouhei@...>

33 messages 2014/01/03
[#59541] Re: [ruby-trunk - Feature #9362][Assigned] Minimize cache misshit to gain optimal speed — Eric Wong <normalperson@...> 2014/01/04

Hi, I noticed a trivial typo in array.c, and it fails building struct.c

[#59582] Re: [ruby-trunk - Feature #9362][Assigned] Minimize cache misshit to gain optimal speed — SASADA Koichi <ko1@...> 2014/01/06

Intersting challenge.

[#59583] [ruby-trunk - Bug #9367][Open] REXML::XmlDecl doesn't use user specified quotes — "bearmini (Takashi Oguma)" <bear.mini@...>

12 messages 2014/01/06

[#59642] [ruby-trunk - Bug #9384][Open] Segfault in ruby 2.1.0p0 — "cbliard (Christophe Bliard)" <christophe.bliard@...>

11 messages 2014/01/08

[#59791] About unmarshallable DRb objects life-time — Rodrigo Rosenfeld Rosas <rr.rosas@...>

A while ago I created a proof-of-concept that I intended to use in my

16 messages 2014/01/15
[#59794] Re: About unmarshallable DRb objects life-time — Eric Hodel <drbrain@...7.net> 2014/01/15

On 15 Jan 2014, at 11:58, Rodrigo Rosenfeld Rosas <rr.rosas@gmail.com> =

[#59808] Re: About unmarshallable DRb objects life-time — Rodrigo Rosenfeld Rosas <rr.rosas@...> 2014/01/16

Em 15-01-2014 19:42, Eric Hodel escreveu:

[#59810] Re: About unmarshallable DRb objects life-time — Eric Hodel <drbrain@...7.net> 2014/01/16

On 16 Jan 2014, at 02:15, Rodrigo Rosenfeld Rosas <rr.rosas@gmail.com> =

[#59826] Re: About unmarshallable DRb objects life-time — Rodrigo Rosenfeld Rosas <rr.rosas@...> 2014/01/17

Em 16-01-2014 19:43, Eric Hodel escreveu:

[ruby-core:60371] [ruby-trunk - Feature #8987] map/collect extension which handles arguments

From: ko1@...
Date: 2014-01-31 05:48:55 UTC
List: ruby-core #60371
Issue #8987 has been updated by Koichi Sasada.


 (2013/10/06 0:26), sawa (Tsuyoshi Sawada) wrote:
 >     [1, 2, 3, 4].map(&4.method(:+))
 >     # =3D> [5, 6, 7, 8]
=20
 Interesting.
=20
 If we use =CE=BB (alias of lambda=EF=BC=89, it is more short.
=20
     module Kernel
       alias =CE=BB lambda
     end
     p [1, 2, 3, 4].map(&4.method(:+)) #=3D> [5, 6, 7, 8]
     p [1, 2, 3, 4].map(&=CE=BB{|x| 4+x})  #=3D> [5, 6, 7, 8]
=20
 If we define =CE=BB as the following definition, more short code.
=20
     module Kernel
       def =CE=BB(a, sym)
         lambda{|x| a.send(sym, x)}
       end
     end
=20
     p [1, 2, 3, 4].map(&=CE=BB(4, :+))  #=3D> [5, 6, 7, 8]
=20
 A bit shorter version.
=20
     module Kernel
       def =CE=BB(expr)
         eval("lambda{|x| #{expr} x}")
       end
     end
=20
     p [1, 2, 3, 4].map(&=CE=BB("4+"))  #=3D> [5, 6, 7, 8]
=20
=20
 If we have default parameter `_' (maybe matz doesn't like), we can make
 more short code.
=20
     p [1, 2, 3, 4].map(&=CE=BB{4+_})      #=3D> [5, 6, 7, 8]
=20
 Summary:
     p [1, 2, 3, 4].map(&4.method(:+)) #=3D> [5, 6, 7, 8]
     p [1, 2, 3, 4].map(&=CE=BB{|x| 4+x})  #=3D> [5, 6, 7, 8]
     p [1, 2, 3, 4].map(&=CE=BB(4, :+))    #=3D> [5, 6, 7, 8]
     p [1, 2, 3, 4].map(&=CE=BB("4+"))     #=3D> [5, 6, 7, 8]
     p [1, 2, 3, 4].map(&=CE=BB{4+_})      #=3D> [5, 6, 7, 8] (doesn't run)
=20
 --=20
 // SASADA Koichi at atdot dot net

----------------------------------------
Feature #8987: map/collect extension which handles arguments
https://bugs.ruby-lang.org/issues/8987#change-44850

* Author: So Wieso
* Status: Open
* Priority: Normal
* Assignee:=20
* Category: core
* Target version: current: 2.2.0
----------------------------------------
Please consider extending map/collect by allowing additional arguments to b=
e passed to proc, like:
A: [1,2,3,4].map :+, 4
and/or
B: [1,2,3,4].map 4, &:+

=3D> [5, 6, 7, 8]

Variant A is probably more readable. Variant B is more versatile (allows ar=
bitrary arguments to be passed to block).


---Files--------------------------------
mappi.rb (410 Bytes)


--=20
http://bugs.ruby-lang.org/

In This Thread