Mailing List Archive

1 2  View All
Re: Elevator pitch - "assuming" [ In reply to ]
On Fri, Jul 30, 2021 at 8:57 PM Darren Duncan <darren@darrenduncan.net>
wrote:

> On 2021-07-28 4:52 a.m., Paul "LeoNerd" Evans wrote:
> > Oh well if you wanted it as a block with the keyword first, that's
> > easily possible as a keyword module:
> >
> > assuming( $value ) {
> > $_ = calculate_new_value_using $_;
> > }
> >
> > and in fact many languages already provide such syntax; called "with",
> > though it's often unconditional.
> >
> > with( $value ) {
> > $_ = calculate_new_value_using $_;
> > }
>


yeah, many languages already provide such syntax. Perl is one of them.

for( $value ) {
$_ = calculate_new_value_using $_;
}


--
"Lay off that whiskey, and let that cocaine be!" -- Johnny Cash

1 2  View All