8 Matching Annotations
  1. Feb 2024
    1. silicon-based

      we often say that for lifeforms the important traits of the base element is its ability to form long chain polymers and its abundance. the next element after carbon to fulfill these conditions is silicon.

      i was just thinking. will silicon based lifeforms bear any resemblance to the entire silicon soc tech we have developed on earth

  2. Nov 2023
    1. // Define a method on type pair. Pair now implements Stringer because Pair has defined all the methods in the interface.

      so to implement an interface you need a superset, not necessarily an exact match, kind of like how in cpp you can use the pointer of a base class to point to any of the objects of a derived class, or was it java, don't clearly remember rn

    2. x > 10000 // References x declared above switch statement.
    3. _, name := range []string{"Bob", "Bill", "Joe"}

      so what i catch is, go will throw an error for any variable which is unused, but it will intentionally ingore _ variable. thus thats the only variable which we can use to store dump also you can't really use _ anywhere else except assignment

    4. // x == 42 here.

      this is outer x, not same x which was used in for loop. basically just variable scoping. but kinda difficult to see in the webpage. also cuz i'm sleep rn

    5. c := data.(type)

      this expression x.(type) can only be used in switch statement, it can't be used normally to find type of the variable

    6. // & takes the address of an object.

      so what happens here ? are all variables not maintained in call stack, so that they can be maintained even when the call stack is popped. does the compiler/garbage cleaner clean up other variables, but not these, as it detects that these variables are still in use that's kinda cool, but also unnecessarily putting pressure on the compiler

    7. // +build prod, dev, test