Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>as a notation for bitwise OR, replacing ".OR.", which had been used by IBM in its previous programming language, "FORTRAN IV".

Untrue: ".OR." in FORTRAN meant ordinary OR, not bitwise OR. I don't remember ever seeing bitwise OR or AND or XOR in FORTRAN IV.



That is right, but I did not want to provide too many details that did not belong to the topic.

FORTRAN IV did not have bit strings, it had only Boolean values ("LOGICAL").

Therefore all the logical operators could be applied only to Boolean operands, giving a Boolean result.

The same was true for all earlier high-level programming languages.

The language NPL, renamed PL/I in 1965, has been the first high-level programming language that has introduced bit string values, so the AND, OR and NOT operators could operate on bit strings, not only on single Boolean values.

If PL/I would have remained restricted to the smaller character set accepted by FORTRAN IV in source texts, they would have retained the FORTRAN IV operators ".NOT.", ".AND.", ".OR.", extending their meaning as bit string operators.

However IBM has decided to extend the character set, which has allowed the use of dedicated symbols for the logical operators and also for other operators that previously had to use keywords, like the relational operators, and also for new operators introduced by PL/I, like the concatenation operator.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: