juan_gandhi: (Default)
 Карен нашла там у меня смешной дефект в коде, что я послал на ревью. Спасибо ей; дефект поправил.

Теперь что. Добавил тесткейс.

Упс. Компилятор кирдык. scalac. Зацикливается.

Окей. Закомментировал пока большую часть того кейса.

Упс. Другие тесты не идут. А чо? А-а--а-а-а! Вставил запятую.

Вот что это вообще.

Настанет, наверно, момент, что я завяжу со скалой. Там какие-то ебанаты. Сейчас пошел очередной скандал, там какая-то дура, "заведующая скальной комьюнити", образование у нее - политология, из белградского университета, решила Джона де Гоуза не допускать в качестве спикера (или вообще?) на конференции. (Ну, к Джону главная претензия - что он лысый и мускулистый: не иначе расист.) Другого Джона (Прити) вообще выпинали отовсюду, потому что гелфренда одного левого экстремиста из Берлина нажаловалась публично, что ранее Джон Прити с ней трахался (а жениться не захотел).

Какая хуйня, прости господи. Надо вернуться на Форт, там дедушки мирные, все улыбаются (и я их почти что в лицо знаю, а уж по сорс-коду так точно, читал как стихи когда-то). Тоже маразм, конечно.

 

juan_gandhi: (Default)
Reminds me what we did in Forth, with Leo, present here:

      applyTo | "a" | "b"  | "c" | "d"  | "e" |
      at("a") | "a" | "ab" | ""  | ""   | ""  |
      at("b") | ""  | "b"  | ""  | ""   | ""  |
      at("c") | ""  | "cb" | "c" | "cd" | ""  |
      at("d") | ""  | ""   | ""  | "d"  | ""  |
      at("e") | ""  | ""   | ""  | "ed" | "e" 


This is a test case. Rather, 25 test cases.
We scan through at("a") to at("e"), where at(x) is a representable diagram (presheaf, functor, whatever) for object x:
      val at = (obj: topos.site.Obj) => topos.representable(obj)


and then, in each row, apply this representable to objects "a",..., "e", and check that the result is a set (hom(x, y)) consisting of the values in the cells of the table. The values in the table are split by comma and converted to sets - because we deal with Grothendieck toposes.

But toposes are not essential here. I just decided to be lazy, and write code as tables, as Leo suggested eons ago, probably in 1989. It's not even my idea.

Implementation:
      val at = (obj: topos.site.Obj) => topos.representable(obj)
      
      case class table(data: List[String] = Nil) {
        def |(x: String): table = table(x::data)
        def |(d: Diagrams.Diagram) = check(d, data, data)
      }

      case class check(d: Diagram, data: List[String], fullList: List[String]) {
        def |(x: String): check = {
            d(data.head) === x.split(",").toSet
            check(d, data.tail, fullList)
        }
        def |(d: Diagram): check = check(d, fullList, fullList)
      }

      val applyTo = new table
juan_gandhi: (VP)
http://dreamsongs.com/Files/worse-is-worse.pdf

Those were the days when I was debugging into the microcode of a stupid machine from Severodonetsk, which was losing interrupt stack trace from time to time, and so we were out of luck: I did lose some significant money on trying to fix this, but figure it was theoretically impossible.

Anyway, the source of inspiration is this: http://pchiusano.github.io/2014-10-13/worseisworse

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

August 2025

S M T W T F S
      12
3456789
10 11 12 13141516
171819 20212223
2425 26272829 30
31      

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Sep. 2nd, 2025 02:33 pm
Powered by Dreamwidth Studios