Re: Default argument values for blocks
- From: "Trans" <transfire@xxxxxxxxx>
- Date: 13 Oct 2005 13:44:20 -0700
>This one was proposed long ago as a way to declare a var whose scope is
> outside the block:
>
> lambda { <foo = 1|2> puts foo }
All sorts of things can work, one that looks quite nice:
lambda { foo = 1|2 -> puts foo }
But I would suggest that everyone give the -> () {} notation chance. I
really hated it at first too, but it has grown on me and I am starting
to like it even more then goal posts b/c of the way it brings the
parameters outside of the block.
T.
.
- Follow-Ups:
- Re: Default argument values for blocks
- From: Austin Ziegler
- Re: Default argument values for blocks
- From: David A. Black
- Re: Default argument values for blocks
- From: rue
- Re: Default argument values for blocks
- References:
- Re: Default argument values for blocks
- From: Austin Ziegler
- Re: Default argument values for blocks
- From: Eric Mahurin
- Re: Default argument values for blocks
- From: Phil Tomson
- Re: Default argument values for blocks
- Prev by Date: Re: Looking for a parser generator
- Next by Date: Re: RubyConf welcoming party
- Previous by thread: Re: Default argument values for blocks
- Next by thread: Re: Default argument values for blocks
- Index(es):
Relevant Pages
|