Re: Re[2]: (Another) (small) Eu 2.5 feature request.

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

Oops sorry I chopped off the bottom. I had an idea for type checking
constants.
type word(integer value)
    return <= #FFFF
end type
constant VALUE = word(12345)


I've decided against this one too because constants are allways static 
but it might help for local variables eg;
integer value value = word(12345)

Hayden McKay wrote:
> 
> I have to vote against this. It only adds more complexity to an already
> easily accessable sequence. Its just as easy to use;
> }}}
<eucode>
> constant a = 1, b = 2, c = 3
> sequence array array = repeat(0, 3)
> ?array[a]
> ?array[b]
> ?array[c]
> </eucode>
{{{

> 
> However it would be nice to be able to do this;
> }}}
<eucode>
> sequence array array = repeat(0, 10)
> sequence slice sclice = array[5..2]
> </eucode>
{{{

> 
> and maybee some enhanced type checking for valiables, eg;
> }}}
<eucode>
> 
> type word(integer value)
>

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

Search



Quick Links

User menu

Not signed in.

Misc Menu