Do loops and braces

Is there anyway I can envelop this in braces and not have a loop 'end'?

  def goto_territory_list
      ObjectMap.new.instance_eval do
      sales_admin_link.click
      territories_link.click
    end
  end
  
Thanks

Aidy

Is there anyway I can envelop this in braces and not have a loop 'end'?

just do it :slight_smile:
though it's common practice to use do ... end for blocks over more than one
line

···

On Wednesday 19 July 2006 21:10, aidy wrote:

  def goto_territory_list
      ObjectMap.new.instance_eval do
      sales_admin_link.click
      territories_link.click
    end
  end

Thanks

Aidy

I find that slightly annoying as well. When I use brackets, text editors
like emacs, jEdit, etc, will show me how each bracket matches up to a
previous bracket, but they will not show the "do" that matches up with an
"end" when I type it.

If I have many nested if, while, do, etc, statements, the only way to
overcome this disability is to comment end tokens (and keeping track of
these comments over a mutli-version distribution can be very time
consuming, and error-prone.)

Nate

···

On Wed, 19 Jul 2006, Michael Fellinger wrote:

On Wednesday 19 July 2006 21:10, aidy wrote:
> Is there anyway I can envelop this in braces and not have a loop 'end'?

just do it :slight_smile:
though it's common practice to use do ... end for blocks over more than one
line