[#6363] Re: rescue clause affecting IO loop behavior — ts <decoux@...>

>>>>> "D" == David Alan Black <dblack@candle.superlink.net> writes:

17 messages 2000/11/14
[#6367] Re: rescue clause affecting IO loop behavior — David Alan Black <dblack@...> 2000/11/14

Hello again --

[#6582] best way to interleaf arrays? — David Alan Black <dblack@...>

Hello --

15 messages 2000/11/26

[#6646] RE: Array Intersect (&) question — Aleksi Niemel<aleksi.niemela@...>

Ross asked something about widely known and largely ignored language (on

23 messages 2000/11/29
[#6652] RE: Array Intersect (&) question — rpmohn@... (Ross Mohn) 2000/11/29

aleksi.niemela@cinnober.com (Aleksi Niemel) wrote in

[#6723] Re: Array Intersect (&) question — Mathieu Bouchard <matju@...> 2000/12/01

> >Use a hash. Here's code to do both and more. It assumes that

[#6656] printing/accessing arrays and hashes — raja@... (Raja S.)

I'm coming to Ruby with a Python & Common Lisp background.

24 messages 2000/11/30

[ruby-talk:6144] Re: detect:ifNone: in Ruby

From: Mathieu Bouchard <matju@...>
Date: 2000-11-07 23:20:04 UTC
List: ruby-talk #6144
> > matz queries:
> > > If we can find better name, 
> > How about default, defaults or defaulting (I like the last).
> I'd call it "nilGives" or "nil_gives", etc.  I think default leaves too
> much open -- it depends on how your objects are made as to what their
> defualt value is.

I agree that we should not use "default" and similar names, but i can't
give a good reason why.

I'd suggest that "xyz?" be read as: "is this object [an] xyz ?".

I'd suggest that "if_xyz" be read as: "if this object is xyz, [then...]"

Therefore, "if_nil?" reads as "is this object [an] if_nil ?"...  So
wording in the form "if_xyz?" should not be used (except for the very rare
case where the above sentence makes sense!) 

In the same line as "nil_gives", I suggest:

	a .when_nil { b }

> This reminds me of my request for a short-circuit operator....  Is
> there a way the two can be unified, or is that silly?

the best I can suggest may be to add:

	a .when_false { b }  (false itself or nil itself)

so that an operator may be added later to complete the set:

     when_false is to ||
what when_nil   is to...

"|||" comes to mind, but I don't remember (or haven't seen) the original
discussion. 

matju


In This Thread