Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 97 additions & 20 deletions i18n/po/content/reference/protocols/ja.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: clojure-site-ja 0.0.1\n"
"POT-Creation-Date: 2017-06-01 09:26+0900\n"
"PO-Revision-Date: 2016-06-27 08:47+0900\n"
"PO-Revision-Date: 2017-07-26 15:27+0900\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: ja\n"
Expand Down Expand Up @@ -55,13 +55,13 @@ msgstr "toc::[]"
#: en/content/reference/protocols.adoc:1
#, no-wrap
msgid "Protocols"
msgstr ""
msgstr "プロトコル"

#. type: Title ==
#: en/content/reference/protocols.adoc:16 en/content/reference/datatypes.adoc:17
#, no-wrap
msgid "Motivation"
msgstr ""
msgstr "動機づけ"

#. type: Plain text
#: en/content/reference/protocols.adoc:19 en/content/reference/datatypes.adoc:20
Expand All @@ -73,23 +73,30 @@ msgid ""
"<<datatypes#,datatypes>> features add powerful and flexible mechanisms for abstraction and data structure definition "
"with no compromises vs the facilities of the host platform."
msgstr ""
"Clojureは抽象に基づいて記述されている。シーケンス、コレクション、呼び出し可能性等の抽象が存在する。加えて、Clojureはこ"
"れらの抽象の様々な実装を提供している。抽象はホストのインターフェース、実装はホストのクラスによって定義される。言語の"
"ブートストラップにはこれで十分だったが、Clojureにおいて似たような抽象可、低レベルな実装の機構を欠いた状態だった。"
"<<protocols#,protocols>> と <<datatypes#,datatypes>> の機能は強力で柔軟な、ホストプラットフォームに対して妥協をするこ"
"とのない、抽象化とデータ構造定義を提供する。"

#. type: Plain text
#: en/content/reference/protocols.adoc:21
msgid "There are several motivations for protocols:"
msgstr ""
msgstr "プロトコルにはいくつかの動機がある:"

#. type: Plain text
#: en/content/reference/protocols.adoc:23
msgid "Provide a high-performance, dynamic polymorphism construct as an alternative to interfaces"
msgstr ""
msgstr "インターフェースに代わる、高パフォーマンスな動的ポリモーフィズムを提供する。"

#. type: Plain text
#: en/content/reference/protocols.adoc:26
msgid ""
"Support the best parts of interfaces ** specification only, no implementation ** a single type can implement multiple "
"protocols"
msgstr ""
"インターフェースの良いところだけをサポートする。 ** 仕様のみを指定し、実装は指定しない ** 単一のデータ型が複数のプロト"
"コルを実装することができる"

#. type: Plain text
#: en/content/reference/protocols.adoc:29
Expand All @@ -98,24 +105,29 @@ msgid ""
"cannot be extended later (although interface injection might eventually address this) ** implementing an interface "
"creates an isa/instanceof type relationship and hierarchy"
msgstr ""
"と同時にいくつかのデメリットを避ける ** どのインターフェースを実装するかは、作者の設計段階での判断であり、後から拡張す"
"ることが出来ない(将来、インターフェースインジェクションがこれに対する解決策になる可能性はある) ** インターフェースを"
"実装することで isa/instanceof のような関係性とヒエラルキーが作成される"

#. type: Plain text
#: en/content/reference/protocols.adoc:31
msgid ""
"Avoid the 'expression problem' by allowing independent extension of the set of types, protocols, and implementations "
"of protocols on types, by different parties ** do so without wrappers/adapters"
msgstr ""
"異なる提供元による型、プロトコル、型の上のプロトコルの実装の独立した拡張を許可することにより、'expression problem' ** "
"ラッパー/アダプター等を使用することなく避ける。"

#. type: Plain text
#: en/content/reference/protocols.adoc:32
msgid ""
"Support the 90% case of multimethods (single dispatch on type) while providing higher-level abstraction/organization"
msgstr ""
msgstr "マルチメソッドの90%のケース(型に基づく単一ディスパッチ)をサポートすると同時に、高度な抽象化/構成を提供する"

#. type: Plain text
#: en/content/reference/protocols.adoc:35
msgid "Protocols were introduced in Clojure 1.2."
msgstr ""
msgstr "プロトコルはClojure 1.2で導入された。"

#. type: Title ==
#: en/content/reference/protocols.adoc:36 en/content/reference/datatypes.adoc:21 en/content/about/dynamic.adoc:42
Expand All @@ -129,6 +141,8 @@ msgid ""
"A protocol is a named set of named methods and their signatures, defined using https://clojure.github.io/clojure/"
"clojure.core-api.html#clojure.core/defprotocol[defprotocol]:"
msgstr ""
"プロトコルは https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/defprotocol[defprotocol]を使用して定"
"義される、名前のついたメソッドとシグネチャーの集合である:"

#. type: delimited block -
#: en/content/reference/protocols.adoc:46
Expand All @@ -139,33 +153,39 @@ msgid ""
" (bar [a b] \"bar docs\")\n"
" (baz [a] [a b] [a b c] \"baz docs\"))\n"
msgstr ""
"(defprotocol AProtocol\n"
" \"A doc string for AProtocol abstraction\"\n"
" (bar [a b] \"bar docs\")\n"
" (baz [a] [a b] [a b c] \"baz docs\"))\n"

#. type: Plain text
#: en/content/reference/protocols.adoc:49
msgid "No implementations are provided"
msgstr ""
msgstr "実装は定義されていない"

#. type: Plain text
#: en/content/reference/protocols.adoc:50
msgid "Docs can be specified for the protocol and the functions"
msgstr ""
msgstr "プロトコルと関数にDocを指定することができる"

#. type: Plain text
#: en/content/reference/protocols.adoc:52
msgid ""
"The above yields a set of polymorphic functions and a protocol object ** all are namespace-qualified by the namespace "
"enclosing the definition"
msgstr ""
"上記はポリモーフィックな関数と、プロトコルオブジェクトを生成する。 ** プロトコルは全てプロトコルの定義を含む名前空間で"
"修飾される。"

#. type: Plain text
#: en/content/reference/protocols.adoc:53
msgid "The resulting functions dispatch on the type of their first argument, and thus must have at least one argument"
msgstr ""
msgstr "生成される関数は第一引数の型に基づいてディスパッチを行い、最低一つ引数を持つ必要がある。"

#. type: Plain text
#: en/content/reference/protocols.adoc:54
msgid "defprotocol is dynamic, and does not require AOT compilation"
msgstr ""
msgstr "defprotocolは動的であり、事前コンパイルの必要は無い"

#. type: Plain text
#: en/content/reference/protocols.adoc:56
Expand All @@ -175,6 +195,9 @@ msgid ""
"interface my.ns.Protocol. The interface will have methods corresponding to the protocol functions, and the protocol "
"will automatically work with instances of the interface."
msgstr ""
"https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/defprotocol[defprotocol]は自動的にプロトコルと同"
"じ名前のインターフェースを生成する。e.g my.ns/Protocolからはmy.ns.Protocolが生成される。このインターフェースはプロトコ"
"ル関数に対応するメソッドを持ち、プロトコルはこのインターフェースのインスタンスと自動的に協調動作する。"

#. type: Plain text
#: en/content/reference/protocols.adoc:58
Expand All @@ -184,6 +207,10 @@ msgid ""
"or https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/reify[reify], as they support protocols "
"directly:"
msgstr ""
"https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/deftype[deftype]、https://clojure.github.io/"
"clojure/clojure.core-api.html#clojure.core/defrecord[defrecord]、もしくはhttps://clojure.github.io/clojure/clojure."
"core-api.html#clojure.core/reify[reify]はプロトコルを直接サポートしているため生成されるインターフェースを利用する必要"
"は無い:"

#. type: delimited block -
#: en/content/reference/protocols.adoc:64
Expand All @@ -193,6 +220,9 @@ msgid ""
" (foo [x])\n"
" (bar-me [x] [x y]))\n"
msgstr ""
"(defprotocol P\n"
" (foo [x])\n"
" (bar-me [x] [x y]))\n"

#. type: delimited block -
#: en/content/reference/protocols.adoc:70
Expand All @@ -204,18 +234,23 @@ msgid ""
" (bar-me [x] b)\n"
" (bar-me [x y] (+ c y)))\n"
msgstr ""
"(deftype Foo [a b c]\n"
" P\n"
" (foo [x] a)\n"
" (bar-me [x] b)\n"
" (bar-me [x y] (+ c y)))\n"

#. type: delimited block -
#: en/content/reference/protocols.adoc:72
#, no-wrap
msgid "(bar-me (Foo. 1 2 3) 42)\n"
msgstr ""
msgstr "(bar-me (Foo. 1 2 3) 42)\n"

#. type: Title =
#: en/content/reference/protocols.adoc:72
#, no-wrap
msgid "> 45"
msgstr ""
msgstr "> 45"

#. type: delimited block -
#: en/content/reference/protocols.adoc:80
Expand All @@ -228,19 +263,27 @@ msgid ""
" (bar-me [this] x)\n"
" (bar-me [this y] x))))\n"
msgstr ""
"(foo\n"
" (let [x 42]\n"
" (reify P\n"
" (foo [this] 17)\n"
" (bar-me [this] x)\n"
" (bar-me [this y] x))))\n"

#. type: delimited block -
#: en/content/reference/protocols.adoc:82
#, no-wrap
msgid "> 17\n"
msgstr ""
msgstr "> 17\n"

#. type: Plain text
#: en/content/reference/protocols.adoc:85
msgid ""
"A Java client looking to participate in the protocol can do so most efficiently by implementing the protocol-"
"generated interface."
msgstr ""
"プロトコルに参加したいJavaクライアントは、プロトコルによって生成されるインターフェースを実装することで効率よくプロトコ"
"ルに参加することができる。"

#. type: Plain text
#: en/content/reference/protocols.adoc:87
Expand All @@ -249,6 +292,8 @@ msgid ""
"participate in the protocol) can be provided using the https://clojure.github.io/clojure/clojure.core-api."
"html#clojure.core/extend[extend] construct:"
msgstr ""
"プロトコルはthe https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/extend[extend]機能を使用すること"
"で外部から実装を追加する(自分がコントロールしないクラスや型をプロトコルに参加させるためには必要となる)ことができる:\n"

#. type: delimited block -
#: en/content/reference/protocols.adoc:98
Expand All @@ -263,25 +308,36 @@ msgid ""
" {...}\n"
"...)\n"
msgstr ""
"(extend AType\n"
" AProtocol\n"
" {:foo an-existing-fn\n"
" :bar (fn [a b] ...)\n"
" :baz (fn ([a]...) ([a b] ...)...)}\n"
" BProtocol\n"
" {...}\n"
"...)\n"

#. type: Plain text
#: en/content/reference/protocols.adoc:101
msgid "extend takes a type/class (or interface, see below), a one or more protocol + function map (evaluated) pairs."
msgstr ""
"extendは型/クラス(もしくはインターフェース、下記参照)と一つ以上のプロトコル+関数マップ(評価済み)のペアを受け取る。"

#. type: Plain text
#: en/content/reference/protocols.adoc:103
msgid ""
"Will extend the polymorphism of the protocol's methods to call the supplied functions when an AType is provided as "
"the first argument"
msgstr ""
msgstr "第一引数にATypeが渡された際に、与えられた関数が呼び出されるようにプロトコルのポリモーフィズムを拡張する"

#. type: Plain text
#: en/content/reference/protocols.adoc:105
msgid ""
"Function maps are maps of the keywordized method names to ordinary fns ** this facilitates easy reuse of existing fns "
"and maps, for code reuse/mixins without derivation or composition"
msgstr ""
"関数マップはキーワード化されたメソッド名から通常のfnのマップで、 ** 継承や合成に頼ることなく、既存の関数とマップの再利"
"用やミックスインを簡単にする。"

#. type: Plain text
#: en/content/reference/protocols.adoc:110
Expand All @@ -291,21 +347,25 @@ msgid ""
"one interface, both of which implement the protocol *** if one interface is derived from the other, the more derived "
"is used, else which one is used is unspecified."
msgstr ""
"インターフェースに対してプロトコルを定義することが出来、 ** これは主にホスト(例: Java)との連携を簡単にするためのものだ"
"が ** 偶発的に実装の多重継承の可能性をもたらす *** クラスは複数のインターフェースから継承することが出来るため、継承す"
"るインターフェースが同じプロトコルを実装する場合、 *** インターフェース間に継承関係があれば派生している方が使用され、"
"それ以外の動作場合は定義されない。"

#. type: Plain text
#: en/content/reference/protocols.adoc:111
msgid "The implementing fn can presume first argument is instanceof AType"
msgstr ""
msgstr "実装のfnは最初の引数がAtypeのインスタンスであるとみなす。"

#. type: Plain text
#: en/content/reference/protocols.adoc:112
msgid "You can implement a protocol on _**nil**_"
msgstr ""
msgstr "_**nil**_ に対してもプロトコルを定義することが出来る。"

#. type: Plain text
#: en/content/reference/protocols.adoc:113
msgid "To define a default implementation of protocol (for other than nil) just use Object"
msgstr ""
msgstr "プロトコルのデフォルトの実装(nil以外)を定義したい場合は、Objectを使用すれば良い。"

#. type: Plain text
#: en/content/reference/protocols.adoc:115
Expand All @@ -315,18 +375,23 @@ msgid ""
"extenders[extenders] , and https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/satisfies"
"%3F[satisfies?] ."
msgstr ""
"プロトコルは完全に具体化され、リフレクションを http://clojure.github.io/clojure/clojure.core-api.html#clojure.core/"
"extends%3F[extends?] 、 http://clojure.github.io/clojure/clojure.core-api.html#clojure.core/extenders[extenders] 、及"
"び http://clojure.github.io/clojure/clojure.core-api.html#clojure.core/satisfies%3F[satisfies?] でサポートする。"

#. type: Plain text
#: en/content/reference/protocols.adoc:117
msgid ""
"Note the convenience macros https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/extend-type[extend-"
"type] , and https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/extend-protocol[extend-protocol]"
msgstr ""
"便利なマクロ http://clojure.github.io/clojure/clojure.core-api.html#clojure.core/extend-type[extend-type]と http://"
"clojure.github.io/clojure/clojure.core-api.html#clojure.core/extend-protocol[extend-protocol] 知っておくと良い。"

#. type: Plain text
#: en/content/reference/protocols.adoc:118
msgid "If you are providing external definitions inline, these will be more convenient than using *extend* directly"
msgstr ""
msgstr "*extend* を直接使うよりも、インラインで外部の定義を書く方が便利である。"

#. type: delimited block -
#: en/content/reference/protocols.adoc:127
Expand All @@ -339,12 +404,18 @@ msgid ""
" (bar [x y] ...)\n"
" (baz ([x] ...) ([x y zs] ...)))\n"
msgstr ""
"(extend-type MyType\n"
" Countable\n"
" (cnt [c] ...)\n"
" Foo\n"
" (bar [x y] ...)\n"
" (baz ([x] ...) ([x y zs] ...)))\n"

#. type: delimited block -
#: en/content/reference/protocols.adoc:129
#, no-wrap
msgid " ;expands into:\n"
msgstr ""
msgstr " ;以下のように展開される:\n"

#. type: delimited block -
#: en/content/reference/protocols.adoc:136
Expand All @@ -357,3 +428,9 @@ msgid ""
" {:baz (fn ([x] ...) ([x y zs] ...))\n"
" :bar (fn [x y] ...)})\n"
msgstr ""
"(extend MyType\n"
" Countable\n"
" {:cnt (fn [c] ...)}\n"
" Foo\n"
" {:baz (fn ([x] ...) ([x y zs] ...))\n"
" :bar (fn [x y] ...)})\n"