matz (Yukihiro Matsumoto) wrote: > I dislike #into because it may or may not put something into the argument. > ... I would appreciate if you could look at #6687. but #each_with is OK for me :-)merborne (kyo endo)
Eregon (Benoit Daloze) wrote: > I think the sequence `~<<-EOS` becomes very cryptic, and this should be supported in the parser (or at least be integrated into the language). I actually prefer `<<-EOS.undent` as the intention is clearer...merborne (kyo endo)
=begin Let me propose a new method (({String#~})) for a here document. 次のような実装の(({String#~}))を提案します。 class String def ~ margin = scan(/^ +/).map(&:size).min gsub(/^ {#{margin}}/, '') end en...merborne (kyo endo)
alexeymuranov (Alexey Muranov) wrote: > merborne (kyo endo) wrote: > ... #sequence returns an enumerator object. It means it can be evaluated later. class Enumerator def lazy(&blk) Enumerator.new do |y| ...merborne (kyo endo)
nobu (Nobuyoshi Nakada) wrote: > I don't think "with" is nice as a method name. > ... It iterate(or enumerate) with the argument. The receiver, by itself tells it, I think. I think #each tells nothing. it suggests the returning value ...merborne (kyo endo)
alexeymuranov (Alexey Muranov) wrote: > However, the original proposal looks to me rather restrictive and not very efficient. Between > ... how about this? b = 1 0.sequence { |a| a, b = b, a + b; a}.take(10) merborne (kyo endo)
=begin It is obvious that many rubyists have troubled with Enumerable#inject when they use it with a hash. Feature #5662: inject-accumulate, or Haskell's mapAccum* - ruby-trunk - Ruby Issue Tracking System http://bugs.ruby-lang.o...merborne (kyo endo)
alexeymuranov (Alexey Muranov) wrote: > fibonacci = 0.recurrence(1) { |a, b| a + b } I disagree this. because I can't image fibonacci sequence from this code. and two block variables, which are both used as init data comes from diff...merborne (kyo endo)