Mike Gerwitz's GNU Social Instance
  • Login
  • Public

    • Groups
    • Recent tags

Conversation

Notices

  1. codesections (codesections)'s status on Tuesday, 05-Feb-2019 14:39:26 UTC codesections codesections
    • Julio Biason

    @juliobiason

    Yeah, I *generally* agree, though walking through that logic can lead to some weird places.

    In #rust, `true ^ false` evaluates to `true` because Rust implements `^` as the XOR operator for the `bool` type—no casting involved at all.

    In #javascript—which *doesn't* have an XOR for booleans, `true ^ false` *also* evaluates to `true` (in a conditional), because JS casts it to `1 ^ 0`, which is `1`, which is cast to `true`.

    Does that mean that `^` is good code in Rust but bad in JS?

    Tuesday, 05-Feb-2019 14:39:26 UTC from fosstodon.org permalink

    Feeds

    • Activity Streams
    • RSS 2.0
    • Atom
    • Help
    • About
    • FAQ
    • TOS
    • Privacy
    • Source
    • Version
    • Contact

    Mike Gerwitz's GNU Social Instance is a social network, courtesy of Mike Gerwitz. It runs on GNU social, version 1.2.0-beta4, available under the GNU Affero General Public License.

    Creative Commons Attribution-ShareAlike 3.0 Unported All Mike Gerwitz's GNU Social Instance content and data are available under the Creative Commons Attribution-ShareAlike 3.0 Unported license.

    Switch to mobile site layout.