On Tue, Oct 9, 2012 at 9:54 PM, john skaller
<skal...@users.sourceforge.net>wrote:

>
> On 10/10/2012, at 2:15 PM, Dobes Vandermeer wrote:
>
> > Didn't you recently add the "as" syntax which would allow, for example:
> >
> > if test1 as x1 do
> >
> > elif test2 as x2 do
> >
> > elif test3 as x3 do
> >
> > done
> >
> > ?
> >
> > This probably eliminates the nested else if 90% of the time without
> adding to the language.
>
> That only works with expressions. The word "test1" above should be viewed
> as a
> sequence of computations rather than a single function/generator.
>

I think the conditional of the "if" is an expression - won't it inherit the
"as" capability?


> Of course in *this* case we might say
>
>         if Match ..
>

Yeah, my thoughts exactly.  Probably need a more compelling use case to
look at ...


> And of course I could write, for example:
>
>         dfn = if m2 then v2a else v2 endif . 1 . string . strip
>
> or even better if I used expressions instead of statements.
>

There is a lot of "clean up" and streamlining possible in the code you
posted, it seems to have a lot of unnecessary duplication.

In the process, the need for "otherwise" should probably disappear, too.
------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to