Dave Thomas writes:

# "Conrad Schneiker" <schneik / us.ibm.com> writes:
# 
# > While I think the idea of supporting Icon-style goal-directed 
evaluation 
# > is probably a very worthy and powerful capability to add to Ruby, I 
would 
# > prefer to see such a "mode" be more explicitly indicated. I think this 

# > would facilitate "human pattern recognition" with respect to reading 
Ruby 
# > code, and would largely avoid a potential big source of likely 
# > confusion--especially for Ruby users/fans at the "sub-master" level, 
which 
# > is probably the predominant population for successful languages with 
large 
# > followings, such as Perl and Python. The original proposal seems 
(IMHO) a 
# > little too close to the overly context sensitive (or as some say, the 
# > "read only" or "self-encrypting") character of Perl code.
# 
# Conrad:
# 
# A worthy goal, I agree, but can you think of any time where this
# scheme would confuse the neophyte (objection: calls for speculation)?
# I was thinking it was actually quite nice because it sits fairly
# transparently on top of the existing semantics, but I'm sure I missed
# something.

Maybe I am taking something that was only intended to be *somewhat* 
"Icon-like" as being intended to be *seriously* "Icon-like".

Anyway, it seems to me that you get pure "Ruby-like" behavior in the 
trivial cases (e.g.: a > b) and somewhat "Icon-like" behavior in 
non-trivial cases (e.g.: a > b > c). Moreover, without distinguished 
operators, I don't see how things like the following example from 
(http://www.cs.arizona.edu/icon/docs/ipd266.htm) could work. The Icon 
code,

    sentence := "Store it in the neighboring harbor"
    write(5 < find("or", sentence))

prints "23".

I think an approximately equivalent Ruby program is,

    sentence = "Store it in the neighboring harbor"
    puts (5 < sentence.index("or"))

which prints "false", but which we would like to print "23". If we had 
(say) ':<', ':>', and so on, for Icon-like relational operators, then 
(AFAIK), you could have things like,

    a :> b :>  c
    puts (5 :< sentence.index("or"))

both work as expected. And (AFAIK), this approach would generalize to much 
of the elegant and powerful Icon string scanning expressions.

Conrad Schneiker
(This note is unofficial and subject to improvement without notice.)