Changes to Clojure in Version 1.1

Changes to Clojure in Version 1.1

= CONTENTS =

1 Deprecated and Removed Features
    1.1 add-watcher, remove-watcher
    1.2 add-classpath
    1.3 ^ reader macro
    1.4 clojure.parallel
    1.5 clojure.lang.Repl, clojure.lang.Script
2 New Features in clojure.core
    2.1 Primitive Array Generators
    2.2 Casting to Primitive Arrays
    2.3 Chunked Sequences
    2.4 Futures
    2.5 Promises
    2.6 Futures vs. Promises
    2.7 Transients
    2.8 User-controlled Thread Bindings
    2.9 Ref History
    2.10 Function pre- and postconditions
    2.11 Miscellaneous
3 New Namespaces
    3.1 clojure.test
    3.2 clojure.test.junit
    3.3 clojure.stacktrace
    3.4 clojure.walk
    3.5 clojure.template
4 Closed Tickets



= 1 Deprecated and Removed Features =

== 1.1 add-watcher, remove-watcher ==

The functions add-watcher and remove-watcher are gone, but they can be
implemented in terms of add-watch and remove-watch.

add-watcherとremove-watcherは廃止されました、ただし、
これらはadd-watchとremove-watchを使って実装できます。

The difference is that a "watcher" was only activated when the watched
reference changed to a *different* state, whereas a "watch" is
activated whenever the reference *might* have changed state.

違いは、watcher系は観察対象の参照が「別の」状態に変更された時だけ、
アクティブになることです。
watch系は参照が変更「された」時にはいつでもアクティブになります。

Watches are still considered an experimental feature.

watch系はまだ試験的な機能としての扱いです。

== 1.2 add-classpath ==

This function can not be made to work in many environments. Always
use Java's built-in mechanisms to control the classpath.

この機能はいろいろな環境で動作するようになっていません。
クラスパスを制御するにはJavaにビルトインされたメカニズムを
使ってください。

== 1.3 ^ reader macro ==

The ^ reader macro has been deprecated as a shortcut for meta in the
hopes that it can eventually replace the #^ reader macro.

^リーダマクロは非推奨になりました。
最終的には#^リーダマクロによって置き換えることが望ましいです。

== 1.4 clojure.parallel ==

The clojure.parallel namespace has been deprecated. Eventually it will
be replaced with a faster and more idiomatic alternative based on the
JDK7 ForkJoin library. A preview of this work is already available in
the 'par' branch of Clojure.

clojure.parallel名前空間は非推奨になりました。
最終的には、JDK7のForkJoinライブラリをベースにした、
より高速で正確なものに置き換わります。
この作業のプレビュー版は既にClojureのparブランチにあります。

== 1.5 clojure.lang.Repl, clojure.lang.Script ==

The launch classes clojure.lang.Repl and clojure.lang.Script are both
deprecated in favor of clojure.main. Run clojure.main with the -h
argument for the new command-line syntax.

起動用クラスであるclojure.lang.Replとclojure.lang.Script
はどちらも非推奨とし、clojure.mainを優先します。
新しいコマンドライン引数を確認するには、-h引数を付けて
clojure.mainを実行します。

= 2 New Features in clojure.core =

== 2.1 Primitive Array Generators ==

(just like int-array, double-array)

  * boolean-array : New
  * byte-array : New
  * char-array : New
  * short-array : New


== 2.2 Casting To Primitive Arrays ==

(just like ints, doubles)

  * booleans : New
  * bytes : New
  * chars : New
  * shorts : New


== 2.3 Chunked Seqs ==

Some Clojure data structures now yield chunked seqs, which, in
addition to satisfying the normal item-at-a-time seq interface, also
support processing data sequentially by small blocks called
'chunks'. This can provide greater efficiency by leveraging the
structure of the data and amortizing the overhead of sequential
access. Some of the sequence processing functions (like map and
filter) are now chunk-aware and leverage this efficiency.

Clojureのデータ構造のいくつかはチャンク化されたシーケンスを扱う
ようになりました。
つまり、通常の一カ所1項目の順次インタフェースを満足した上で、
さらにデータを「チャンク」と呼ばれる小さなブロックに分け、
順次データを処理できるようになります。
データの構造を活用し、
順次アクセスのオーバーヘッドを解消することで、
大幅な効率向上ができます。
いくつかの順次処理関数(mapやfilterなど)はチャンク対応となり、
この効果を活用できます。

Consumption of chunked-seqs as normal seqs should be completely
transparent. However, note that some sequence processing will occur up
to 32 elements at a time. This could matter to you if you are relying
on full laziness to preclude the generation of any non-consumed
results. An interface to force single-item consumption of chunked seqs
is still being designed. Please share any use cases where chunked
processing has resulted in behavioral differences that matter to you
on the Clojure Google group.

通常のシーケンスとしてチャンク化シーケンスを使用することは、
完全に透過的であるべきです。
しかし、いくつかの順次処理は同時に最大32要素までしか扱えません。
非消費型の結果を生成しない、完全遅延処理を期待している
場合は注意してください。
チャンク化インタフェースで、1項目消費を強制するインタフェース
は現在設計中です。
チャンク化処理が別の振る舞いをする利用例を、Clojure Google グループで
共有しましょう 。

The following fns should be considered implementation details subject
to change, but can be used for experimentation with building your own
chunked-seq functions from scratch. See map and filter as examples.

以下のfnは変更の可能性がある、実装詳細として扱われるべきです。
ただし、あなた自身のチャンク化シーケンスを最初から作るときに
試験的に使用することができます。
mapやfilterを例としてみてください。

  * chunk : New
  * chunk-buffer : New
  * chunk-append : New
  * chunk-first : New
  * chunk-rest : New
  * chunk-next : New
  * chunk-cons : New
  * chunked-seq? : New


== 2.4 Futures ==

Futures represent asynchronous computations. They are a way to get
code to run in another thread, and obtain the result.

futureは非同期の計算を表現します。
これらは別のスレッドへのコードの受け渡しや結果の取得の方法となります。

  * future : New
  * future? : New
  * future-done? : New
  * future-cancel : New
  * future-cancelled? : New


== 2.5 Promises ==

A promise is a synchronization construct that can be used to deliver a
value from one thread to another. Until the value has been delivered,
any attempt to dereference the promise will block. It thus enables
dataflow-style programming.

promiseは、あるスレッドから別のスレッドへ値を渡すときに使うことの出来る、
同期処理の構成要素です。
値が渡されるまで、promiseでのデリファレンスの試みはブロックされます。
これによりデータフロー型のプログラミングが可能になります。

  * promise : New
  * deliver : New


== 2.6 Futures vs. Promises ==

A future is associated with a computation, whereas a promise is just a
handoff reference.

futureは計算と関連しています。
promiseは参照のハンドオフでしかありません。

== 2.7 Transients ==

See: http://clojure.org/transients

  * transient : New
  * persistent! : New
  * conj! : New
  * assoc! : New
  * dissoc! : New
  * pop! : New
  * disj! : New


== 2.8 User-Controlled Thread Bindings ==

  * push-thread-bindings : New
  * pop-thread-bindings : New
  * get-thread-bindings : New
  * with-bindings* : New
  * with-bindings : New
  * bound-fn* : New
  * bound-fn : New


== 2.9 Ref History ==

  * ref : Updated
  * ref-history-count : New
  * ref-min-history : New
  * ref-max-history : New


== 2.10 Function pre- and postconditions ==

Functions support specifying runtime pre- and postconditions.

関数は実行時の事前条件、事後条件の指定をサポートします。

See: http://clojure.org/special_forms


== 2.11 Miscellaneous ==

  * juxt : New
  * import : Now a macro form
  * assert : Now with *assert* binding
  * slurp : Now with encoding parameter
  * with-loading-context : New



= 3 New Namespaces =

Complete documentation for all namespaces is in the source and API
docs: http://richhickey.github.com/clojure/


== 3.1 clojure.test ==

The test framework formerly known as clojure.contrib.test-is.


== 3.2 clojure.test.junit ==

An extension to clojure.test for JUnit-style XML output. This enables
using JUnit reporting tools with clojure.test.


== 3.3 clojure.stacktrace ==

A few utility functions for printing Java stacktraces in a format that
distinguishes between Clojure function calls and Java method calls.


== 3.4 clojure.walk ==

A simple tree walker for transforming data structures. Similar in
intent to clojure.zip, but less flexible. Useful when you want to
call a function on every value in a complex, nested data structure.

Includes some examples such as stringify-keys, which replaces all
keywords in a map with strings, and macroexpand-all, a quick-and-dirty
macroexpansion tester. Note: macroexpand-all is NOT 100% correct, it
just recursively tries to macroexpand a form; it does not correctly
interpret special forms such as let.


== 3.5 clojure.template ==

Macros that apply a "template expression" to a list of forms. Used to
implement the "are" macro in clojure.test.



= 4 Closed Tickets =

http://www.assembla.com/spaces/clojure/tickets?milestone_id=93750&tickets_report_id=5

タグ:

+ タグ編集
  • タグ:

このサイトはreCAPTCHAによって保護されており、Googleの プライバシーポリシー利用規約 が適用されます。

最終更新:2010年01月04日 12:02