While converting C code to NetRexx, I inadvertently ran NetRexxC before dealing with some C shift operators ('>>', '<<'): Value = - (Rc_FlipA[(Value>>12)&0xF]<<12) - | - (Rc_FlipA[(Value>>8)&0xF]<<8) - | - (Rc_FlipA[(Value>>4)&0xF]<<4) - | - (Rc_FlipA[Value&0xF]) I was surprised to see NetRexxC absorb this without a peep. It produced Value=((((((Rc_FlipA[(((Value>12)?1:0))&15])<12))|(((Rc_FlipA[(((Value>8)?1:0))&15])<8)))|(((Rc_FlipA[(((Value>4)?1:0))&15])<4))?1:0))|((Rc_FlipA[Value&15])); That is, it silently replaced '>>' with '>' and '<<' with '<'. _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
>> and << are valid operators in NetRexx (Strictly greater than
and Strictly less than).
Mike
_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
I tried searching NLR 3.04 GA for '>>' and '<<' without finding anything useful. The problem seems to be where the strict operators are represented by guillemets rather than double angle brackets. TABLE 4: Normal comparative operators On Sun, May 29, 2016 at 11:58 AM, Mike Cowlishaw <[hidden email]> wrote:
-- "Life isn't one damn thing after another -- it's the same damn thing over and over." -- Edna St Vincent Millay_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
Actually, guillemets appear in a number places. On Sun, May 29, 2016 at 12:37 PM, George Hovey <[hidden email]> wrote:
-- "Life isn't one damn thing after another -- it's the same damn thing over and over." -- Edna St Vincent Millay_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
"Not my
problem/fault", I think.
:-)
Mike
_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
My problem/fault - I will escape these in TeX. The typographic zeal is too much here.
best regards, René.
_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
Any chance guillemets could represent binary shifts on integer types with Java semantics? Believe it or not, quite a bit of hardware level code is written in Java. NetRexx is even better except for dealing with shifts via functions. 3. ">>>" Shift Right Logical (0s inserted on left)There are three shifts 1. "<<" Shift Left Logical (0s inserted on right) 2. ">>" Shift Right Arithmetic (sign extension) [Hope springs eternal.] On Sun, May 29, 2016 at 3:23 PM, René Jansen <[hidden email]> wrote:
-- "Life isn't one damn thing after another -- it's the same damn thing over and over." -- Edna St Vincent Millay_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
As I mentioned
before, those two operator symbol/combinations already exist and are defined in
NetRexx. Making them mean something else would break any existing NetRexx
program that used them.
As also discussed
recently, they really do not need special operators: just use multiply or
integer divide (and these will work on decimal values
too).
"Shift right
logical" is a touch trickier, but if you really need that you fully understand
what you are doing and it won't take you very long to work out how to do
it. :-)
Mike
_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
With unicode support there is no reason we could not implement the guillemet codepoints as shifts, as long as we don't change the meaning of the plain pointy brackets. I foresee problems on non-unicode platforms though. René.
_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
I have to vote with Mike on this one. Guillemets would be a very bad choice for a NetRexx operator. If you absolutely must add special operators for binary shifts, they cannot look like existing NetRexx operators! Also since Java does not use the "guillemets" for shifts, they would be extremely confusing to Java programmers trying NetRexx. -- Kermit On 2016-05-29 1:28 PM, René Jansen
wrote:
_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
I did not think Mike made exactly this point, but I agree. For the rest, I would refer to Java BitSet which does provide a lot of the basics to implement this. best regards, René.
_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
OK, I surrender. On Mon, May 30, 2016 at 8:56 AM, René Jansen <[hidden email]> wrote:
-- "Life isn't one damn thing after another -- it's the same damn thing over and over." -- Edna St Vincent Millay_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
Free forum by Nabble | Edit this page |