foonathan,
@foonathan@fosstodon.org avatar

Programming languages should have an "implies" operator.

Yes, I can do !A || B, but that's less readable than A => B.

I keep needing it in C++20 requires clauses.

tmr232,

@foonathan If I'm not mistaken, you get that using a and b in Python.

artificialmind,
@artificialmind@fosstodon.org avatar

@foonathan I mean ... "A ? B : true" maybe kinda works? At least it captures "implies" better: "if A then B"

foonathan,
@foonathan@fosstodon.org avatar

@artificialmind Yeah, but then you have a weird : true in there...

taxorubio,
@taxorubio@fosstodon.org avatar

@foonathan @artificialmind It's my first time reading that idiom and I like how it make the branching clearer. !A || B makes it harder for my brain to think about A && B || !A because the negation operator, but A ? B : true makes the branching explicit and much easier to analyse. Still, A => B would be the bomb!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • DreamBathrooms
  • mdbf
  • ethstaker
  • magazineikmin
  • GTA5RPClips
  • rosin
  • thenastyranch
  • Youngstown
  • osvaldo12
  • slotface
  • khanakhh
  • kavyap
  • InstantRegret
  • Durango
  • provamag3
  • everett
  • cisconetworking
  • Leos
  • normalnudes
  • cubers
  • modclub
  • ngwrru68w68
  • tacticalgear
  • megavids
  • anitta
  • tester
  • JUstTest
  • lostlight
  • All magazines