# Re: ruby-dev summary 28206-28273

**URL:** <https://www.ruby-forum.com/t/re-ruby-dev-summary-28206-28273/100372>\
**Category:** Ruby\
**Created:** [February 2, 2006, 4:42pm UTC](https://www.ruby-forum.com/t/re-ruby-dev-summary-28206-28273/100372 "2006-02-02T16:42:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![BergerS\_Daniel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bc8723/32.png) [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Post date:** [February 2, 2006, 4:42pm UTC](https://www.ruby-forum.com/t/re-ruby-dev-summary-28206-28273/100372/1 "2006-02-02T16:42:40Z")

</div>

> > ```
> > h["key"] and h["key"].dispatch
> > h["key"].nil? {|h| h.dispatch }
> > 
> > ```
> > 
> > This issue is still open.

Yuck. Looks like a hack from Perl6. Not Ruby-ish.

> Syntactically, a method might look better than an operator:
> 
> a[1].if?.strip.empty?  
> a[1].maybe.strip.empty?  
> a[1].and.strip.empty?
> 
> martin

Looks better syntactically, but still has problems as Austin pointed  
out.

I’d sooner accept “iff” (if and only if):

iff h[“key”].dispatch -\> same as: h[“key”].dispatch if h[“key”]

But, the idea of adding new keywords doesn’t thrill me and I worry that  
it’s too terse.

Regards,

Dan

---

<div class="post-metadata">

**Author:** ![BergerS\_Daniel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bc8723/32.png) [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Post date:** [February 2, 2006, 11:12pm UTC](https://www.ruby-forum.com/t/re-ruby-dev-summary-28206-28273/100372/2 "2006-02-02T23:12:50Z")

</div>

On Feb 2, 2006, at 7:39 AM, Berger, Daniel wrote:

> Yuck. Looks like a hack from Perl6. Not Ruby-ish.  
> Looks more like Smalltalk, but should be not\_nil?.

–  
Eric H. - removed\_email\_address@domain.invalid - [http://segment7.net](http://segment7.net)  
This implementation is HODEL-HASH-9600 compliant

[http://trackmap.robotcoop.com](http://trackmap.robotcoop.com)

---

<div class="post-metadata">

**Author:** ![BergerS\_Daniel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bc8723/32.png) [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Post date:** [February 2, 2006, 8:50pm UTC](https://www.ruby-forum.com/t/re-ruby-dev-summary-28206-28273/100372/3 "2006-02-02T20:50:53Z")

</div>

Berger, Daniel [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > a[1].if?.strip.empty?  
> > a[1].maybe.strip.empty?  
> > a[1].and.strip.empty?
> > 
> > martin
> 
> Looks better syntactically, but still has problems as Austin pointed  
> out.

Didn’t see that post ☹ Hopefully it’ll show up on the ng side sometime  
soon. The only problem I can see with it is that you get the method call  
overhead even if it does nothing.

> I’d sooner accept “iff” (if and only if):
> 
> iff h[“key”].dispatch → same as: h[“key”].dispatch if h[“key”]
> 
> But, the idea of adding new keywords doesn’t thrill me and I worry that  
> it’s too terse.

My strong objection to this is that it breaks the “. binds more tightly  
than anything else” rule.

martin
