DenkzeitWiki

Suchen:

Aktuelle Änderungen Printable View Änderungen Bearbeiten

CaptainCrunch > JohnDraper > CategoriesAndTags > CharlesFGoldfarb > CharlesPetzold > CheckedExceptions > Exceptions > ClearType > ClojureBatteries > ClojureClr > ClojureGuerilla > ClojureIdomaticSnippets > ClojureInDeutschland > ClojureRepls > ClojureScript > ClojureStreams > ClojureSequencesClear Trail
Main /

Clojure Sequences

(weitergeleitet von Main.ClojureStreams)

Clojure
FunctionalProgramming
LazyEvaluation


 (def it (iterate #(% %) 0))
 (time   (take 100000000000000000000 it)) ; "Elapsed time: 0.555378 msecs"
 (time   (take 100000000000000000000 it)) ; "Elapsed time: 0.025212 msecs"



 (def whole-numbers (iterate inc 0))
 (defn whole-numbers [] (iterate inc 0))
  • RichHickey
    • The sequence abstraction in Clojure is the list abstraction of Lisp.
    • Making seqs 'non-caching' makes no sense because they are no longer the same abstraction. Lazy != ephemeral. Seqs and streams are different abstractions.
  • In a world with lots of processing power and not that much bandwidth (not to mention the overhead of garbage collection and various other things) I never cache anything until I know it will provide a distinct benefit.



Streams


Edit - BackLinks - Tags - Page Hist - Print - Changes - Home - Orphans - Help

Zuletzt geändert am 21.06.2009 23:02 Uhr und seit 7. April 2005 1371 aufgerufen.