1. retrograding bits of 2.1 to 2.0 'A WORKAROUND'

Help!

I know this will sound really stupid.  And I actually hope it is a stupid
as it sounds, so that the answer is therefore simple and straightforward.

There is no 'REVERSE' command in EU 2.0.  I wish to know the way of
Shifting (i.e., reversing) the coding of...

x = reverse(ints_to_bits(i,8))

into something I can use in EU 2.0 (I would have to spend far too much time
converting all of my program code over to 2.1 at this juncture of time, but
I will start to do that as soon as I have something to run in the meantime).

Or do I have to go into 2.1 and hack out the REVERSE code so that I can run
it in 2.0?

Confused and Clueless (too much coding; not enough sleep)

Thanks,
Norm

new topic     » topic index » view message » categorize

2. Re: retrograding bits of 2.1 to 2.0 'A WORKAROUND'

Hello,

>Help!
>
>There is no 'REVERSE' command in EU 2.0.  I wish to know the way of
>Shifting (i.e., reversing) the coding of...

I've never used REVERSE but maybe you could write a function to do it.


>x = reverse(ints_to_bits(i,8))
>
>into something I can use in EU 2.0 (I would have to spend far too much time
>converting all of my program code over to 2.1 at this juncture of time, but
>I will start to do that as soon as I have something to run in the
>meantime).

Why bother, doesn't all 2.0 code work in 2.1?  Or is that what your even
what your talking about?


>
>Or do I have to go into 2.1 and hack out the REVERSE code so that I can run
>it in 2.0?

Well, I would call it PORTING, not hacking ;)

Lewis Townsend


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

new topic     » goto parent     » topic index » view message » categorize

3. Re: retrograding bits of 2.1 to 2.0 'A WORKAROUND'

Norm Goundry wrote:

>There is no 'REVERSE' command in EU 2.0.  I wish to know the way of
>Shifting (i.e., reversing) the coding of...
>
>x = reverse(ints_to_bits(i,8))
>
>into something I can use in EU 2.0

Look in misc.e from EU 2.1 -- the reverse() function is right there, and
it'll work just fine under EU 2.0. In fact, I believe misc.e from EU 2.1
will run under EU 2.0 without any problems at all, so just replace the 2.0
misc.e with the 2.1 version and life should be just dandy.

(I know Rob advises against doing this, but -- in this one specific instance
 -- it shouldn't cause any problems.)

>(I would have to spend far too much time
>converting all of my program code over to 2.1 at this juncture of time, but
>I will start to do that as soon as I have something to run in the
meantime).

?? AFAIK, EU 2.1 is perfectly backwards-compatible with EU 2.0 code, so why
would you have to spend *any* time converting code? Unless, of course,
you're referring to global naming conflicts, which could cause quite a few
problems. Otherwise, I don't see why you'd need to convert any code -- I've
still got some programs written in EU 1.4 that work without any problems
under EU 2.1.


Be seeing you,
   Gabriel Boehme

new topic     » goto parent     » topic index » view message » categorize

4. Re: retrograding bits of 2.1 to 2.0 'A WORKAROUND'

At 12:34 PM 6/16/99 -0400, you wrote:

>There is no 'REVERSE' command in EU 2.0.  I wish to know the way of
>Shifting (i.e., reversing) the coding of...
>
>x = reverse(ints_to_bits(i,8))
>
>into something I can use in EU 2.0

Hey Norm,

You really ought to upgrade to 2.1 because it's faster and better and runs
all your 2.0 stuff.  Having said that, here's the reverse{} function
slightly modified so that it works under 2.0.

-- start code
function reverse(sequence s)
    integer lower, n
    sequence t
    n = length(s)
    t = repeat(0, n)
    lower = 1
    for upper = n to floor(n/2)+1 by -1 do
        t[upper] = s[lower]
        t[lower] = s[upper]
        lower = lower+1
    end for
    return t
end function
-- end code

Hope this helps blink

Colin Taylor

new topic     » goto parent     » topic index » view message » categorize

5. Re: retrograding bits of 2.1 to 2.0 'A WORKAROUND'

Colin Taylor wrote:

>Hey Norm,
>
>You really ought to upgrade to 2.1 because it's faster and better and runs
>all your 2.0 stuff.  Having said that, here's the reverse{} function
>slightly modified so that it works under 2.0. [snip]

D'oh! I forgot about those darn += operators -- misc.e from EU 2.1 will
*not* work in EU 2.0. Apologies for my stupidity there.

>You really ought to upgrade to 2.1 because it's faster and better and runs
>all your 2.0 stuff.

I must agree -- if you want the advantages of 2.1, upgrade. All your old
code will still work.

Again, sorry for my dumb suggestion earlier -- I'm not feeling 100% today...


 ------
"When we have nothing to say, better to say nothing."
Robert Fripp

"Now *there's* a piece of advice I should pay attention to more often."
Gabriel Boehme
 ------

new topic     » goto parent     » topic index » view message » categorize

6. Re: retrograding bits of 2.1 to 2.0 'A WORKAROUND'

If all it is that you want to do is reverse the order of the sequence that is
returned, simply use this:

sequence seq, buffer
seq = {1,2,3}
buffer = {}
for ix = 1 to length(seq) do
    buffer = prepend(b,seq[ix])
end for



Norm Goundry wrote:

> Help!
>
> I know this will sound really stupid.  And I actually hope it is a stupid
> as it sounds, so that the answer is therefore simple and straightforward.
>
> There is no 'REVERSE' command in EU 2.0.  I wish to know the way of
> Shifting (i.e., reversing) the coding of...
>
> x = reverse(ints_to_bits(i,8))
>
> into something I can use in EU 2.0 (I would have to spend far too much time
> converting all of my program code over to 2.1 at this juncture of time, but
> I will start to do that as soon as I have something to run in the meantime).
>
> Or do I have to go into 2.1 and hack out the REVERSE code so that I can run
> it in 2.0?
>
> Confused and Clueless (too much coding; not enough sleep)
>
> Thanks,
> Norm


Greg Phillips
--
"DOS addresses only 1 Megabyte of RAM because we cannot imagine any applications
needing more." - Microsoft, 1980, on the development of DOS

"Windows NT addresses 2 Gigabytes of RAM which is more than any application will
ever need" - Microsoft, 1992, on the development of Windows NT

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu