Created
August 1, 2010 06:04
-
-
Save qertoip/503008 to your computer and use it in GitHub Desktop.
Revisions
-
qertoip revised this gist
Aug 21, 2010 . 1 changed file with 11 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,13 @@ ; Definicja przestrzeni nazw z importem funkcji Clojura i klas Javy (ns qertoip (:use [clojure.contrib.io :only [to-byte-array]] [clojure.contrib.java-utils :only [as-file]]) (:import [java.io File FileOutputStream])) ; W poniższy sposób można zaimportować *.clj lub *.class wymienione z nazwy, ; znajdujące się w CLASSPATH. Nie można zaimportować całego pakietu. (use '[lib-name :only (var-names+)]) -
qertoip revised this gist
Aug 1, 2010 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ ; Jak wczytać plik clj do REPL-a? Jeśli nie ma przestrzeni nazw, ; wystarczy load lub load-file (load-file "./temp.clj") ; z zadanej ścieżki (load "temp") ; z CLASSPATH -
qertoip revised this gist
Aug 1, 2010 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ ; Jak utworzyć obiekt Javy? (new Thread (fn [] ()) ) -
qertoip revised this gist
Aug 1, 2010 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ ; Jak wołać metody obiektu? (.metodaObiektu obiekt) -
qertoip revised this gist
Aug 1, 2010 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,6 +6,6 @@ (dosync ; force transaction (alter accounts conj (struct account 1 139.78) ) ) -
qertoip revised this gist
Aug 1, 2010 . 1 changed file with 11 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ (defstruct account :id :balance) (def accounts (ref #{}) ) (dosync ; force transaction (alter accounts conj (struct 1 139.78) ) ) -
qertoip revised this gist
Aug 1, 2010 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,8 @@ ; W clojure nie ma klas znanych z programowania obiektowego. ; Najbliższym odpowiednikiem jest struktura z polami, coś jak struct w C. (defstruct person :first-name :last-name) (struct person "Piotr" "Wlodarek") ; lub (struct-map person :first-name "Piotr", :last-name "Wlodarek") -
qertoip revised this gist
Aug 1, 2010 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ ; odpowiednik w ruby: ; compositions.select{|c| c.name == "Requiem" }.map( &:composer ) (for [c compositions :when (= "Requiem" (:name c))] (:composer c)) -
qertoip revised this gist
Aug 1, 2010 . 4 changed files with 14 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ ; Można w ten sposób zaimportować *.clj lub *.class wymienione z nazwy, ; znajdujące się w CLASSPATH. Nie można zaimportować całego pakietu. (use '[lib-name :only (var-names+)]) This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ ; W clojure nie ma klas znanych z programowania obiektowego. ; Najbliższym odpowiednikiem jest struktura z polami, coś jak struct w C. (defstruct person :first-name :last-name) This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ ; Jak idiomatycznie wołać statyczne metody Javy? (Character/isWhitespace 32) This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ (use '[clojure.contrib.str-utils :only (str-join)]) (str-join "-" ["ala" "ma" "kota"]) -
qertoip revised this gist
Aug 1, 2010 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,4 @@ ; odpowiednik_switch_case.clj ; cond to macro, zwróci nil jeśli żaden z warunków nie był spełniony (cond -
qertoip revised this gist
Aug 1, 2010 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ ; cond to macro, zwróci nil jeśli żaden z warunków nie był spełniony (cond (< x 10) "less" -
qertoip created this gist
Aug 1, 2010 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ ' cond to makro; zwróci nil jeśli żaden z warunków nie był spełniony (cond (< x 10) "less" (> x 10) "more" )