Translation for [ruby-dev:44602]

Revision 1

2011-10-18 11:43:47 +0900
! Hello,
  
! # I created a ticket on the 2.0 tracker , but no mail is delivered yet.
! # Please see the ticket for the patch.
  # http://redmine.ruby-lang.org/issues/5454
  
  
  I implemented keyword arguments.
  
   $ cat t.rb
   def foo(str: "foo", num: 424242)
     p [str, num]
   end
   foo(str: "bar")
  
   $ ./ruby t.rb
   ["bar", 424242]
  
! I have not yet considered all the behavior of this, but how about commit it to trunk first and have more discussion, because it is almost definite that 2.0 have keyword arguments.
+ 
+ 
  
! I confirmed at least 'make check' passes on my environment (though I have not written tests for keyword arguments). No conflicts on parser.
! I'm a little concerned for it slows down some of the benchmarks (like vm1_rescue), but the speed is not decreased on average.
+ 
+ 
  
  
! There are following issues and features not implemented.
  
!  - Do we need a way to receive all the keyword arguments?
  
     def foo(str: "foo", num: 424242, **h)
       p h
     end
     foo(str: "bar", check: true)  #=> { :check => true }
  
!  - When nil is passed explicitly, should the value be nil? 
  
     def foo(str: "foo")
       p str
     end
!    foo(str: nil) #=> nil ? (not implemented yet, "foo" is assigned now)
  
!  - When unknown keyword is specified and there is no **rest, 
!    should we raise exception or warning?
  
     def foo(str: "foo", num: 424242)
     end
     foo(check: true) #=> ArgumentError?
  
!  - Should we accept an object behaves like Hash as keyword arguments?
!    (Current implementation only checks T_HASH for speed)
  
!  - Is order of arguments ok?
  
     def foo(
       a, b, c,     # mandatory arguments
       opt = 1,     # optional arguments
       *rest,       # rest argument
       x, y, z,     # post mandatory arguments
       k1: 1, k2:2, # keyword arguments
       **kh,        # keyword rest argument
       &blk         # block argument
     )
  
!  - etc. etc.
  
  --
  Yusuke Endoh <mame / tsg.ne.jp>
  

Revision 2

2011-10-18 11:47:06 +0900
! Hi,
  
! # I filed a ticket at redmine.ruby-lang.org but it seems that ML
! # integration does not work. See the patch described above at 
  # http://redmine.ruby-lang.org/issues/5454
  
  
  I implemented keyword arguments.
  
   $ cat t.rb
   def foo(str: "foo", num: 424242)
     p [str, num]
   end
   foo(str: "bar")
  
   $ ./ruby t.rb
   ["bar", 424242]
  
! Details aside, maybe we should apply the patch so that we can think
+ about it because it looks almost certainly that 2.0 has keyword
+ arguments.
  
! It passes 'make check' on my environment though I've not yet added
! tests for keyword arguments.  There's no conflicts in parser.
+ On the whole, there seems to be no perf drop according to existing
+ benchmark scripts though there's a few result we might need to care.
  
  
! ToDos and pending issues:
  
!  - Do we need a way to get rest keyword arguments?
  
     def foo(str: "foo", num: 424242, **h)
       p h
     end
     foo(str: "bar", check: true)  #=> { :check => true }
  
!  - Should it be nil when nil is given as an argument?
  
     def foo(str: "foo")
       p str
     end
!    foo(str: nil) #=> nil ? # The patch gives "foo" at this moment.
  
!  - Raise an exception or give a warning if unknown keyword given,
!    without 'rest' keyword argument handler? (**h)
  
     def foo(str: "foo", num: 424242)
     end
     foo(check: true) #=> ArgumentError?
  
!  - Do we treat a Hash-like object as keyword arguments?
!    (The patch only checks T_HASH from performance consideration)
  
!  - Is the argument order OK? (see below)
  
     def foo(
       a, b, c,     # mandatory arguments
       opt = 1,     # optional arguments
       *rest,       # rest argument
       x, y, z,     # post mandatory arguments
       k1: 1, k2:2, # keyword arguments
       **kh,        # keyword rest argument
       &blk         # block argument
     )
  
!  - Anything else
  
  --
  Yusuke Endoh <mame / tsg.ne.jp>
  

Revision 2

2011-10-18 11:47:06 +0900
  Hello,
  
! # I filed a ticket at redmine.ruby-lang.org but it seems that ML
! # integration does not work. See the patch described above at 
  # http://redmine.ruby-lang.org/issues/5454
  
  
  I implemented keyword arguments.
  
   $ cat t.rb
   def foo(str: "foo", num: 424242)
     p [str, num]
   end
   foo(str: "bar")
  
   $ ./ruby t.rb
   ["bar", 424242]
  
! Details aside, maybe we should apply the patch so that we can think
- about it because it looks almost certainly that 2.0 has keyword
- arguments.
  
! It passes 'make check' on my environment though I've not yet added
! tests for keyword arguments.  There's no conflicts in parser.
- On the whole, there seems to be no perf drop according to existing
- benchmark scripts though there's a few result we might need to care.
  
  
! ToDos and pending issues:
  
!  - Do we need a way to get rest keyword arguments?
  
     def foo(str: "foo", num: 424242, **h)
       p h
     end
     foo(str: "bar", check: true)  #=> { :check => true }
  
!  - Should it be nil when nil is given as an argument?
  
     def foo(str: "foo")
       p str
     end
!    foo(str: nil) #=> nil ? # The patch gives "foo" at this moment.
  
!  - Raise an exception or give a warning if unknown keyword given,
!    without 'rest' keyword argument handler? (**h)
  
     def foo(str: "foo", num: 424242)
     end
     foo(check: true) #=> ArgumentError?
  
!  - Do we treat a Hash-like object as keyword arguments?
!    (The patch only checks T_HASH from performance consideration)
  
!  - Is the argument order OK? (see below)
  
     def foo(
       a, b, c,     # mandatory arguments
       opt = 1,     # optional arguments
       *rest,       # rest argument
       x, y, z,     # post mandatory arguments
       k1: 1, k2:2, # keyword arguments
       **kh,        # keyword rest argument
       &blk         # block argument
     )
  
!  - Anything else
  
  --
  Yusuke Endoh <mame / tsg.ne.jp>
+ 

Revision 3

2011-10-18 11:58:26 +0900
  Hello,
  
! # I created a ticket on the 2.0 tracker , but no mail is delivered yet.
! # Please see the ticket for the patch.
  # http://redmine.ruby-lang.org/issues/5454
  
  
  I implemented keyword arguments.
  
   $ cat t.rb
   def foo(str: "foo", num: 424242)
     p [str, num]
   end
   foo(str: "bar")
  
   $ ./ruby t.rb
   ["bar", 424242]
  
! I have not yet considered all the behavior of this, but how about commit it to trunk first and have more discussion, because it is almost definite that 2.0 have keyword arguments.
- 
- 
  
! I confirmed at least 'make check' passes on my environment (though I have not written tests for keyword arguments). No conflicts on parser.
! I'm a little concerned for it slows down some of the benchmarks (like vm1_rescue), but the speed is not decreased on average.
- 
- 
  
  
! There are following issues and features not implemented.
  
!  - Do we need a way to receive all the keyword arguments?
  
     def foo(str: "foo", num: 424242, **h)
       p h
     end
     foo(str: "bar", check: true)  #=> { :check => true }
  
!  - When nil is passed explicitly, should the value be nil? 
  
     def foo(str: "foo")
       p str
     end
!    foo(str: nil) #=> nil ? (not implemented yet, "foo" is assigned now)
  
!  - When unknown keyword is specified and there is no **rest, 
!    should we raise exception or warning?
  
     def foo(str: "foo", num: 424242)
     end
     foo(check: true) #=> ArgumentError?
  
!  - Should we accept an object behaves like Hash as keyword arguments?
!    (Current implementation only checks T_HASH for speed)
  
!  - Is order of arguments ok?
  
     def foo(
       a, b, c,     # mandatory arguments
       opt = 1,     # optional arguments
       *rest,       # rest argument
       x, y, z,     # post mandatory arguments
       k1: 1, k2:2, # keyword arguments
       **kh,        # keyword rest argument
       &blk         # block argument
     )
  
!  - etc. etc.
  
  --
  Yusuke Endoh <mame / tsg.ne.jp>
+ 

Revision 3

2011-10-18 11:58:26 +0900
  Hello,
  
  # I filed a ticket at redmine.ruby-lang.org but it seems that ML
  # integration does not work. See the patch described above at 
  # http://redmine.ruby-lang.org/issues/5454
  
  
  I implemented keyword arguments.
  
   $ cat t.rb
   def foo(str: "foo", num: 424242)
     p [str, num]
   end
   foo(str: "bar")
  
   $ ./ruby t.rb
   ["bar", 424242]
  
  Details aside, maybe we should apply the patch so that we can think
  about it because it looks almost certainly that 2.0 has keyword
  arguments.
  
  It passes 'make check' on my environment though I've not yet added
  tests for keyword arguments.  There's no conflicts in parser.
  On the whole, there seems to be no perf drop according to existing
! benchmark scripts though there's a few result we might need to care (eg. vm1_rescue).
  
  
  ToDos and pending issues:
  
   - Do we need a way to get rest keyword arguments?
  
     def foo(str: "foo", num: 424242, **h)
       p h
     end
     foo(str: "bar", check: true)  #=> { :check => true }
  
   - Should it be nil when nil is given as an argument?
  
     def foo(str: "foo")
       p str
     end
     foo(str: nil) #=> nil ? # The patch gives "foo" at this moment.
  
   - Raise an exception or give a warning if unknown keyword given,
     without 'rest' keyword argument handler? (**h)
  
     def foo(str: "foo", num: 424242)
     end
     foo(check: true) #=> ArgumentError?
  
   - Do we treat a Hash-like object as keyword arguments?
     (The patch only checks T_HASH from performance consideration)
  
   - Is the argument order OK? (see below)
  
     def foo(
       a, b, c,     # mandatory arguments
       opt = 1,     # optional arguments
       *rest,       # rest argument
       x, y, z,     # post mandatory arguments
       k1: 1, k2:2, # keyword arguments
       **kh,        # keyword rest argument
       &blk         # block argument
     )
  
   - Anything else
  
  --
  Yusuke Endoh <mame / tsg.ne.jp>

Revision 4

2011-10-18 12:01:03 +0900
  Hello,
  
  # I filed a ticket at redmine.ruby-lang.org but it seems that ML
  # integration does not work. See the patch described above at 
  # http://redmine.ruby-lang.org/issues/5454
  
  
  I implemented keyword arguments.
  
   $ cat t.rb
   def foo(str: "foo", num: 424242)
     p [str, num]
   end
   foo(str: "bar")
  
   $ ./ruby t.rb
   ["bar", 424242]
  
  Details aside, maybe we should apply the patch so that we can think
  about it because it looks almost certainly that 2.0 has keyword
  arguments.
  
  It passes 'make check' on my environment though I've not yet added
  tests for keyword arguments.  There's no conflicts in parser.
  On the whole, there seems to be no perf drop according to existing
! benchmark scripts though there's a few result we might need to care.
  
  
  ToDos and pending issues:
  
   - Do we need a way to get rest keyword arguments?
  
     def foo(str: "foo", num: 424242, **h)
       p h
     end
     foo(str: "bar", check: true)  #=> { :check => true }
  
   - Should it be nil when nil is given as an argument?
  
     def foo(str: "foo")
       p str
     end
     foo(str: nil) #=> nil ? # The patch gives "foo" at this moment.
  
   - Raise an exception or give a warning if unknown keyword given,
     without 'rest' keyword argument handler? (**h)
  
     def foo(str: "foo", num: 424242)
     end
     foo(check: true) #=> ArgumentError?
  
   - Do we treat a Hash-like object as keyword arguments?
     (The patch only checks T_HASH from performance consideration)
  
   - Is the argument order OK? (see below)
  
     def foo(
       a, b, c,     # mandatory arguments
       opt = 1,     # optional arguments
       *rest,       # rest argument
       x, y, z,     # post mandatory arguments
       k1: 1, k2:2, # keyword arguments
       **kh,        # keyword rest argument
       &blk         # block argument
     )
  
   - Anything else
  
  --
  Yusuke Endoh <mame / tsg.ne.jp>

Revision 4

2011-10-18 12:01:03 +0900
  Hello,
  
  # I filed a ticket at redmine.ruby-lang.org but it seems that ML
! # integration does not work. See the patch described below at 
  # http://redmine.ruby-lang.org/issues/5454
  
  
  I implemented keyword arguments.
  
   $ cat t.rb
   def foo(str: "foo", num: 424242)
     p [str, num]
   end
   foo(str: "bar")
  
   $ ./ruby t.rb
   ["bar", 424242]
  
  Details aside, maybe we should apply the patch so that we can think
  about it because it looks almost certainly that 2.0 has keyword
  arguments.
  
  It passes 'make check' on my environment though I've not yet added
  tests for keyword arguments.  There's no conflicts in parser.
  On the whole, there seems to be no perf drop according to existing
  benchmark scripts though there's a few result we might need to care (eg. vm1_rescue).
  
  
  ToDos and pending issues:
  
   - Do we need a way to get rest keyword arguments?
  
     def foo(str: "foo", num: 424242, **h)
       p h
     end
     foo(str: "bar", check: true)  #=> { :check => true }
  
   - Should it be nil when nil is given as an argument?
  
     def foo(str: "foo")
       p str
     end
     foo(str: nil) #=> nil ? # The patch gives "foo" at this moment.
  
   - Raise an exception or give a warning if unknown keyword given,
     without 'rest' keyword argument handler? (**h)
  
     def foo(str: "foo", num: 424242)
     end
     foo(check: true) #=> ArgumentError?
  
   - Do we treat a Hash-like object as keyword arguments?
     (The patch only checks T_HASH from performance consideration)
  
   - Is the argument order OK? (see below)
  
     def foo(
       a, b, c,     # mandatory arguments
       opt = 1,     # optional arguments
       *rest,       # rest argument
       x, y, z,     # post mandatory arguments
       k1: 1, k2:2, # keyword arguments
       **kh,        # keyword rest argument
       &blk         # block argument
     )
  
   - Anything else
  
  --
  Yusuke Endoh <mame / tsg.ne.jp>

Revision 5

2011-10-18 12:01:27 +0900
  Hello,
  
  # I filed a ticket at redmine.ruby-lang.org but it seems that ML
! # integration does not work. See the patch described above at 
  # http://redmine.ruby-lang.org/issues/5454
  
  
  I implemented keyword arguments.
  
   $ cat t.rb
   def foo(str: "foo", num: 424242)
     p [str, num]
   end
   foo(str: "bar")
  
   $ ./ruby t.rb
   ["bar", 424242]
  
  Details aside, maybe we should apply the patch so that we can think
  about it because it looks almost certainly that 2.0 has keyword
  arguments.
  
  It passes 'make check' on my environment though I've not yet added
  tests for keyword arguments.  There's no conflicts in parser.
  On the whole, there seems to be no perf drop according to existing
  benchmark scripts though there's a few result we might need to care (eg. vm1_rescue).
  
  
  ToDos and pending issues:
  
   - Do we need a way to get rest keyword arguments?
  
     def foo(str: "foo", num: 424242, **h)
       p h
     end
     foo(str: "bar", check: true)  #=> { :check => true }
  
   - Should it be nil when nil is given as an argument?
  
     def foo(str: "foo")
       p str
     end
     foo(str: nil) #=> nil ? # The patch gives "foo" at this moment.
  
   - Raise an exception or give a warning if unknown keyword given,
     without 'rest' keyword argument handler? (**h)
  
     def foo(str: "foo", num: 424242)
     end
     foo(check: true) #=> ArgumentError?
  
   - Do we treat a Hash-like object as keyword arguments?
     (The patch only checks T_HASH from performance consideration)
  
   - Is the argument order OK? (see below)
  
     def foo(
       a, b, c,     # mandatory arguments
       opt = 1,     # optional arguments
       *rest,       # rest argument
       x, y, z,     # post mandatory arguments
       k1: 1, k2:2, # keyword arguments
       **kh,        # keyword rest argument
       &blk         # block argument
     )
  
   - Anything else
  
  --
  Yusuke Endoh <mame / tsg.ne.jp>

Revision 5

2011-10-18 12:01:27 +0900
  Hello,
  
  # I filed a ticket at redmine.ruby-lang.org but it seems that ML
  # integration does not work. See the patch described below at 
  # http://redmine.ruby-lang.org/issues/5454
  
  
  I implemented keyword arguments.
  
   $ cat t.rb
   def foo(str: "foo", num: 424242)
     p [str, num]
   end
   foo(str: "bar")
  
   $ ./ruby t.rb
   ["bar", 424242]
  
! Details aside, maybe we should apply the patch to trunk so that we can think
  about it because it looks almost certainly that 2.0 has keyword
  arguments.
  
  It passes 'make check' on my environment though I've not yet added
  tests for keyword arguments.  There's no conflicts in parser.
  On the whole, there seems to be no perf drop according to existing
  benchmark scripts though there's a few result we might need to care (eg. vm1_rescue).
  
  
  ToDos and pending issues:
  
   - Do we need a way to get rest keyword arguments?
  
     def foo(str: "foo", num: 424242, **h)
       p h
     end
     foo(str: "bar", check: true)  #=> { :check => true }
  
   - Should it be nil when nil is given as an argument?
  
     def foo(str: "foo")
       p str
     end
     foo(str: nil) #=> nil ? # The patch gives "foo" at this moment.
  
   - Raise an exception or give a warning if unknown keyword given,
     without 'rest' keyword argument handler? (**h)
  
     def foo(str: "foo", num: 424242)
     end
     foo(check: true) #=> ArgumentError?
  
   - Do we treat a Hash-like object as keyword arguments?
     (The patch only checks T_HASH from performance consideration)
  
   - Is the argument order OK? (see below)
  
     def foo(
       a, b, c,     # mandatory arguments
       opt = 1,     # optional arguments
       *rest,       # rest argument
       x, y, z,     # post mandatory arguments
       k1: 1, k2:2, # keyword arguments
       **kh,        # keyword rest argument
       &blk         # block argument
     )
  
   - Anything else
  
  --
  Yusuke Endoh <mame / tsg.ne.jp>

Revision 6

2011-10-18 15:52:06 +0900
  Hello,
  
  # I filed a ticket at redmine.ruby-lang.org but it seems that ML
  # integration does not work. See the patch described below at 
  # http://redmine.ruby-lang.org/issues/5454
  
  
  I implemented keyword arguments.
  
   $ cat t.rb
   def foo(str: "foo", num: 424242)
     p [str, num]
   end
   foo(str: "bar")
  
   $ ./ruby t.rb
   ["bar", 424242]
  
! Details aside, maybe we should apply the patch so that we can think
  about it because it looks almost certainly that 2.0 has keyword
  arguments.
  
  It passes 'make check' on my environment though I've not yet added
  tests for keyword arguments.  There's no conflicts in parser.
  On the whole, there seems to be no perf drop according to existing
  benchmark scripts though there's a few result we might need to care (eg. vm1_rescue).
  
  
  ToDos and pending issues:
  
   - Do we need a way to get rest keyword arguments?
  
     def foo(str: "foo", num: 424242, **h)
       p h
     end
     foo(str: "bar", check: true)  #=> { :check => true }
  
   - Should it be nil when nil is given as an argument?
  
     def foo(str: "foo")
       p str
     end
     foo(str: nil) #=> nil ? # The patch gives "foo" at this moment.
  
   - Raise an exception or give a warning if unknown keyword given,
     without 'rest' keyword argument handler? (**h)
  
     def foo(str: "foo", num: 424242)
     end
     foo(check: true) #=> ArgumentError?
  
   - Do we treat a Hash-like object as keyword arguments?
     (The patch only checks T_HASH from performance consideration)
  
   - Is the argument order OK? (see below)
  
     def foo(
       a, b, c,     # mandatory arguments
       opt = 1,     # optional arguments
       *rest,       # rest argument
       x, y, z,     # post mandatory arguments
       k1: 1, k2:2, # keyword arguments
       **kh,        # keyword rest argument
       &blk         # block argument
     )
  
   - Anything else
  
  --
  Yusuke Endoh <mame / tsg.ne.jp>

Revision 6

2011-10-18 15:52:06 +0900
  Hello,
  
  # I filed a ticket at redmine.ruby-lang.org but it seems that ML
  # integration does not work. See the patch described below at 
  # http://redmine.ruby-lang.org/issues/5454
  
  
  I implemented keyword arguments.
  
   $ cat t.rb
   def foo(str: "foo", num: 424242)
     p [str, num]
   end
   foo(str: "bar")
  
   $ ./ruby t.rb
   ["bar", 424242]
  
  Details aside, maybe we should apply the patch to trunk so that we can think
  about it because it looks almost certainly that 2.0 has keyword
  arguments.
  
  It passes 'make check' on my environment though I've not yet added
  tests for keyword arguments.  There's no conflicts in parser.
  On the whole, there seems to be no perf drop according to existing
  benchmark scripts though there's a few result we might need to care (eg. vm1_rescue).
  
  
  ToDos and pending issues:
  
   - Do we need a way to get rest keyword arguments?
  
     def foo(str: "foo", num: 424242, **h)
       p h
     end
     foo(str: "bar", check: true)  #=> { :check => true }
  
   - Should it be nil when nil is given as an argument?
  
     def foo(str: "foo")
       p str
     end
     foo(str: nil) #=> nil ? # The patch gives "foo" at this moment.
  
   - Raise an exception or give a warning if unknown keyword given,
     without 'rest' keyword argument handler? (**h)
  
     def foo(str: "foo", num: 424242)
     end
     foo(check: true) #=> ArgumentError?
  
   - Do we treat a Hash-like object as keyword arguments?
     (The patch only checks T_HASH from performance consideration)
  
   - Is the argument order OK? (see below)
  
     def foo(
       a, b, c,     # mandatory arguments
       opt = 1,     # optional arguments
       *rest,       # rest argument
       x, y, z,     # post mandatory arguments
       k1: 1, k2:2, # keyword arguments
       **kh,        # keyword rest argument
       &blk         # block argument
     )
  
!  - Everything else
  
  --
  Yusuke Endoh <mame / tsg.ne.jp>

Revision 7

2011-10-19 12:35:35 +0900
  Hello,
  
  # I filed a ticket at redmine.ruby-lang.org but it seems that ML
  # integration does not work. See the patch described below at 
  # http://redmine.ruby-lang.org/issues/5454
  
  
  I implemented keyword arguments.
  
   $ cat t.rb
   def foo(str: "foo", num: 424242)
     p [str, num]
   end
   foo(str: "bar")
  
   $ ./ruby t.rb
   ["bar", 424242]
  
  Details aside, maybe we should apply the patch to trunk so that we can think
  about it because it looks almost certainly that 2.0 has keyword
  arguments.
  
  It passes 'make check' on my environment though I've not yet added
  tests for keyword arguments.  There's no conflicts in parser.
  On the whole, there seems to be no perf drop according to existing
  benchmark scripts though there's a few result we might need to care (eg. vm1_rescue).
  
  
  ToDos and pending issues:
  
   - Do we need a way to get rest keyword arguments?
  
     def foo(str: "foo", num: 424242, **h)
       p h
     end
     foo(str: "bar", check: true)  #=> { :check => true }
  
   - Should it be nil when nil is given as an argument?
  
     def foo(str: "foo")
       p str
     end
     foo(str: nil) #=> nil ? # The patch gives "foo" at this moment.
  
   - Raise an exception or give a warning if unknown keyword given,
     without 'rest' keyword argument handler? (**h)
  
     def foo(str: "foo", num: 424242)
     end
     foo(check: true) #=> ArgumentError?
  
   - Do we treat a Hash-like object as keyword arguments?
     (The patch only checks T_HASH from performance consideration)
  
   - Is the argument order OK? (see below)
  
     def foo(
       a, b, c,     # mandatory arguments
       opt = 1,     # optional arguments
       *rest,       # rest argument
       x, y, z,     # post mandatory arguments
       k1: 1, k2:2, # keyword arguments
       **kh,        # keyword rest argument
       &blk         # block argument
     )
  
!  - Anything else
  
  --
  Yusuke Endoh <mame / tsg.ne.jp>

back