yozu
yozu
To be short: 既存の`use-image-by-width` は`width`を特別扱いしているのであまり合理的でなく、今のSATySFiでは`linear-transform-graphics`が使えるのだから、`use-image`をprimitiveにして`use-image-by-width`はライブラリ定義にしたほうが良いのでは?という意見です。 違う例としては ``` get-initial-context : length -> [math] inline-cmd -> context ``` があるわけですが、これにおける`length`は画像における`length`とは意味が異なる(文書のcolumnの幅)ので違和感はないです。 (ただこれはあくまで1意見であり、`get-image-size`の方が良さそうであれば`use-image-by-natural-size`を消して`get-image-size`を追加しようとおもいます)
I updated the implementation to come up with the following ideas: - Add primitive `use-image` (called `use-image-by-natural-size` in upstream discussion) to import image by its natural size. - Delete `use-image-by-width`...
以下のアイデアを実現するために実装を更新しました。 - 画像を「自然なサイズ」で使用する`use-image`プリミティブ(上のdiscussionで`use-image-by-width`と呼んでいたもの)を実装した。 - `use-image-by-width`を`vminst.ml`から削除し、ライブラリ定義として`pervasives.satyh`に再実装した。 キーポイントは 私は思う, `use-image`は`use-image-by-width`よりもprimitiveであると。
To be short: 現在のSATySFiでは、`inline-text`に`\footer`等が含まれている場合、その`inline-text`を2回評価すると、footerのカウントが2回インクリメントされてしまいます。 これを回避するために ```text get-command-identity ctx: context -> string ``` というAPIを提案します。これは、 ```ocaml let-inline ctx \footer-wrap it = %... in % ... { \footer-wrap{ hello } } ``` のように、`inline-text`中でコマンド(ここでは`\footer-wrap`)が使われるたびに、ファイル先頭からのバイト位置を`ctx`中のリストに追加していきます。`get-command-identity...
Thanks for the discussion. I also agree with state-passing syntax, but it is very breakable change to the current syntax. For the first step to make mutable variables obsolete, I...
If compositing state into `context` is unsound, How about replacing current SATySFi's `context` to `('a, context)`? I think it is more compatible way to use `state` and `context` separately, and...
For example, regarding SATySFi's `context` as `(int list, old-context)`, we can implement mutable behavior using `let-mutable` like: ```ml let-mutable identical-number context let duplicate-context ctx = let (l, etc) = ctx...
Thanks for reply. > The second suggestion is not backward-compatible It can be compatible if the language restrict `'a` to `int list`. In fact, in [above example](#issuecomment-824515696), `'a'` is bound...
Thanks for reply. > We need to break the cyclic dependency I think this API-redesign is complex. Is there any problem in `load-image` API which just returns stub `image` object...
Note: I am using this script to generate dependency file. It works in many cases, but not always. ```bash %.d: %.saty @eval `opam env` && SATYROGRAPHOS_EXPERIMENTAL=1 satyrographos util deps-make "$