[ruby-talk:02412] Re: Could missing 'end' be reported better?

From: h.fulton@...
Date: 2000-04-09 21:58:21 UTC
List: ruby-talk #2412
Well, I am not aware that it would break any Ruby
code (if it were optional).

But if it were optional: 1. Wouldn't that reduce its
usefulness? 2. And wouldn't it complicate the parser
rather than simplifying it?

Truthfully, I wouldn't object to requiring a "fancy end" 
like this. But I said it wouldn't happen because my
impression is that matz would see it as complicating the
langauge. And in any case, if it is a required syntax,
then every line of Ruby ever written is now broken.

Hal

> h.fulton@att.net writes:
> 
> >   2. This one is not going to happen: Have more than one
> >      kind of 'end' -- say explicitly "end def", "end class",
> >      "end if", etc.
> 
> Actually, _could_ this one happen? Right now can anything appear after 
> an 'end'? If not, could we allow the name of the construct after the
> 'end' for checking purposes. If omitted, there'd be no check. If
> present, then we'd chck that the end corresponded to the appropriate
> construct.
> 
>   class Fred
>     def method
>       a = 1
>       b = 2
>     end def
>   end class
> 
>   for i in 1..10
>     # stuff
>   end for
> 
> 
>   (1..10).each do
> 
>   end do
> 
> 
> and so on.  Personally, I don't think I'd use this very often, but it
> seems like it would be feasible.
> 
> 
> Dave

In This Thread

Prev Next