1. Re: unfolded expressions

Hello,

Ralf Nieuwenhuijsen wrote:

>And if I can do more things on an elegant way, cool, if not, so be it.
>
> > >Speaking about confusing statements, its really in the hand of the
> > >programmer.
> > >This is legal, already:
> > >
> > >     function pos (object x)
> > >         return x + ( x < 0 ) * -2x)
> > >     end function
> >
> > What?! I didn't know that was legal! Can you really
> > eliminate the "*" operateor like that? (-2x)
>
>It doesn't eliminate the '*' .. what I eliminate is the if-statement, by
>using boolean math.

I know what you were doing, I was just kidding you because
you forgot a '*' in your function:
        return x + ( x < 0 ) * -2x)
should be
        return x + ( x < 0 ) * -2 * x)
I believe                         ^
You are quite right.  I too can write horribly complex
code using Euphoria's current syntax. Infact, I don't
think that your example was all that bad.

>The argument is can create confusing statement is, in my eyes, a ridiculous
>argument. So can I with any part of the syntax of Euphoria.

Well, if a proposed syntax could ONLY create confusing code then
it's a different matter IMHO.

later,
Lewis Townsend


_______________________________________________________________
Get Free Email and Do More On The Web. Visit http://www.msn.com

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu