[#1816] Ruby 1.5.3 under Tru64 (Alpha)? — Clemens Hintze <clemens.hintze@...>

Hi all,

17 messages 2000/03/14

[#1989] English Ruby/Gtk Tutorial? — schneik@...

18 messages 2000/03/17

[#2241] setter() for local variables — ts <decoux@...>

18 messages 2000/03/29

[ruby-talk:01730] Re: [Ruby] static buffers

From: Dave Thomas <Dave@...>
Date: 2000-03-05 23:15:58 UTC
List: ruby-talk #1730
Clemens Hintze <c.hintze@gmx.net> writes:

>     Dave> What about using parameter passing semantics:
>     Dave>   rescue FriendlyException(friendly)
> 
> 
> I like that syntax, but didn't that get confused with method calling?
> I know it is not the normal way, but nowadays I could code something
> like this:
> 
>     exceptions = [SyntaxError, TypeError]
> 
>     def Exception(val)
>        case val
>          when 1
>             SyntaxError
>          when 2
>             TypeError
>        end
>     end

Yup - that's a problem all right.

We could certainly go with a new syntax, such as you colon idea (which 
is nice and terse), or using something like

   rescue  SyntaxError into e

which is longer but perhaps more readable.

Or maybe we could bite the bullet and make it a syntax error to have
method names start with an upper case letter, thus allowing the Xxx(e) 
syntax _and_ cutting out a class or ambiguity problems in normal code.

Would that be a major problem to enforce?


Dave

In This Thread