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

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

On Thu, 23 Sep 2004 17:37:18 -0700, Hayden McKay
<guest at RapidEuphoria.com> wrote:

>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>
{{{

Why? what (typo aside) is slice? array[2..5]?

how about:
function ews(sequence s, integer fromidx, integer toidx)
-- either way slice:
	if fromidx>toidx then return s[toidx..fromidx] end if
	return s[fromidx..toidx]
end function
slice=ews(array,5,2)

>I had an idea for type checking constants.
>}}}
<eucode>
>type word(integer value)
>    return <= #FFFF
>end type
>constant VALUE = word(12345)
></eucode>
{{{

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


obviously you meant
word value value=12345

<BSG>

Regards,
Pete

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

Search



Quick Links

User menu

Not signed in.

Misc Menu