Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify if and, or, xor, and not, are bitwise or logical #36

Open
aabounegm opened this issue May 8, 2024 · 6 comments
Open

Clarify if and, or, xor, and not, are bitwise or logical #36

aabounegm opened this issue May 8, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@aabounegm
Copy link

At the end of section 3 (Bytes), there is the following quote:

There are also attributes for bitwise operations: ★and, ★or, ★xor, ★not, ★left, and ★right.

Which implies that not is the bitwise complement operation, and that and/or/xor also operate bitwise.
For example, not 00-00 would be FF-FF.

However, on the same page, towards the end of subsection 4.2 (Bool), there is the following

The not attribute is a Boolean inversion. Attributes and, or, xor are logical conjunction, disjunction, and exclusive disjunction of the object itself with an a array of other Boolean values.

Which implies that these operations are logical (meaning they operate only on true/false values).
For example, not of 00-00 would be 00-01.

Which of these variants is the correct one?

And as an additional question, what is meant by "an a array of other Boolean values"? Do these operations accept an array as an argument or just one other value?

@yegor256
Copy link
Member

yegor256 commented May 8, 2024

@maxonfjvipon can you please help

@yegor256 yegor256 added the bug Something isn't working label May 8, 2024
@maxonfjvipon
Copy link
Member

maxonfjvipon commented May 8, 2024

@aabounegm

  1. we don't have bool anymore, there are true and false objects (read this). We'll fix the paper soon
  2. bytes.and and true.and are different objects. bytes.and is bitwise "and", true.and is logical "and"

@aabounegm
Copy link
Author

Yes I remember that blog post. So it's safe to assume that all of those operators (with their respective atoms listed here) are bitwise, correct?

@maxonfjvipon
Copy link
Member

@aabounegm and, or, xor, not - yes, bitwise

@aabounegm
Copy link
Author

Understood, thank you. Feel free to close the issue or keep it open until the paper is updated

@yegor256
Copy link
Member

yegor256 commented May 8, 2024

@maxonfjvipon let's update the paper and then close the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants