22 Matching Annotations
  1. Nov 2023
  2. Mar 2023
    1. As an aside, I think I now prefer this technique to Python for at least one reason: passing arguments to the decorator method does not make the technique any more complex. Contrast this with Python: <artima.com/weblogs/viewpost.jsp?thread=240845>
    2. def document(f): def wrap(x): print "I am going to square", x f(x) return wrap @document def square(x): print math.pow(x, 2) square(5)
  3. Sep 2022
  4. Jan 2022
    1. Instead of render props, we use Svelte's slot props: // React version <Listbox.Button> {({open, disabled} => /* Something using open and disabled */)} </Listbox.Button> <!--- Svelte version ---> <ListboxButton let:open let:disabled> <!--- Something using open and disabled ---> </ListboxButton>
  5. Sep 2021
    1. Analogous structures have the potential to reveal what selective pressures led us to develop language

      it's rly useful to study analogous traits, as we can use them to test evolutionary theories to do with function. we can't do this with homologous structures, bc the change would have come from one common ancestor (and so would just be one data point, even if it affected millions of species)

    2. FoxP2 governs oral and facial development

      the same gene exists in birds - it also plays a role in their vocal learning. rly interesting example of an analogous trait & def not something i expected !!

  6. Jun 2021
  7. Apr 2021
  8. Feb 2021
    1. {a: 1, b: 2, c: 3, d: 4} => {a:, b:, **rest} # a == 1, b == 2, rest == {:c=>3, :d=>4}

      equivalent in javascript:

      {a, b, ...rest} = {a: 1, b: 2, c: 3, d: 4}
      

      Not a bad replacement for that! I still find javascript's syntax a little more easily readable and natural, but given that we can't use the same syntax (probably because it would be incompatible with existing syntax rules that we can't break for compatibility reasons, unfortunately), this is a pretty good compromise/solution that they've come up with.

  9. Nov 2020
    1. Converting Angular components into Svelte is largely a mechanical process. For the most part, each Angular template feature has a direct corollary in Svelte. Some things are simpler and some are more complex but overall it's pretty easy to do.
  10. Oct 2020
  11. Sep 2020