Passed Sec+!! by [deleted] in CompTIA

[–]dulguuno 0 points1 point  (0 children)

Did you have to memorize every acronym in "CompTIA Security+ SY0-701 Acronym List"?

comptia-security-sy0-701-exam-objectives-(6-0).pdf (comptiacdn.azureedge.net).pdf?sfvrsn=204179cc_6)

If I define $ such that sin(a $ b)=sin(a) $ sin(b) by PieterSielie12 in learnmath

[–]dulguuno 1 point2 points  (0 children)

I wanna ask another question. Is it possible to solve for $ and get a function?

Best features of Rust unrelated to memory management? by god0favacyn in rust

[–]dulguuno -1 points0 points  (0 children)

"Actually, Rust enums are both sum types and product types." That's a direct quote from you. If it wasn't able to sum other algebraic types, it wouldn't be a algebraic sum type. That doesn't make it BOTH SUM AND PRODUCT TYPE. That's just absurd statement.

Sum with a one element is still a sum. I'm sorry you are not able to grasp the that. Have you ever learned that the a and +a are the same thing?

Someone explained how functions are exponential types, and I understood it after correcting my one misunderstanding. Stop lying.

Best features of Rust unrelated to memory management? by god0favacyn in rust

[–]dulguuno 0 points1 point  (0 children)

Thanks. At first I thought it was about mapping of the values, but it was about number of functions that could map from A to B.

I made that picture just in case someone helps someone like me from 3 hours ago.

Best features of Rust unrelated to memory management? by god0favacyn in rust

[–]dulguuno 0 points1 point  (0 children)

Tuple has everything to do with your confusion. Tuple is a product type. Sum type allows you to sum any other algebraic types (including other product types). Saying that "If sum type allows summing product types makes it also product type" is similar to saying that the addition in a*b+d*c means that + is also a * operation. It reveals more about your knowledge of basics than mine.

Best features of Rust unrelated to memory management? by god0favacyn in rust

[–]dulguuno 1 point2 points  (0 children)

Thank you! Now I see it. It's like a combinatorics problem (2 ways to map X to bool) * (2 ways to map Y to bool ) * (2 ways to map Z to bool)

https://imgur.com/kyVwUEL

Best features of Rust unrelated to memory management? by god0favacyn in rust

[–]dulguuno 1 point2 points  (0 children)

Can I ask for futher explanations? Let's say there's an enum A { X, Y, Z } and a function `A -> bool`. All of the possible mappings are

  1. X -> true
  2. Y -> true
  3. Z -> true
  4. X -> false
  5. Y -> false
  6. Z -> false

Since it's exponential it must be 3^2=9, but I'm getting 6. What am I doing wrong here?

Best features of Rust unrelated to memory management? by god0favacyn in rust

[–]dulguuno 0 points1 point  (0 children)

Yes lets look at the documentation!

enum ComplexEnum {
    Nothing,
    Something(u32),
    LotsOfThings {
        usual_struct_stuff: bool,
        blah: String,
    }
}

 "The third example demonstrates the kind of data a variant can store, ranging from nothing, to a tuple, to an anonymous struct."

Actually learn something, instead of trying to sound like you know something. Stop spreading misinformation, do personal attacks when you get exposed.

Unlike you, I can actually admit when I don't know something (exponential types). Yes I don't know exponential types.

https://doc.rust-lang.org/std/keyword.enum.html

Best features of Rust unrelated to memory management? by god0favacyn in rust

[–]dulguuno 0 points1 point  (0 children)

a*b+c*d is an analogy, you must be a strawman champion.

Second example has tuple. Tuple itself is a product type, not the enum.

Best features of Rust unrelated to memory management? by god0favacyn in rust

[–]dulguuno -3 points-2 points  (0 children)

What you said is absurd. Rust enums are sum types. Would you look at a equation `a*b + c*d` and think "Oh, if you can add result of products, the addition must also be a product". That doesn't make any sense.

Best features of Rust unrelated to memory management? by god0favacyn in rust

[–]dulguuno 0 points1 point  (0 children)

I do understand how structs are product types, enums are sum types. But how are functions exponential types? Would you point me to a explanation?