Hello: 1.9.3p194 :014 > "".blank? => true 1.9.3p194 :015 > ["", ""].blank? => false Proposal: the second line should also produce true. Thoughts? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/Rbgmrz1cT7AJ. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
The array has objects on it, so it isn''t blank. - Maurício Linhares http://techbot.me/ - http://twitter.com/#!/mauriciojr On Monday, July 9, 2012 at 11:15 AM, Michael Boutros wrote:> Hello: > > 1.9.3p194 :014 > "".blank? > => true > 1.9.3p194 :015 > ["", ""].blank? > => false > > > Proposal: the second line should also produce true. > > Thoughts? > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. > To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/Rbgmrz1cT7AJ. > To post to this group, send email to rubyonrails-core@googlegroups.com (mailto:rubyonrails-core@googlegroups.com). > To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com (mailto:rubyonrails-core+unsubscribe@googlegroups.com). > For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Michael, That array isn''t blank, empty strings aren''t the same as nils. I think changing that behavior would be confusing. If you don''t want to count those elements, it''s probably best to filter the array for non-blank strings. -Geoff -- Geoff Harcourt On Monday, July 9, 2012 at 10:15 AM, Michael Boutros wrote:> Hello: > > 1.9.3p194 :014 > "".blank? > => true > 1.9.3p194 :015 > ["", ""].blank? > => false > > > Proposal: the second line should also produce true. > > Thoughts? > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. > To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/Rbgmrz1cT7AJ. > To post to this group, send email to rubyonrails-core@googlegroups.com (mailto:rubyonrails-core@googlegroups.com). > To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com (mailto:rubyonrails-core+unsubscribe@googlegroups.com). > For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
On Jul 9, 2012, at 10:15 AM, Michael Boutros wrote:> Hello: > > 1.9.3p194 :014 > "".blank? > => true > 1.9.3p194 :015 > ["", ""].blank? > => false > > Proposal: the second line should also produce true. > > Thoughts?If you really want to check for "are all the values in this array blank", try: some_array.all?(&:blank?) --Matt Jones -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Geoff, But from the Rails documentation: An object is blank if it’s false, empty, or a whitespace string. For example, “”, “ ”, nil, [], and {} are all blank. That''s why I think an array full of false, empty, or whitespace strings should be empty. - Michael On Monday, July 9, 2012 10:18:04 AM UTC-4, Geoff Harcourt wrote:> > Michael, > > That array isn''t blank, empty strings aren''t the same as nils. I think > changing that behavior would be confusing. If you don''t want to count those > elements, it''s probably best to filter the array for non-blank strings. > > -Geoff > > > -- > Geoff Harcourt > > On Monday, July 9, 2012 at 10:15 AM, Michael Boutros wrote: > > Hello: > > 1.9.3p194 :014 > "".blank? > => true > 1.9.3p194 :015 > ["", ""].blank? > => false > > Proposal: the second line should also produce true. > > Thoughts? > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/rubyonrails-core/-/Rbgmrz1cT7AJ. > To post to this group, send email to rubyonrails-core@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-core+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/KDc5odVcWngJ. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Empty means that it has no elements. -- Oscar Del Ben Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Monday, July 9, 2012 at 7:23 AM, Michael Boutros wrote:> Geoff, > > But from the Rails documentation: An object is blank if it’s false, empty, or a whitespace string. For example, “”, “ ”, nil, [], and {} are all blank. That''s why I think an array full of false, empty, or whitespace strings should be empty. > > - Michael > > On Monday, July 9, 2012 10:18:04 AM UTC-4, Geoff Harcourt wrote: > > Michael, > > > > That array isn''t blank, empty strings aren''t the same as nils. I think changing that behavior would be confusing. If you don''t want to count those elements, it''s probably best to filter the array for non-blank strings. > > > > -Geoff > > > > > > -- > > Geoff Harcourt > > > > > > On Monday, July 9, 2012 at 10:15 AM, Michael Boutros wrote: > > > > > Hello: > > > > > > 1.9.3p194 :014 > "".blank? > > > => true > > > 1.9.3p194 :015 > ["", ""].blank? > > > => false > > > > > > > > > Proposal: the second line should also produce true. > > > > > > Thoughts? > > > > > > -- > > > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. > > > To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/Rbgmrz1cT7AJ. > > > To post to this group, send email to rubyonrails-core@googlegroups.com (mailto:rubyonrails-core@googlegroups.com). > > > To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com (mailto:rubyonrails-core+unsubscribe@googlegroups.com). > > > For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en. > > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. > To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/KDc5odVcWngJ. > To post to this group, send email to rubyonrails-core@googlegroups.com (mailto:rubyonrails-core@googlegroups.com). > To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com (mailto:rubyonrails-core+unsubscribe@googlegroups.com). > For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
On Mon, Jul 9, 2012 at 4:23 PM, Michael Boutros <michael.boutros@gmail.com>wrote: Geoff,> > But from the Rails documentation: An object is blank if it’s false, > empty, or a whitespace string. For example, “”, “ ”, nil, [], and {} are > all blank. That''s why I think an array full of false, empty, or whitespace > strings should be empty. >Why? [""] is not an empty array. Maybe this description may help? http://guides.rubyonrails.org/active_support_core_extensions.html#blank-and-present -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
> An object is blank if it’s false, empty, or a whitespace string. Forexample, “”, “ ”, nil, [], and {} are > all blank. That''s why I think an array full of false, empty, or whitespace strings should be empty. But that''s not mathematically accurate. "".size #=> 0 [""].size #=> 1 [nil].size #=> 1 An array with a single item is no longer empty, even if the item itself is empty. -- Jarrett Meyer Email: jarrettmeyer@gmail.com Web: JarrettMeyer.com <http://jarrettmeyer.com> Twitter: @jarrettmeyer <http://twitter.com/jarrettmeyer> On Mon, Jul 9, 2012 at 10:23 AM, Michael Boutros <michael.boutros@gmail.com>wrote:> Geoff, > > But from the Rails documentation: An object is blank if it’s false, > empty, or a whitespace string. For example, “”, “ ”, nil, [], and {} are > all blank. That''s why I think an array full of false, empty, or whitespace > strings should be empty. > > - Michael > > On Monday, July 9, 2012 10:18:04 AM UTC-4, Geoff Harcourt wrote: >> >> Michael, >> >> That array isn''t blank, empty strings aren''t the same as nils. I think >> changing that behavior would be confusing. If you don''t want to count those >> elements, it''s probably best to filter the array for non-blank strings. >> >> -Geoff >> >> >> -- >> Geoff Harcourt >> >> On Monday, July 9, 2012 at 10:15 AM, Michael Boutros wrote: >> >> Hello: >> >> 1.9.3p194 :014 > "".blank? >> => true >> 1.9.3p194 :015 > ["", ""].blank? >> => false >> >> Proposal: the second line should also produce true. >> >> Thoughts? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ruby on Rails: Core" group. >> To view this discussion on the web visit https://groups.google.com/d/** >> msg/rubyonrails-core/-/**Rbgmrz1cT7AJ<https://groups.google.com/d/msg/rubyonrails-core/-/Rbgmrz1cT7AJ> >> . >> To post to this group, send email to rubyonrails-core@googlegroups.**com<rubyonrails-core@googlegroups.com> >> . >> To unsubscribe from this group, send email to >> rubyonrails-core+unsubscribe@**googlegroups.com<rubyonrails-core+unsubscribe@googlegroups.com> >> . >> For more options, visit this group at http://groups.google.com/** >> group/rubyonrails-core?hl=en<http://groups.google.com/group/rubyonrails-core?hl=en> >> . >> >> >> -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/rubyonrails-core/-/KDc5odVcWngJ. > > To post to this group, send email to rubyonrails-core@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-core+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Sorry, where I last wrote "empty" I meant to write "blank," ie: That''s why I think an array full of false, empty, or whitespace strings should be _blank_. Rails defines blank as a convenience method instead of checking if something is nil and then if it''s empty or not. I think extending that convenience to arrays makes sense. To clarify: ["", ""].empty? # false ["", ""].blank? # true - Michael On Monday, July 9, 2012 10:15:04 AM UTC-4, Michael Boutros wrote:> > Hello: > > 1.9.3p194 :014 > "".blank? > => true > 1.9.3p194 :015 > ["", ""].blank? > => false > > Proposal: the second line should also produce true. > > Thoughts? >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/6QBZ6XsNQU0J. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
https://gist.github.com/3076887 On Monday, July 9, 2012 10:15:04 AM UTC-4, Michael Boutros wrote:> > Hello: > > 1.9.3p194 :014 > "".blank? > => true > 1.9.3p194 :015 > ["", ""].blank? > => false > > Proposal: the second line should also produce true. > > Thoughts? >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/FsRwutUwsyEJ. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Ah, OK. So the definition of blank? is clear but you are proposing to change it for Arrays right? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Blank is a convenience method for not checking the type of object. If you want to do that you should use: array.all?(&:blank) -- Oscar Del Ben Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Monday, July 9, 2012 at 7:30 AM, Michael Boutros wrote:> Sorry, where I last wrote "empty" I meant to write "blank," ie: That''s why I think an array full of false, empty, or whitespace strings should be _blank_. Rails defines blank as a convenience method instead of checking if something is nil and then if it''s empty or not. I think extending that convenience to arrays makes sense. To clarify: > > ["", ""].empty? # false > ["", ""].blank? # true > > - Michael > > On Monday, July 9, 2012 10:15:04 AM UTC-4, Michael Boutros wrote: > > Hello: > > > > 1.9.3p194 :014 > "".blank? > > => true > > 1.9.3p194 :015 > ["", ""].blank? > > => false > > > > > > Proposal: the second line should also produce true. > > > > Thoughts? > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. > To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/6QBZ6XsNQU0J. > To post to this group, send email to rubyonrails-core@googlegroups.com (mailto:rubyonrails-core@googlegroups.com). > To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com (mailto:rubyonrails-core+unsubscribe@googlegroups.com). > For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Yes. On Monday, July 9, 2012 10:31:30 AM UTC-4, Xavier Noria wrote:> > Ah, OK. So the definition of blank? is clear but you are proposing to > change it for Arrays right?-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/st6ddnnWkPMJ. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
That''s very unlikely to happen. Pretty much all Rails app rely on this behavior. -- Oscar Del Ben Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Monday, July 9, 2012 at 7:38 AM, Michael Boutros wrote:> Yes. > > On Monday, July 9, 2012 10:31:30 AM UTC-4, Xavier Noria wrote: > > Ah, OK. So the definition of blank? is clear but you are proposing to change it for Arrays right? > > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. > To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/st6ddnnWkPMJ. > To post to this group, send email to rubyonrails-core@googlegroups.com (mailto:rubyonrails-core@googlegroups.com). > To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com (mailto:rubyonrails-core+unsubscribe@googlegroups.com). > For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
On Mon, Jul 9, 2012 at 4:38 PM, Michael Boutros <michael.boutros@gmail.com>wrote: Yes. Your implementation makes sense. I mean, I believe that if blank? was defined on enumerables as all?(&:blank?) from the very first day, one could have accepted that definition just fine. But the current definition also makes sense to me. Since this is a fundamental predicate in Active Support that has had this semantic since forever, this modification would be backwards incompatible, and the current definition is also just fine in my opinion, I think we should keep it the way it is. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Yes, we need #blank? to be extra expensive because beginners needn''t control what gets injected in their Arrays. Maybe `{"" => ""}.blank?` should be true, too? Here you go: class Array def super_blank? # Go! end end Scott On Mon, Jul 9, 2012 at 7:15 AM, Michael Boutros <michael.boutros@gmail.com>wrote:> Hello: > > 1.9.3p194 :014 > "".blank? > => true > 1.9.3p194 :015 > ["", ""].blank? > => false > > Proposal: the second line should also produce true. > > Thoughts? > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/rubyonrails-core/-/Rbgmrz1cT7AJ. > To post to this group, send email to rubyonrails-core@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-core+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Lock down your data at the gates and this is not a problem. Making #blank? incredibly slow is silly. On Jul 9, 7:15 am, Michael Boutros <michael.bout...@gmail.com> wrote:> Hello: > > 1.9.3p194 :014 > "".blank? > => true > 1.9.3p194 :015 > ["", ""].blank? > => false > > Proposal: the second line should also produce true. > > Thoughts?-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Do you think anyone currently uses #blank? on enumerables in its current state? It doesn''t make sense the way it is right now. Imagine a piece of paper with a list of 10 blank lines. Wouldn''t you call that a blank list? On Monday, July 9, 2012 10:50:34 AM UTC-4, Xavier Noria wrote:> > On Mon, Jul 9, 2012 at 4:38 PM, Michael Boutros <michael.boutros@gmail.com > > wrote: > > Yes. > > > Your implementation makes sense. I mean, I believe that if blank? was > defined on enumerables as all?(&:blank?) from the very first day, one could > have accepted that definition just fine. > > But the current definition also makes sense to me. > > Since this is a fundamental predicate in Active Support that has had this > semantic since forever, this modification would be backwards incompatible, > and the current definition is also just fine in my opinion, I think we > should keep it the way it is. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/WL4-tEq6TT0J. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
I don''t think that blank? makes sense on anything other than String, no matter how you define it. My vote would be to deprecate it on Enumerable, for example, and add something else if desired. James Coleman ---------- Forwarded message ---------- From: Michael Boutros <michael.boutros@gmail.com> Date: Tue, Jul 10, 2012 at 2:55 PM Subject: Re: [Rails-core] Re: Defining #blank for Array. To: rubyonrails-core@googlegroups.com Do you think anyone currently uses #blank? on enumerables in its current state? It doesn''t make sense the way it is right now. Imagine a piece of paper with a list of 10 blank lines. Wouldn''t you call that a blank list? On Monday, July 9, 2012 10:50:34 AM UTC-4, Xavier Noria wrote:> > On Mon, Jul 9, 2012 at 4:38 PM, Michael Boutros <michael.boutros@gmail.com > > wrote: > > Yes. > > > Your implementation makes sense. I mean, I believe that if blank? was > defined on enumerables as all?(&:blank?) from the very first day, one could > have accepted that definition just fine. > > But the current definition also makes sense to me. > > Since this is a fundamental predicate in Active Support that has had this > semantic since forever, this modification would be backwards incompatible, > and the current definition is also just fine in my opinion, I think we > should keep it the way it is. > > --You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/WL4-tEq6TT0J. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Yes, I think everyone uses #blank? on enumerables in its current state, and expect that behavior, because it is well documented. Rafael Mendonça França http://twitter.com/rafaelfranca https://github.com/rafaelfranca On Tue, Jul 10, 2012 at 3:55 PM, Michael Boutros <michael.boutros@gmail.com>wrote:> Do you think anyone currently uses #blank? on enumerables in its current > state? It doesn''t make sense the way it is right now. Imagine a piece of > paper with a list of 10 blank lines. Wouldn''t you call that a blank list? > > > On Monday, July 9, 2012 10:50:34 AM UTC-4, Xavier Noria wrote: >> >> On Mon, Jul 9, 2012 at 4:38 PM, Michael Boutros < >> michael.boutros@gmail.com> wrote: >> >> Yes. >> >> >> Your implementation makes sense. I mean, I believe that if blank? was >> defined on enumerables as all?(&:blank?) from the very first day, one could >> have accepted that definition just fine. >> >> But the current definition also makes sense to me. >> >> Since this is a fundamental predicate in Active Support that has had this >> semantic since forever, this modification would be backwards incompatible, >> and the current definition is also just fine in my opinion, I think we >> should keep it the way it is. >> >> -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/rubyonrails-core/-/WL4-tEq6TT0J. > > To post to this group, send email to rubyonrails-core@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-core+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
I use it. It makes total sense to me. If you have a piece of paper with a list of 10 blank lines, how do you know there are exactly 10 blank lines instead of 3 or 7 or 13? On Tue, Jul 10, 2012 at 1:55 PM, Michael Boutros <michael.boutros@gmail.com>wrote:> Do you think anyone currently uses #blank? on enumerables in its current > state? It doesn''t make sense the way it is right now. Imagine a piece of > paper with a list of 10 blank lines. Wouldn''t you call that a blank list? > > > On Monday, July 9, 2012 10:50:34 AM UTC-4, Xavier Noria wrote: >> >> On Mon, Jul 9, 2012 at 4:38 PM, Michael Boutros < >> michael.boutros@gmail.com> wrote: >> >> Yes. >> >> >> Your implementation makes sense. I mean, I believe that if blank? was >> defined on enumerables as all?(&:blank?) from the very first day, one could >> have accepted that definition just fine. >> >> But the current definition also makes sense to me. >> >> Since this is a fundamental predicate in Active Support that has had this >> semantic since forever, this modification would be backwards incompatible, >> and the current definition is also just fine in my opinion, I think we >> should keep it the way it is. >> >> -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/rubyonrails-core/-/WL4-tEq6TT0J. > > To post to this group, send email to rubyonrails-core@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-core+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.