pub trait Gender {} // implement your own gender, and if u want, publish online! :3 pub struct Masculine; impl Gender for Masculine {} pub struct Feminine; impl Gender for Feminine {} // removed old api: // fn two_lovers(one: Masculine, two: Feminine) // srry not srry for breaking backwards compat // new version has more flexible api!<3 fn two_lovers(one: Box<dyn Gender>, two: Box<dyn Gender>) { println!("smooch~"); } // todo: other functions!! #[cfg(test)] mod tests { use super::*; #[test] fn me_and_who() { two_lovers(Box::new(Feminine), Box::new(Feminine)); } }
PR: support polyamory
This also changes the API to take a shared reference rather than ownership of the lovers :3
pub fn lovers(partners: &[&dyn Gender]) { println!("smooch~"); }
Oh and while we’re at it, for our agender users:
impl Gender for () {}
PR: Merged
Good call with using a shared reference so now we can kiss our partner(s) more than once!!
Kissing many partners with one big smooch might be hard tho, maybe we need to change the implementation to use combinatorics so that everyone kisses each of their partners at least once.
Since there’s no way to tell who kisses who, i can cheat by printing nCr times :3
pub fn lovers(partners: &[&dyn Gender]) { match partners.len() { 0 => { println!("ghost smooch~"); } 1 => { println!("mirror smooch~"); } p => { // p >= 2, safe to unwrap for _ in 0..ncr(p, 2).unwrap() { println!("smooch~"); } } } }
I fucking knew when I came into this thread it would just be nerds arguing over how wrong the joke is.
I for one identify as false
I’m NaN.
Is this TRUE?
best i can offer is
"false"
Should be enum.
And don’t capitalize your variables.enum implies that you cant change it, unless you were referring to the bool then true.
Yes, instead of boolean. But instead of String, too, for optimization reasons. You could always just add more enum constants to it.
That requires a recompile though
Think of the patch notes though.
added 4 new genders
C# disagrees
Idk C#, could you explain?
The MS style guide, which most C# code follows, says so.
I personally hate it and I prefer the java/js style. The braces are also horrible. Here’s an example.
public class ExampleEvents { public bool IsValid; public IWorkerQueue WorkerQueue { get; init; } public event Action EventProcessing; public void StartEventProcessing() { static int CountQueueItems() => WorkerQueue.Count; // ... } }
hehe that’s good
Why are we even recording that?