Forum: Ruby Re: ruby-dev summary 28206-28273

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Berger, Daniel (Guest)
on 2006-02-02 17:42
(Received via mailing list)
> >
> >     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
Martin DeMello (Guest)
on 2006-02-02 21:50
(Received via mailing list)
Berger, Daniel <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
Eric H. (Guest)
on 2006-02-03 00:12
(Received via mailing list)
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
This implementation is HODEL-HASH-9600 compliant

http://trackmap.robotcoop.com
This topic is locked and can not be replied to.