[email protected] wrote in
 <612664271.16313594.1760439377633.javamail.r...@zimbra33-e6.priv.proxad.\
 net>:
 |Denys Vlasenko <[email protected]>
 |Steffen Nurpmeso <[email protected]>
 |
 |@Steffen :
 |  as far as algos are concerned and from what can be observed with \
 |  the "tri" script's outputs,
 |  it works fine ... [.]
 |  preferably though :-).

Hm.  I have not looked since back then, and indeed, if i trim the
test script a bit due to >>>, yes, in fact output of bb equals
bash!  Fascinating!  I will have to look how he did it, it totally
escaped me.  I only see one remaining difference in between my own
code and plain busybox / bash, and that is

  # make this work with (ba)sh \
  command -v shopt && shopt -s expand_aliases;\
  alias p=printf;alias e=echo;alias s=export
  s I1=10 I2=20;p "<$((I1+=I2+=I1+=I2))>";e "<$I1><$I2>"
  s I1=10 I2=20;p "<$((I1+=I2+=I1+=I1))>";e "<$I1><$I2>"

which gives for my code
  #?0|kent:tmp$ busybox.static sh t2.sh
  <80><80><50>
  <60><60><40>

and for bash and plain bb

  #?0|kent:tmp$ bash t2.sh
  shopt
  <60><60><50>
  <50><50><40>
  ...$ busybox sh t2.sh
  <60><60><50>
  <50><50><40>

Where a C proof (what i want) gives

  $ cat t.c; tcc -run t.c
  #include <stdio.h>
  int main(void){
          int I1=10, I2=20;
          I1+=I2+=I1+=I2;
          printf("<%d><%d>\n", I1,I2);

          I1=10, I2=20;
          I1+=I2+=I1+=I1;
          printf("<%d><%d>\n", I1,I2);

          return 0;
  }
  <80><50>
  <60><40>

But that is only a nit!
Wow -- he really did get the "several times recursed" conditionals
right with the current code!?!?!?  I really will have to look.

Thank you.

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)
_______________________________________________
busybox mailing list
[email protected]
https://lists.busybox.net/mailman/listinfo/busybox

Reply via email to