ANN: a Clojure docs site, and github organization

2012-10-05 Thread Michael Jaaka
why don't you use advantage of html and split the site into two panes on left the table of content in hiperlink form and on the right the content reloaded on clickin in link in toc also use numbers for chapters and subchapters dont use bullets for lists, its harder to make references also add disq

The Value of Values

2012-08-23 Thread Michael Jaaka
I'm just after watching the Rich's keynote - the value of values. Man this is outstanding! If i only knew that before, my newest information system would be much easier to debug, state of entites were easier to reason and additionally I would had history, even by using current RDBM. You have poin

currying and partial evaluation

2012-08-13 Thread Michael Jaaka
nice, thanks a lot -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group,

Distributed transactions

2011-12-31 Thread Michael Jaaka
Is there any attempt to make distributed transactions? The usage scenario is the same like in JEE apps. I mean, there is a web service call, the transaction is started, there are some changes to db, some jms sends and when there is no failure all is commited. Maybe someone is already using glassfis

Clojurescript, is it ready yet?

2011-12-15 Thread Michael Jaaka
Hi! Is clojurescript ready for wide water? How far i can only see obscure compilation env and low level ops on html elemnts. Are there any plans to start building second gwt? Swing 2.0? Google started darts as general purpose language with web browser's VM aka javascript. They want even to repla

Re: Expanding expression with macro

2011-12-15 Thread Michael Jaaka
Nothing is wrong with do I just missed the point how the macro works Thanks! On 15 Gru, 13:37, Meikel Brandmeyer wrote: > Hi, > > macros can only return one value. So multiple forms have to be wrapped into a > do. > > The do never hurts. Why do you want to get rid of it? > > Sincerely > Meikel

Expanding expression with macro

2011-12-15 Thread Michael Jaaka
Hi! I have something like this: (defmacro testme[ & ops ] `(do ~@(for[ op ops ] `(println ~op (macroexpand '(testme 1 2 3)) (testme 1 2 3) How can I change the macro so "do" wouldn't be required? When I do doseq instead of for the resulting value is nill. (defmacr

Re: Opposite function to cons, but in terms of construction, not destruction.

2011-12-12 Thread Michael Jaaka
Thanks to all for responses. I just wanted to use that in higher-order composition in mind, not to construct any data structures. I have tweaked a bit the function: (defn conr[ col item ] (lazy-seq (if (seq col) (cons (first col) (conr (rest col) ite

Opposite function to cons, but in terms of construction, not destruction.

2011-12-10 Thread Michael Jaaka
Is there something like: (defn snoc[ col item ] (lazy-seq (if (seq col) (let[ [f & r] col ] (if (seq r) (cons f (snoc r item)) (cons f [i

Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-23 Thread Michael Jaaka
Here is a diff of fix http://pastebin.com/KE6U3Pqb On Nov 23, 12:13 am, Michael Jaaka wrote: > Well, it is easy to break tests on any system. All you need to do is to put > space into file name path. > For example in clojure <https://github.com/clojure/clojure> / > test&

Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-22 Thread Michael Jaaka
Well, it is easy to break tests on any system. All you need to do is to put space into file name path. For example in clojure / test/ clojure /

Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-22 Thread Michael Jaaka
I'm not and don't feel like an expert to contribute. However I have found that this is a common pitfall Here is the full story described http://maven.apache.org/plugin-developers/common-bugs.html#Converting_between_URLs_and_Filesystem_Paths The same is in official doc from Oracle On 22 Lis, 12:4

Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-22 Thread Michael Jaaka
"clojure.java.io" "test-reader-writer") ] (println "valid on cygwin and windows" (reader (.getPath (.toURI f) (let[ f (temp-file "clojure.java.io" "test-reader-writer") ] (println "valid only on windows" (reader (.toU

Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-22 Thread Michael Jaaka
Sorry the line is 46 not 56 in the file https://github.com/richhickey/clojure/blob/master/test/clojure/test_clojure/java/io.clj On Nov 22, 11:39 am, Michael Jaaka wrote: > I have made some investigation and I noticed a problem at line 56 in > test/clojure/test_clojure/java/io.clj > >

Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-22 Thread Michael Jaaka
Nov 22, 10:15 am, Roberto Mannai wrote: > The classpath option -cp is not handling correctly the spaces. I'd > suggest you to not have spaces in the Windows's paths. > > Install Java not in "c:\Program Files", but for example in c:\develop\Java6 > > On Tue, N

Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-22 Thread Michael Jaaka
Maybe I can fix it? Just point me the routine for building path. I will extract it and make unit test which reproduces this error. Than I will fix it. Maybe it will help in both cases - on standalone emacs for windows and emacs in cygwin. On Nov 22, 10:04 am, Michael Jaaka wrote: > Here is to

Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-22 Thread Michael Jaaka
lein\\self-installs\\leiningen-1.6.0-standalone.jar. Program will exit.\nException in thread \"main\" ") clojure-jack-in-sentinel(# "finished\n") On Nov 22, 8:55 am, Roberto Mannai wrote: > If you're having problems with cygwin, you could use Emacs/lein with

Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-21 Thread Michael Jaaka
\slime.el Beside this in elpa I have clojure-mode-1.11.4, clojure-project- mode-1.0, clojurescript-mode-0.5, levenshtein-1.0, project-mode-1.0. On Nov 21, 5:54 pm, Chris Perkins wrote: > On Monday, November 21, 2011 11:27:04 AM UTC-5, Michael Jaaka wrote: > > > Then I entered into Clo

Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-21 Thread Michael Jaaka
ect, used: M-x clojure-jack-in (almost there!!!) And got exception: Unable to resolve symbol print-doc. LOL :-) Any suggestions? On Nov 21, 5:16 pm, Michael Jaaka wrote: > Have tried to put in .emacs > > (when >     (load >      (expand-file-name "~/.emacs.d/elpa

Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-21 Thread Michael Jaaka
.org/packages/" but this resource doesn't have builtin-packages or somthing On Nov 21, 5:08 pm, Michael Jaaka wrote: > I have added (add-to-list 'package-archives '("marmalade" . "http:// > marmalade-repo.org/packages/")) > to .emacs but getting Warn

Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-21 Thread Michael Jaaka
I have added (add-to-list 'package-archives '("marmalade" . "http:// marmalade-repo.org/packages/")) to .emacs but getting Warning initialziation: An error occured while loading .emacs Symbols value as variable is void: package-archives On Nov 21, 4:03 pm, Chris Perkins wrote: > I'm far from bein

Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-21 Thread Michael Jaaka
The list of clojure- commands decreased to clojure-enable-slime-on- existing-buffers and clojure-mode On Nov 21, 4:03 pm, Chris Perkins wrote: > I'm far from being an expert on this stuff, but I did go through all the > same frustration as you are going through, about 2 years ago, so I'll try >

Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-21 Thread Michael Jaaka
The only available clojure-mode is 1.7.1 The package is 0.9 The package.el I have installed from "http://tromey.com/elpa/package- install.el" I can see also slime in version 20100404, slime-repl in the same and swank-clojure in 1.1.0, the swank-clojure doesn't want to install because clojure-mode-1

Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-21 Thread Michael Jaaka
is Perkins wrote: > On Monday, November 21, 2011 9:27:00 AM UTC-5, Michael Jaaka wrote: > > > now as tutorial onhttps://github.com/technomancy/clojure-modestates used: > > > M-x run-lisp > > > and got Searching for program: no such file or directory, lisp > > &

Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-21 Thread Michael Jaaka
[ a closing ] doesn't happen so I suppose that paraedit is turned off On Nov 21, 3:27 pm, Michael Jaaka wrote: > Manage to install package.el > > I have put > >   (let ((buffer (url-retrieve-synchronously >                "http://tromey.com/elpa/package-install.el";)

Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-21 Thread Michael Jaaka
Manage to install package.el I have put (let ((buffer (url-retrieve-synchronously "http://tromey.com/elpa/package-install.el";))) (save-excursion (set-buffer buffer) (goto-char (point-min)) (re-search-forward "^$" nil 'move) (eval-region (point) (point-max))

Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-21 Thread Michael Jaaka
My Emcas is GNU Emacs 23.3.1 (2011-08-14 on fiona) On Nov 21, 2:30 pm, Michael Jaaka wrote: > Well I thing that I don't have package.el > > Doing > > ;; add to ~/.emacs.d/init.el if you aren't already using Marmalade. > (require 'package)

Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-21 Thread Michael Jaaka
itialize) Didn't change anything. When I opened test.clj and ran M-x eval-buffer I got that symbol's function definition is void: def So where to put package.el? On Nov 21, 2:18 pm, David Nolen wrote: > Have you looked at > this,http://dev.clojure.org/display/doc/Getti

Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-21 Thread Michael Jaaka
here any chance it will be cleaned up? Maybe there should be ENV variable which defines base version of clojure to which lein, swank, ant, mvn, clojure, emacs, clojure-contrib would align? On Nov 21, 1:13 pm, Michael Jaaka wrote: > Hi! > > When running ant command in cygwin on content clon

Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-21 Thread Michael Jaaka
Hi! When running ant command in cygwin on content cloned from http://github.com/clojure/clojure.git I get 2 errors: [java] Testing clojure.test-clojure.java.io [java] [java] ERROR in (test-streams-defaults) (FileOutputStream.java:-2) [java] expected: (= content (do (spit (.toUR

Re: IRC client, clojure channel

2011-11-19 Thread Michael Jaaka
The direct link is http://webchat.freenode.net/?channels=clojure On 19 Lis, 09:59, Michael Jaaka wrote: > Hi, > > some time ago I've used to use mac irc client to log in onto Clojure > channel. People on that chnnel helped me to learn Clojure. But one day > there was a

IRC client, clojure channel

2011-11-19 Thread Michael Jaaka
Hi, some time ago I've used to use mac irc client to log in onto Clojure channel. People on that chnnel helped me to learn Clojure. But one day there was a strange behaviour of channel which required me to register. I abandoned the channel because the procedure for registration didn't worked for m

Re: Java / clojure interop, invoking methods and perserving thread binding

2011-11-17 Thread Michael Jaaka
v 17, 10:08 am, Michael Jaaka wrote: > Well, I have checked different possibilites and the problem is not > about facade but lies in Clojure "eval" which is called on Clojure > structure done from transforming XML to Clojure structures. This eval > doesn't see context defi

Re: Java / clojure interop, invoking methods and perserving thread binding

2011-11-17 Thread Michael Jaaka
t restored. Any help? On Nov 17, 9:55 am, Michael Jaaka wrote: > Hi! > > I'm using Clojure from Java via RT.loadResourceScript(...) and then > RT.var(...) > However this only works when I do > > Var.pushThreadBindings(THREAD_BINDING) > and > Var.popThreadBindings() >

Java / clojure interop, invoking methods and perserving thread binding

2011-11-17 Thread Michael Jaaka
Hi! I'm using Clojure from Java via RT.loadResourceScript(...) and then RT.var(...) However this only works when I do Var.pushThreadBindings(THREAD_BINDING) and Var.popThreadBindings() around RT.var().invoke(), where THREAD_BINDING is a thread binding got during script loading via (def ^:dyn

Re: Multiple try via macro

2011-11-09 Thread Michael Jaaka
Thank you. Is loop and not for example let, for recursion optimalization? On Nov 9, 2:51 pm, Stuart Halloway wrote: > > Hi! > > > I would like to write macro, which tries to evalute one of statements. > > If exception happens the next statement is taken, if not then rest of > > expressions execu

Multiple try via macro

2011-11-09 Thread Michael Jaaka
Hi! I would like to write macro, which tries to evalute one of statements. If exception happens the next statement is taken, if not then rest of expressions execution is stopped. (defmacro try-this[ & body ] `(if (seq ~body) (try ~(f

Re: Solving this with logic programing

2011-11-06 Thread Michael Jaaka
Well, despite of fact that core.logic is fine tool and is worth of study, I have implemented own solution to my problem. Here is a full implementation: http://pastebin.com/Z5BETZd3 And the idea is to index each value in record perserving the record and meaning of values. Then search by these va

Re: Solving this with logic programing

2011-11-05 Thread Michael Jaaka
Btw. Is there any fine tutorial for core.logic? By fine I mean something like learn haskell for great good. On 5 Lis, 20:26, Michael Jaaka wrote: > Now is ok, easy to grasp. How the lein dep declaration and clj import > looks? > Thank you both. > > On 5 Lis, 20:11, Dav

Re: Solving this with logic programing

2011-11-05 Thread Michael Jaaka
find unsatisfactory about this interface? > > On Sat, Nov 5, 2011 at 2:46 PM, Michael Jaaka > wrote: > > > > > > > > > > > Thanks, it gave me insight into that framework. > > Unfortunately it doesn't look friendly in usage. > > Looks like th

Re: Solving this with logic programing

2011-11-05 Thread Michael Jaaka
e ops states] > >                                        (conde > >                                          ((== role :admin)) > >                                          ((== role :operator))) > >                                        (== q [ops states]) > >        

Solving this with logic programing

2011-11-05 Thread Michael Jaaka
Hi, I would like to use logic programing to describe permissions. The definition is We have set of triples which looks like: Set of roles; set of operations; set of states Triples are defined in scope of some entity with states, wildcard is defined with _ All I need is to answer on some operati

Re: ANN: Korma - a SQL DSL for Clojure

2011-11-03 Thread Michael Jaaka
Geat studf, good level of abstraction. definitly worth of Using. Only one thing, color of theme, impractical, it would be good for marketing, but not for informational site, it should be simple as your lib, black fonts on white background. Maybe this is a matter of screen but on ipad device it i

Re: core.match 0.2.0-alpha6, breaking change for or patterns

2011-10-28 Thread Michael Jaaka
Can you give examples of usage for each position? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. T

Re: Literate programming

2011-10-28 Thread Michael Jaaka
Maybe COBOL already solves the problem which Literate Programming want to solve? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be

Re: Pattern matching for map content

2011-10-25 Thread Michael Jaaka
Thx, this is exactly what I need. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe fr

Re: Is Clojure Simple?

2011-10-25 Thread Michael Jaaka
Something is simple as long as your mental model is simple to track. Something which doesn't cause you headache. If you can't build mental model in your head, then its definitely not simple. Every time you think I have mental model which works like this, but before this I must remember about thi

Pattern matching for map content

2011-10-25 Thread Michael Jaaka
Hi! Pattern matching is fine for sequence or vector destruction. Is is possible to destruct map and make pattern machting? For example I would like to make constraint for to some query service. It would be done as map for example: { :name "Tom" :surname "Jakarta" :birthDate (Date.) } or { :pers

Re: Rich Hickey: "Simple Made Easy" from Strange Loop 2011

2011-10-22 Thread Michael Jaaka
another shark of the IT, of course hire me for Great Good in your company, I can work for you on eastern Europe. On 21 Paź, 23:10, Michael Jaaka wrote: > Bravo, bravo! Great speech, I'm already looking for such esseys. I'm > already learning haskell and erlang for great good, be

Re: Rich Hickey: "Simple Made Easy" from Strange Loop 2011

2011-10-21 Thread Michael Jaaka
Bravo, bravo! Great speech, I'm already looking for such esseys. I'm already learning haskell and erlang for great good, because all things told about lisp has been already read. I'm also designing system. Because it has some well defined functionality, my first tought was, hey man I will use obec

Re: Macro tutorials?

2011-10-06 Thread Michael Jaaka
Thanks to all! You have helped a lot! Also I will consider reading "Practical Common Lisp". On Oct 6, 9:42 am, Stefan Kamphausen wrote: > Hi. > > You might consider reading Peter Seibel's excellent Practical Common Lisp > which has some nice macro-work in it. If after that you're still hungry for

Re: Macro tutorials?

2011-10-05 Thread Michael Jaaka
thods )) (map-fnc (function1 [] "hello") (function2 [a] (println a))) On Oct 5, 11:38 am, Michael Jaaka wrote: > Hi! > > I wrote few apps with clojure. I have used many times macro to expand > expressions and change some control flows. I thought that I know

Macro tutorials?

2011-10-05 Thread Michael Jaaka
Hi! I wrote few apps with clojure. I have used many times macro to expand expressions and change some control flows. I thought that I know macros, but now I know that doing some programming by analogy is not enough. In fact I still don't know the macros works, I don't know when and how is evaluate

Re: defmatch macro

2011-10-03 Thread Michael Jaaka
Cool, if only that macro could expand to function which detects in runtime if one of argument which being matched is seq or vec and call proper routine which is applying :seq or leaving matching expression as for random access. This is just higher level automation, it doesn't breake core functio

Re: pattern matching in clojure

2011-09-30 Thread Michael Jaaka
ce rpn' [] (re-seq #"\S+" input)))) > > > (calculator' " 1 2 10 2 3 + * sum ") > > ;=> 53 > > > core.match isn't well road tested yet, still early days. > > > Thanks! > > Ambrose > > > On Fri, Sep 30, 2011 at

Re: pattern matching in clojure

2011-09-30 Thread Michael Jaaka
xed or explained what is wrong with previous code. See you later! On Sep 30, 10:36 am, Michael Jaaka wrote: > Thanks for feedback. But now I'm came across a problem. I'm studying > "Learn You a Haskell for Great Good!" and I'm on chapter "Functionally > Sol

Re: pattern matching in clojure

2011-09-30 Thread Michael Jaaka
functions fairly close to what you're used from > Haskell. > > > [1]https://github.com/dcolthorp/matchure > > > Christian > > > On Thu, Sep 29, 2011 at 12:03 PM, Michael Jaaka > > wrote: > >> Hi! > > >> Is there any way to define functi

pattern matching in clojure

2011-09-29 Thread Michael Jaaka
Hi! Is there any way to define function with pattern matching in function signature as it is in haskell? Bye! -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new memb

Re: Are futures garbage-collected?

2011-09-28 Thread Michael Jaaka
I'm using futures for queuing jobs to stress test a server, multiple processess,each reciving and futuring job. Works as expected for many days with no problems in cpu and mem usage... Clojure rox. On 28 Wrz, 22:48, Mark wrote: > The future object itself is garbage collected but the thread is n

True diff on any Clojure struct

2011-09-28 Thread Michael Jaaka
Do you know any lib for making diff from nested structures? (diff [ 1 2 3 { 2 3 4 [ 1 2 { 1 2 3 4} ] } #{ 4 5 } ] [ 1 3 { 2 3 4 [ 1 4 { 2 2 3 5} ] } #{ 4 5 } ] ) -> [ 2 { [ 2 { 1 2 3 4 } ] } ] as you can see it behaves like clojure.set/difference and better if you would point the keys in map

Re: Clojure v1.4 - what is new, changed and in development

2011-09-27 Thread Michael Jaaka
Ohh... And it would be nice if hovering with mouse pointer on function name in cheetsheet would show tool tip (made with AJAX; the results would be cached; thought about clojurescript - its a high time to proof its usability) with functions description and signature and after clicking link "mor

Re: Clojure v1.4 - what is new, changed and in development

2011-09-27 Thread Michael Jaaka
Btw. Cheat Sheet doesn't look good on iPad. Some columns are shifted -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with

Clojure v1.4 - what is new, changed and in development

2011-09-27 Thread Michael Jaaka
Hi! I would be nice If after entering on http://clojure.github.com/clojure/branch-master/index.html I could see what is new, what has changed (just bold new methods, cross the removed one and skew the changed one) links and what new concepts are in progress. I think that it is easy to do. For

Re: Sample application as showcase of Clojure DSL / Metaprogramming?

2011-09-26 Thread Michael Jaaka
While the statement that creating any syntax is true for LISP, so for Clojure its not because of missing reader macro ("The read table is currently not accessible to user programs." from http://clojure.org/reader). Nevertheless I found homoiconicity very useful. I turned my XML document (with my i

Re: Partitioning problem

2011-09-23 Thread Michael Jaaka
Good stuff! Thanks! Especially the trick with indexing so the set accepts first state of buckets. Beside this you are ignoring the current candidate computation along rest and just put him into nearest bucket. In mine I'm first looking for the potentially the best and finally put him over there

Partitioning problem

2011-09-23 Thread Michael Jaaka
Hi! I have a sequence of natural numbers and I have to partition them into more or less equals N groups. Partitioning function is just a sum of numbers in a given group. My naive solution is to sort numbers descending then take each number and put into one of N groups in which sum of its elements

Changing behavior

2011-09-22 Thread Michael Jaaka
Hi! I would like to change behavior/semantic for my DSL. So instead of typing this: (constraints (where-and (where :field > 123123) (where :field < 3242432))) I could type this: (where (and (:field > 123123) (:field < 3242432))) The catch is that macro "where" shouldn't interpret its conten

Re: advantage of dynamic typing

2011-09-20 Thread Michael Jaaka
Dynamic typing just relax you at coding and compiling moment. The type interferacing is done at runtime. The pro is less formal coding especially on algorithms and cons that data structures must be documented outside the code unless language supports type specifing. Just read about haskell it will

clojure tutorial for haskell programers?

2011-09-11 Thread Michael Jaaka
Hi, when i first came to clojure world i've started with tutorial for java programers, now i'm reading about haskell and for almost every new feature I know that my favorite language clojure already has that, but i'm not fully sure which feature it is. For example comprehensions are implemented by

Exceptions in Haskell and in Clojure

2011-09-11 Thread Michael Jaaka
Couldn't match expected type `(t, t1)'   against inferred type `(t2, t3, t4)'   In the expression: (8, 11, 5)   In the expression: [(1, 2), (8, 11, 5), (4, 5)]   In the definition of `it': it = [(1, 2), (8, 11, 5), (4, 5)]   This was excerpt from Haskell exception, will Clojure have ever somethin

Re: Clojure in Emacs Seemingly Impossible

2011-09-11 Thread Michael Jaaka
There should be an initiative to built own ide, look at Java history, it become popular when good ide with debugers, docs, highlighting and refactoring appeared. Clojure should have such ide, my vote right now is for clooj, since this is the only one ide written in supported language itself. Just c

Re: Thoughts on CUDA + Clojure

2011-09-08 Thread Michael Jaaka
Why not to translate to any lang? I though about translating clojure to php source code. It differs from jvm and crl (.net) approach that it is not translated to uni language to be run on one platform but translated to form/source understood by targeted hosting platform and ran on it. The clojures

Re: On Lisp with Clojure

2011-09-06 Thread Michael Jaaka
And last tough is that maybe there should be a build in support for trees. Trees are to maps like lists to vectors. They have different characteristic on CRUD operations and CPU/RAM resources. With reader macros it would be possible to implement it by even not bothering Rich Hickey. Also there is

Re: On Lisp with Clojure

2011-09-06 Thread Michael Jaaka
Btw. it looks like Clojure is missing an ability to program reader. It would allow to program a syntax. == 9. The whole language always available. There is no real distinction between read-time, compile-time, and runtime. You can compile or run code while reading, rea

Re: On Lisp with Clojure

2011-09-06 Thread Michael Jaaka
Well, these attempts stop very quickly. But I have found code extract from the book http://lib.store.yahoo.net/lib/paulgraham/onlisp.lisp maybe someone with good knowledge could port it? On Sep 2, 1:16 pm, Eric Lavigne wrote: > > Is there any project on github which goal is to implement all co

On Lisp with Clojure

2011-09-02 Thread Michael Jaaka
Hi! Is there any project on github which goal is to implement all code from On Lisp book in Clojure? There are so many useful concepts. For example pattern maching looks like Business Rules, Query Interpreter looks like Semantic Web Repository and so on.. -- You received this message because you

Simple lisp

2011-08-31 Thread Michael Jaaka
Hi! Can you help me? I need to add to this http://pastebin.com/Ya3tgM5n a support for "if" (with execution in case of true or false) I need this to implement simple lisp in C. Please don't post links to other implementations, just help in that case. Thanks in advance and bye! -- You received t

Re: ClojureScript and lein?

2011-08-30 Thread Michael Jaaka
Ok, I have manage to run clojure script "Hello World" example, even without coping server dir. All I have done was uninstalling all java. Installing Jdk 1.6 update 27 with default paths suggested by installator. Installing cygwin with curl and unzip. And running this self-made script from cygwin

ClojureScript and lein?

2011-08-29 Thread Michael Jaaka
Hello, I wanted to give a try to ClojureScript but from Windows XP. Now I was doing all what is written on github but had to remove -server to obey "missing jvm.dll" problem (even after coping server path there was still a problem about loading some routine) and had to add to ENV Variables CLOJ

Re: Please optimize this with macro (grep and context result grabing)

2011-08-26 Thread Michael Jaaka
Well I think that this is a different case. On 27 Sie, 03:15, gaz jones wrote: > do you know about the re-groups function, or are you just doing this > for an exercise? > > On Fri, Aug 26, 2011 at 6:57 PM, Michael Jaaka > > > > > > > > wrote: > > Hi! &g

Please optimize this with macro (grep and context result grabing)

2011-08-26 Thread Michael Jaaka
Hi! I have got (def *g) (def *g1) (def *g2) (def *g3) (def *g4) (def *g5) (def *g6) (defmacro grep[ pat in & body ] `(do (when-let[ r# (re-matches (re-pattern ~pat) ~in) ] (binding [ *g (first r#) *g1 (get r# 1) *g2 (get r# 2) *g3 (get r# 3)

Web Services with Clojure

2011-08-25 Thread Michael Jaaka
Ok after two days I manage to write framework for publishing and calling webservices (yesterday I asked you for such framework but only RESTful are available). Right now this implementation supports only primitve types and was tested in Java distributed environment (needs to extend to arrays, maps,

Web Services with Clojure

2011-08-24 Thread Michael Jaaka
Beside this is there any framework for dynamic WebServices in clojure? I would like to achive usage scenario like. (declare webservice with its details (define method with signature of input output parameters types) (define another method and so on)) What is required from WS stac

Compojure

2011-08-24 Thread Michael Jaaka
RESTFUL in Clojure? Hi I have found http://groups.google.com/group/clojure/browse_thread/thread/cfb2e5c29bb1337/92e2b8356a50189c?lnk=gst&q=web+services#92e2b8356a50189c But it doesn't work anymore. Anyone can point to fresh tutorial? Bye! -- You received this message because you are subscribed

Odp: Re: Cron algorithm challenge

2011-08-23 Thread Michael Jaaka
Wow nice! :-) Of course wait-till can be done with Timers build-in JDK. And here is a proposition for cron parsing function: (defn parse-cron-expr[ pattern ] (let[ cal (Calendar/getInstance) ] (let [[min-pat hour-pat day-pat month-pat week-pat] (letfn[ (parse-cron[ val pos cal ] (letfn[ (range-

Re: Cron algorithm challenge

2011-08-23 Thread Michael Jaaka
After the post I suddenly saw the code in my mind: http://pastebin.com/kYYYirdb The expression abilities are truly near the mind. Clojure rox :-) On Aug 23, 6:01 pm, Michael Jaaka wrote: > Hi! > > I have some challenge for you, sine it is easy express it in > imperative language I w

Cron algorithm challenge

2011-08-23 Thread Michael Jaaka
Hi! I have some challenge for you, sine it is easy express it in imperative language I would like to ask you if is it possible to create DSL to express such algorithm in clojure or if is it too complicated just write it in functional manner. The challenge is to write cron algorithm. I can express

Re: Clojure Speed performance test

2011-08-18 Thread Michael Jaaka
For list reduction it is said to remove every third solder but just with 1 step they remove 1 soldier. There is something wrong Scully. On Aug 18, 3:50 pm, David Nolen wrote: > The Clojure code posted there is pretty awful and shows a gross, gross > misunderstanding of Clojure data types. I submi

Stateful agents

2011-08-17 Thread Michael Jaaka
Hi! Have you tried to create stateful agents? This would be useful for implementing long running business processes. The state would be saved to db for durbality and atomicity. In case of crash, the process implemented as agent would continue to execute from the last durable state. I have impleme

Argslist of fn?

2011-08-09 Thread Michael Jaaka
Hello, Is there any chance to get a list of args like it is for functions defined by defn ? I would like to use (count (first (:argslist (meta (fn[ a ] (println a)) for my function which would return wrapper which can accept optional arguments. Optional args would be decelerated not by caller

OutOfMemoryError: PermGen space on JEE

2011-05-25 Thread Michael Jaaka
Hi! After few redeployments of system written in JEE I get "PermGen space" error. It occurs definitely after starting to use Clojure in a manner: some code goes to files.clj and then it is loaded and used like: RT.load(namespace, false); var = RT.var(namespace, method.getName()); var.i

Re: 1.2 contrib shuffles

2010-08-30 Thread Michael Jaaka
ab5768618ece5a98b6e). > > Ran 365 tests containing 1298 assertions. > 0 failures, 0 errors. > [INFO] > -------- > [INFO] BUILD SUCCESSFUL > > // Ben > > On Fri, Aug 27, 2010 at 15:25, Michael Jaaka > wrote: >

Re: 1.2 contrib shuffles

2010-08-27 Thread Michael Jaaka
Agree with Daniel Janus. There are some conflicts without any reason. This should be cleaned up for 1.2.1 version. More over when I build clojure-contrib-1.2.jar I get 4 failures on tests due to. It shouldn't appear in a final versions. All contributors and Rick do a great job but you should think

Dynamic gen-class

2010-06-27 Thread Michael Jaaka
Hi, Is there any way to generate class in runtime and then use it? How far I can only generate interfaces. This works: (do (gen-interface :name test.commons.Me :methods [[ me [ String ] void ]]) (def z (reify test.commons.Me (me [t z] (println "hello wor

Re: Interface to integrate transactions with Clojure transactions

2010-06-10 Thread Michael Jaaka
Not good, since if database commit fail it is too late for dosync to rollback. In fact database commit should somehow cooparate with dosync commit which is just a case of distributed transaction. On 10 Cze, 23:11, James Reeves wrote: > On 10 June 2010 11:26, Michael Jaaka wrote: > > &

Interface to integrate transactions with Clojure transactions

2010-06-10 Thread Michael Jaaka
Hi! Is there any way to integrate database transaction with Clojure transaction? It would be nice if operations done in memory and on database would be commited atomicly with the end of transaction scope in Clojure. Such interface had to be also aware of changes made by concurrent transactions, so

Opposite to bean?

2010-06-08 Thread Michael Jaaka
Hi! We have function "bean" which takes POJO and returns read-only map with values. How about opposite function? It would be nice to have function like: (defmacro unbean ([^Class class-name map-of-fields-and-values & omit-fields] ... ) ([^Object obj-ref map-of-fields-and-values & omit-fields

Future and current thread bindings

2010-06-01 Thread Michael Jaaka
Hi! Shouldn't the future block inherit by default the bindings of calling thread? I noticed than in all places I have to use written macro: (defmacro future-with-current-binding [ & body ] `(let [b# (get-thread-bindings)] (future (with-bindings b# ~...@body and have n

Reductions bug

2010-05-31 Thread Michael Jaaka
Hi! Here it is: (reduce + '()) gives 0 (reductions + '()) gives java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Integer So reductions not always returns a sequence of intermediate values of the reduction. Thanks! -- You received this message because you are

Re: How to make that eval could see its caller context

2010-05-31 Thread Michael Jaaka
Hmmm, I have just missed on thing. The problems comes when evaluation is in another thread. (defn sleep[n] (Thread/sleep n)) (future (eval (load-string "((fn[] (sleep 100) (println \"wowo\")) )") )) The solution is: (defn sleep[n] (Thread/sleep n)) (let [a (get-thread-bindings) ] (future (wi

  1   2   >