noob question about error with tail recursion

2011-11-22 Thread coco
Hi..I've a little problem using recur for recursive calling...I'm trying do the clojure koans and the recursive reverse function [1 2 3 4] - '(4 3 2 1) first I try this code: (defn recursive-reverse [coll] (loop [col coll mem '()] (if (empty? coll) mem ((cons (last col) mem)

Re: noob question about error with tail recursion

2011-11-22 Thread coco
seancorfi...@gmail.com wrote: On Tue, Nov 22, 2011 at 8:49 PM, coco clasesparticulares...@gmail.com wrote:      ((cons (last col) mem)       (recur (butlast col) mem) ...      ((cons (last col) mem)       (recur col mem) In both of these, you have a function call with (cons (last

Re: noob question about error with tail recursion

2011-11-30 Thread coco
now I'm in a similar trouble...I'm trying resolve the problem 31 from 4clojure ...It says: Write a function which packs consecutive duplicates into sub-lists. [image: test not run] (= (__ [1 1 2 1 1 1 3 3]) '((1 1) (2) (1 1 1) (3 3))) I know than I can use identity and others clojure functions

Re: noob question about error with tail recursion

2011-11-30 Thread coco
yep..that is an error but (recur (rest rst) I think wouln't work...maybe something like (defn packing [lista] (loop [[fst snd :as all] listamem []tmp '(fst)] (print all is all \n\n) ;;something is wrong...all always is a empty list (if (seq? all) (if (=

Clojure vs Clisp...How big is the difference??

2010-11-21 Thread coco
Hi everybody...I'm interested in learning clojure but there're only a few books and more focused to advanced programmers...I found today a nice book about Clisp but I don't know how different is itplease can tell if can be recommendable learn first Clisp with a easy follow book..or if there

Re: call superclass constructor in clojure class generation with defrecord

2015-02-07 Thread coco
Sorry for don't reply before, thanks so much michael, that works...and gary for the explanation, now it's much more clear to me...thanks guys El viernes, 30 de enero de 2015, 18:35:02 (UTC-4:30), coco escribió: Hi everybody, I need implement this java code in clojure public class

call superclass constructor in clojure class generation with defrecord

2015-01-30 Thread coco
Hi everybody, I need implement this java code in clojure public class MyWindow extends Window { public MyWindow() { super(My Window!); } } MyWindow myWindow = new MyWindow(); unfortunately the clojure documentation for generate classes is

Re: call superclass constructor in clojure class generation with defrecord

2015-01-31 Thread coco
to subclass something. Hope this helps =) On Fri Jan 30 2015 at 3:05:11 PM coco clasespart...@gmail.com javascript: wrote: Hi everybody, I need implement this java code in clojure public class MyWindow extends Window { public MyWindow() { super(My

Re: avian vm or robovm for desktop binary executables?..anyone has tried??

2015-03-16 Thread coco
apps but the low startup and how heavy the jvm is makes me rethink it again :D...hope someone has experience with robovm and clojure. El domingo, 15 de marzo de 2015, 2:28:42 (UTC-4:30), skuro escribió: Hi coco, I tried with Avian, and unfortunately there's quite a big part

about binding and dynamic vars

2015-03-21 Thread coco
Hi guys, I'm curious about how work some codes with binding and dynamics vars, for instance, in sqlkorma you define your db settings (defdb prod (postgres {:db korma :user db :password dbpass})) and then you can use other functions like this

about binding and dynamic vars

2015-03-21 Thread coco
Hi guys, I'm curious about how work some codes with binding and dynamics vars, for instance, in sqlkorma you define your db settings (defdb prod (postgres {:db korma :user db :password dbpass})) and then you can use other functions like this (select user (with address) (fields :firstName

Re: about macro exception : Unable to resolve classname: LinkedList, macro question and possible better approach

2015-03-06 Thread coco
sorry for my crappy code, but I was changing some conditions and testing my parameters before and I end with this code (if (not (false? res)) res (recur)) I must write just (if res res (recur)) -- You received this message because you are subscribed to the Google

about macro exception : Unable to resolve classname: LinkedList, macro question and possible better approach

2015-03-06 Thread coco
Hi guys, first I'm really noob using macros, basically I've this (!b (function-blah hi)) Hey..I didn't know than intellij copy/paste the text with format!..cool! Ok..returning to my question...I don't need call to function-blah...I need send a message to one address possibly named

Re: about macro exception : Unable to resolve classname: LinkedList, macro question and possible better approach

2015-03-08 Thread coco
All your macro needs to do is to convert the first form into the second. thanks james, that make sense for me... I don't know what the rest of your function is supposed to be doing you can check my second example (def data (atom )) (defmacro blahhh [] (go (let [ch

Re: about macro exception : Unable to resolve classname: LinkedList, macro question and possible better approach

2015-03-08 Thread coco
Sure, because you haven't quoted the symbol. If you write: (str *ns* : some-bus) ups!!, yes I forget quoted the symbol, thanks james!!... In Clojure, then Clojure will look for a variable called some-bus. The error you get is because it can't find such a variable. You want to

avian vm or robovm for desktop binary executables?..anyone has tried??

2015-03-13 Thread coco
Hi guys, I'm curiouss if its possible use avian or robovm for distribute binary desktop executables for linux,mac or windows...seems to be possible https://news.ycombinator.com/item?id=7579737 , http://labb.zafena.se/?p=673 but I've not found so much information about it :S.. I think than it

is ok use a blocking get !! at the end of sequence of async calls

2015-03-24 Thread coco
Hi guys...I've a code similar to this: (defn user-data [] (!/go (let [a (!/! (fun-async 2)) b (!/! (fun-async a))] {:response b}))) (defn handler-something [] (let [data (!/!! (user-data))] ;;block here (print data) (response

Re: is ok use a blocking get !! at the end of sequence of async calls

2015-03-25 Thread coco
is that a channel is closed (in which case anything blocked or parked on that channel will receive nil ). e ​ On Wed, Mar 25, 2015 at 12:08 AM, coco clasespart...@gmail.com javascript: wrote: Hi guys...I've a code similar to this: (defn user-data [] (!/go (let [a (!/! (fun-async 2