Implementing C++'s std::partition in BQN

Поділитися
Вставка

КОМЕНТАРІ • 24

  • @mlliarm
    @mlliarm 2 роки тому +8

    BQN looks like a lovely APL.
    Great explanation as always Conor. Keep it up!

  • @Ven_de_Thiel
    @Ven_de_Thiel Рік тому +3

    Definitely nice that `/` parses this way in BQN. APL using the same glyph for replicate and reduce tends to be annoying in trains.

  • @aradarbel4579
    @aradarbel4579 2 роки тому +5

    beautiful! it's forks all the way down :D

  • @drako3659
    @drako3659 2 роки тому +7

    When did you switch from APL to BQL? I like the change because BQL is open source (and could be trivially embedded in python/js code). Is this just a one-off for the podcast episode (started it, not nearly caught up)?

    • @code_report
      @code_report  2 роки тому +7

      I am learning APL, BQN and J all at the same time, but APL is my favorite still. BQN is better for this problem because using compress (/) in a fork in APL leads to ambiguity for the parser, so you need to use ⊢⍤/ which is very irritating. BQN doesn't have that problem.

    • @beanpole4701
      @beanpole4701 2 роки тому +2

      how are you learning all three at once? im having enough trouble learning one at a time

    • @difflocktwo
      @difflocktwo 2 роки тому +5

      @@beanpole4701 Big brain.

    • @mlliarm
      @mlliarm 2 роки тому

      @trayz they're of the same family. So if you know one well, you can jump to the other.

  • @gtgunar
    @gtgunar 2 роки тому +1

    The podcast is 404-d. The previous(53rd) is there tho. Maybe time will fix it.

    • @code_report
      @code_report  2 роки тому +2

      Sorry! Just updated the website! Works now.

  • @yarrowification
    @yarrowification 2 роки тому

    I'd love Brice bqn streams

  • @cramble
    @cramble 2 роки тому +1

    def sortByParity(arr):
    tmp = arr[:]; tmp.sort(key=lambda x: x%2==0); return tmp[::-1]

    • @H2CO3Szifon
      @H2CO3Szifon Рік тому +2

      mask = a & 1 > 0
      np.hstack([a[~mask], a[mask]])

  • @keldwikchaldain9545
    @keldwikchaldain9545 2 роки тому +4

    I think I prefer ⍋∘(2|⊢)⊏⊢