パッケージ定義
パッケージの定義はこんな感じ。
綺麗なものである。
+--------+ +-------------+ | babel2 |<-----------------------------------------o| common-lisp | | | +------------+ | | | |<--------------------------o| alexandria | | | | | +------------------+ | | | | | |<--o| babel2-encodings |<--o| | | | | | | | +------------+ | | | | | |<-----------------o| | +--------+ +------------------+ +-------------+
ソース
babel2
まぁこちらのパッケージはbabel2-encodings
に依存することは問題ない。
だけど、いちおう調べておく。
わかる範囲で。
結果はこんな感じ。
file | babel2-encodings 依存 |
---|---|
external-format.lisp | lookup-mapping が依存 |
sharp-backslash.lisp | sharp-backslash-reader が依存 |
strings.lisp | なし。ほんまかな。 |
babel2-encodings
こちらのパッケージでbabel2
を参照しているものがいると問題。
結果としては一つあった。
file | babel2 依存 |
---|---|
enc-ascii.lisp | なし。 |
enc-cp1251.lisp | なし。 |
enc-cp1252.lisp | なし。 |
enc-ebcdic-int.lisp | なし。 |
enc-ebcdic.lisp | なし。 |
enc-gbk.lisp | なし。 |
enc-iso-8859.lisp | なし。 |
enc-jpn.lisp | なし。 |
enc-koi8.lisp | なし。 |
enc-unicode.lisp | なし。 |
encodings.lisp | なし。 |
gbk-map.lisp | gbk-unicode-mapping が依存 |
jpn-table.lisp | なし。 |
パッケージの依存関係で衝突が発生している。
以下の場所で衝突が発生していることがわかった。
結論としては babel2:unicode-string
を外出しに出来れば寄さそう。
item | value |
---|---|
file | gbk-map.lisp |
symbol | gbk-unicode-mapping |
confrict | babel2:unicode-string をコールしている。 |
babel2:unicode-string とは?
unicode-string
は type な様子。
file:strings.lisp で定義されています。
対応としては type は別パッケージにして、各パッケージがそれを :use
する。で解決できそう。
deftype は別パッケージにする。
以下のイシューで別パッケージにする対応を実施しました。
[deftype を外出しにする。 #6]9https://github.com/yanqirenshi/babel2/issues/6)
これでパッケージの依存度合いは以下のように綺麗になりました。
+--------+ +-------------+ | babel2 |<----------------------------------------------o| common-lisp | | | +------------+ | | | |<--------------------------o| alexandria | | | | | +------------------+ | | | | | |<--o| babel2.encodings |<--o| | | | | | | | +------------+ | | | | | |<----------------------o| | | | | | +--------------+ | | | | | |<--o| bable2.types |<--o| | | | +------------------+ | | | | | |<--------------------------o| | | | +--------+ +--------------+ +-------------+
おわり。
やはり型はパッケージの共通領域で定義したほうが良いよね。
Class どか Constant とかもその方が良いんじゃないかな。