Re: Vacation

new topic     » goto parent     » topic index » view thread      » older message » newer message

Robert wrote:

>recently, I'm now leaning towards adding assignment
>operators like C: +=   -=  *=  /=

Hurrah! (But see my whining later in this post...)

>David Cuny's preprocessor has these operators already,
>although he has them backwards from C

Yeah, I noticed this some time after I had released it. I decided that it
was too late to change it. Unlike Euphoria and C, PP *is* sensitive to white
space.

>I don't plan to add:
>    &=
>    append=
>    ++
>     --
>or any others.

Since '&' and 'append' are the basic sequence operators, it would be nice if
these were also represented. I would suspect that you could optimize these
calls so a sequence copy would not be requires, although you've hinted that
particular optimization would be available automatically for all functions.

-- begin whining --

Personally, I'm still in favor of this sort of syntax:

    a.plus(12)  -- a = a + 1 [actually, a = plus( a, 1 )]
    a.append( "foo" )  -- a = append( a, "foo" )
    a.concat( "bar" )    -- a = a & "bar" [ok, really a = concat( a, "bar" )

for ALL functions and procs. I think it's *better* than the 'op=' syntax,
because it's universal. The syntax is (IMHO) clean, natural, and doesn't
conflict with existing Euphoria syntax. You can write very OOP-ish code
without having the overhead of OOP. For example:

    theWindow.grow( 10, 10 )

would convert to:

    grow( theWindow, 10, 10 )

if 'grow' was a procedure, and:

    theWIndow = grow( theWindow, 10, 10 )

if it were a function. If anyone is curious how this would work, my DOT
program implements this as a pre-processor. Robert. could you at least play
with it before deciding it's a bad idea? Preferably, when you're back from
vacation and in a very good mood... blink

But I suspect that on this I'm alone in my beliefs.

-- end whining --

> I expect to see some great new Euphoria programs
> when I get back  smile

I might be ready to release a pre-pre alpha of my latest project by then.
Don't bet on it, though...

Have a great time!

-- David Cuny

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu