Unable to bootstrap ClojureScript

2012-01-31 Thread HB
Hi, Would you please have a look at this thread: http://stackoverflow.com/questions/9087817/unable-to-bootstrap-clojurescript Thanks for help and time. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Why I'm getting an empty result?

2011-03-27 Thread HB
Hi, Would you please have a look at this code: (def *objects* '(bottle bucket frog chain)) (def *object-locations* {:bottle 'living-room, :bucket 'living- room, :chain 'garden, :frog 'garden}) (defn objects-at [loc objs obj-locs] (letfn [(is-obj-at? [obj] (= (obj obj-locs) loc))]

Re: Why I'm getting an empty result?

2011-03-27 Thread HB
? From your code it seems that an obj is going to be 'bottle or 'bucket. I'm not sure what happens if you treat a symbol as a function.   -Patrick On Mar 27, 10:02 pm, HB hubaghd...@gmail.com wrote: Hi, Would you please have a look at this code: (def *objects* '(bottle bucket frog

Re: Writing a generic function for getting any value for a key

2011-03-04 Thread HB
Here is the file: http://dl.dropbox.com/u/3630641/wizard-game.clj On Mar 4, 4:24 am, HB hubaghd...@gmail.com wrote: Sorry, it is: Exception in thread main java.lang.IllegalArgumentException: Wrong number of args (1) passed to: user$describe-place (wizard-game.clj: 0) On Mar 4, 4:12 am, HB

Re: Writing a generic function for getting any value for a key

2011-03-04 Thread HB
Yes, it did and I was about resolving this post. Thanks. The issue is solved guys, thank you all for passing. On Mar 5, 3:05 am, Alan a...@malloys.org wrote: On Mar 4, 4:53 pm, HB hubaghd...@gmail.com wrote: Here is the file:http://dl.dropbox.com/u/3630641/wizard-game.clj On Mar 4, 4

Re: Writing a generic function for getting any value for a key

2011-03-04 Thread HB
Sorry, my mistake. I will do this in the future, sorry for any inconvenience that may happened. On Mar 5, 3:54 am, Ken Wesson kwess...@gmail.com wrote: On Fri, Mar 4, 2011 at 8:25 PM, HB hubaghd...@gmail.com wrote: On Mar 5, 3:05 am, Alan a...@malloys.org wrote: Does my answer to your

Writing a generic function for getting any value for a key

2011-03-03 Thread HB
Hi, I'm trying to write a function that gets the value for a key of a map. (def *places* {:room Nice room :basement what ever}) (defn describe-place [place places] (places place)) (describe-place :room *places*) Of course it isn't running :) What should I do? Thanks for

Re: Writing a generic function for getting any value for a key

2011-03-03 Thread HB
}) #'user/*places* user= (defn describe-place [place places]           (places place)) #'user/describe-place user= (describe-place :room *places*) Nice room user= (get *places* :room) Nice room On Mar 3, 5:33 pm, HB hubaghd...@gmail.com wrote: Hi, I'm trying to write a function that gets

Re: Writing a generic function for getting any value for a key

2011-03-03 Thread HB
Sorry, it is: Exception in thread main java.lang.IllegalArgumentException: Wrong number of args (1) passed to: user$describe-place (wizard-game.clj: 0) On Mar 4, 4:12 am, HB hubaghd...@gmail.com wrote: Yes indeed, it runs on my REPL too! However, if I save the code to a file and try to run

Implementing search algorithm for binary tree

2011-02-22 Thread HB
Hi, I'm trying to implement searching algorithm for binary tree. Here is my Java implementation: public Node findNode(Integer data) { Node current = root; while (!data.equals(current.getData())) { if (data current.getData()) current =

Re: Creating prime? function

2011-02-17 Thread HB
AM, HB hubaghd...@gmail.com wrote: I'm trying to write a function that determines if a number is a prime or not. Here is my first shot: (defn prime? [num]  (loop [i 2]    (if (= (* i i) num)      false)    (recur (inc i)))  true) It is not working to be sure :) Please blow

Creating prime? function

2011-02-16 Thread HB
Hi, I'm trying to write a function that determines if a number is a prime or not. I Java I have no problem: private boolean isPrime(int n) { for(int j=2; (j*j = n); j++) if( n % j == 0) return false; return true; } Here is my first shot: (defn prime? [num] (loop [i 2] (if (= (* i i)

Unable to run Clojure (jline is missing)

2010-12-08 Thread HB
Hi, I downloaded Clojure 1.2 https://github.com/downloads/clojure/clojure/clojure-1.2.0.zip and extract it. I created CLOJURE_HOME and added $CLOJURE_HOME/script to my $PATH Upon trying clj or repl , I got this error: Exception in thread main java.lang.NoClassDefFoundError: jline/ ConsoleRunner

Re: Unable to run Clojure (jline is missing)

2010-12-08 Thread HB
wrote: Did you download jline and put it in a location where it can been accessed with the classpath? http://jline.sourceforge.net/ On Dec 8, 6:47 pm, HB hubaghd...@gmail.com wrote: Hi, I downloaded Clojure 1.2https://github.com/downloads/clojure/clojure/clojure-1.2.0.zip

Re: Unable to run Clojure (jline is missing)

2010-12-08 Thread HB
: HB hubaghd...@gmail.com writes: I checked clj script under the script directory: #!/bin/sh CLASSPATH=src/clj:test:test-classes:classes/:script/ jline-0.9.94.jar:../clojure-contrib/target/clojure-contrib-1.2.0- SNAPSHOT.jar if [ -z $1 ]; then    exec java -server jline.ConsoleRunner

Re: Why I'm getting StackoverflowError?

2010-12-06 Thread HB
I didn't expect my question would initiate such a wonderful discussion, I'm speechless. Thank you all guys, you are amazing. Alex, your posts killed in a very good way :) It was really helpful to morph the code and transform it. On Dec 6, 11:14 am, Ken Wesson kwess...@gmail.com wrote: On Mon,

Why I'm getting StackoverflowError?

2010-12-05 Thread HB
Hi, I'm trying to write a function that calculates the length of a list: (defn list-length [col] (if col (+ 1 (list-length(rest col))) 0)) (list-length '(Java, Clojure, Scala)) Upon running it in the REPL, I got the error: java.lang.StackOverflowError (test.clj:3) What is going

Re: Why I'm getting StackoverflowError?

2010-12-05 Thread HB
, HB hubaghd...@gmail.com wrote: Hi, I'm trying to write a function that calculates the length of a list: (defn list-length [col]  (if col    (+ 1 (list-length(rest col)))    0)) (list-length '(Java, Clojure, Scala)) Upon running it in the REPL, I got the error

Re: Why I'm getting StackoverflowError?

2010-12-05 Thread HB
wrote: HB hubaghd...@gmail.com writes: I'm trying to write a function that calculates the length of a list: (defn list-length [col]   (if col     (+ 1 (list-length(rest col)))     0)) (list-length '(Java, Clojure, Scala)) Upon running it in the REPL, I got the error

Re: Why I'm getting StackoverflowError?

2010-12-05 Thread HB
Ken Alex, Why you aren't calling empty? when you want to check if a collection is empty? Isn't (if s) supposed to return true if s is empty ? On Dec 6, 12:27 am, Ken Wesson kwess...@gmail.com wrote: On Sun, Dec 5, 2010 at 5:16 PM, Robert McIntyre r...@mit.edu wrote: Your function never

IDE and editors for Clojure

2010-11-22 Thread HB
Hi, I'm pretty sure that this question is already been asked but failed to find it. What is your editor/IDE for Clojure? I didn't try them all, which IDE has the best Clojure support these days: IntelliJ, NetBeans or Eclipse? I'm not pretty happy with IntelliJ plugin. Thanks for help and time. --

Cake build tool isn't functioning properly

2010-11-22 Thread HB
Hi, I installed this Clojure Textmate bundle: https://github.com/swannodette/textmate-clojure and Cake build tool: https://github.com/ninjudd/cake Running cake start in the terminal, I got these warnings (actually, all Cake commands are generating these warning):

Re: IDE and editors for Clojure

2010-11-22 Thread HB
thing that Emacs is *made* for programming in Lisp because it's written in a lisp (Emacs Lisp). On Mon, Nov 22, 2010 at 2:36 PM, HB hubaghd...@gmail.com wrote: Hi, I'm pretty sure that this question is already been asked but failed to find it. What is your editor/IDE for Clojure? I

Re: Typical usage of Compojure

2010-09-05 Thread HB
Reeves jree...@weavejester.com wrote: On 4 September 2010 16:44, HB hubaghd...@gmail.com wrote: If Compojure is micro web framework like Sinatra, does this means it is not suitable for large web applications? The micro refers to how much the framework does for you, rather than the size

Typical usage of Compojure

2010-09-04 Thread HB
Hey, If Compojure is micro web framework like Sinatra, does this means it is not suitable for large web applications? (since Sinatra isn't suitable for large applications, it is mainly used for very small applications and particularly to create some kind of an API). Thanks for help and time. --

Re: A secretly Clojure web framework?

2010-09-04 Thread HB
. On Sep 4, 4:32 pm, Aaron Bedra aaron.be...@gmail.com wrote:   On 9/3/10 11:45 PM, HB wrote: Hey, Since Relevance is heavily investing in Clojure, do you think they are working on a Clojure web framework? Personally, I wish. We aren't currently working on creating a new web framework

Re: A secretly Clojure web framework?

2010-09-04 Thread HB
, Shantanu Kumar kumar.shant...@gmail.com wrote: On Sep 4, 8:51 pm, HB hubaghd...@gmail.com wrote: My wish is vanquished :) But I really wish if Relevance will work on a web framework since it is in a unique position to achieve this (having the brightest Clojure folks). I read that Relevance

Re: Thinking in Clojure

2010-09-03 Thread HB
. It shows you the why things are the way they are, and how to do things the clojure way as much as possible. On Thu, Sep 2, 2010 at 9:29 PM, HB hubaghd...@gmail.com wrote: Hey, I finished reading Programming Clojure and Practical Clojure and I'm hooked :) Please count me in the Clojure

Re: Thinking in Clojure

2010-09-03 Thread HB
understanding at all.   -Patrick On Sep 3, 12:12 pm, HB hubaghd...@gmail.com wrote: Really nice example Peter, Thanks, I appreciate it. On Sep 3, 6:36 am, Peter Buckley buckmeist...@gmail.com wrote: I'm only a little ways through Joy of Clojure (my first Clojure book) but bear with me

[Weekend Chat] A secretly Clojure web framework?

2010-09-03 Thread HB
Hey, Since Relevance is heavily investing in Clojure, do you think they are working on a Clojure web framework? Personally, I wish. -- 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

Blogs/Twitter accounts about Clojure

2010-09-02 Thread HB
Hey, Would you please recommend some good Blogs/Twitter accounts about Clojure? Thanks. -- 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 -

Re: Blogs/Twitter accounts about Clojure

2010-09-02 Thread HB
, 2010 at 12:21 PM, HB hubaghd...@gmail.com wrote: Hey, Would you please recommend some good Blogs/Twitter accounts about Clojure? Thanks. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure

Thinking in Clojure

2010-09-02 Thread HB
Hey, I finished reading Programming Clojure and Practical Clojure and I'm hooked :) Please count me in the Clojure club. But I failed how to think in Clojure. My main career is around Java web applications (Hibernate, Spring, Lucene) and Web services. Lets not talk about Java web frameworks

Re: Thinking in Clojure

2010-09-02 Thread HB
So in idiomatic Clojure applications, maps are considered like objects? And to operate on them we pass them to functions? On Sep 3, 4:55 am, David Nolen dnolen.li...@gmail.com wrote: On Thu, Sep 2, 2010 at 9:29 PM, HB hubaghd...@gmail.com wrote: Hey, I finished reading Programming Clojure

Multimethods and multiple bodies method

2010-09-01 Thread HB
Hey, How a multimethod in Clojure differs from a method that have multiple bodies? When to use each approach? Thanks. -- 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

Why do is used in this function?

2010-08-31 Thread HB
Hey, Having this function: (defn printall [s] (if (not (empty? s)) (do (println (str Item: (first s))) (recur (rest s) Why do is used here? what happens if I drop it? Thanks for help and time. -- You received this message because you are subscribed to the

Re: Some clarifications about let form

2010-08-28 Thread HB
can do destructoring in the binding block.http://clojure.org/special_forms (search destructoring) Thats just some stuff, but as soon you have done some stuff yourself it will become clear. On 26 Aug., 17:02, HB hubaghd...@gmail.com wrote: Hey, Basically, I understand what let form does

I don't understand this method

2010-08-28 Thread HB
Hey, I came across this method: (use '[clojure.contrib.lazy-seqs :only (primes)]) (def ordinals-and-primes (map vector (iterate inc 1) primes)) map macro has this format: (map function collection) primes is the collection and (iterate inc 1) is the function to apply on each element of the

Re: I don't understand this method

2010-08-28 Thread HB
-and-primes) would therefore look like this ([1 2] [2 3]  [3 5] [4 7] [5 11]) On 28 Aug., 16:57, HB hubaghd...@gmail.com wrote: Hey, I came across this method: (use '[clojure.contrib.lazy-seqs :only (primes)]) (def ordinals-and-primes (map vector (iterate inc 1) primes)) map macro has

Some clarifications about let form

2010-08-26 Thread HB
Hey, Basically, I understand what let form does but I'm not sure when to use it. Would you please enlighten me about it? (if possible some typical Java code and then covert it to Clojure let form). I really appreciate your time and help. Thanks. -- You received this message because you are

Please correct me if I'm wrong about the proxy macro

2010-08-25 Thread HB
Hey, I just want to be sure that I understand the proxy macro correctly. proxy macro is used to create a block of code that implements/extends Java interface/class , so we don't have to create Java object explicitly. Please correct me if I'm wrong. Thanks. -- You received this message because

Does Clojure has a compiler

2010-08-25 Thread HB
Hey, Both Groovy and Scala have a compiler to produce class files. Does Clojure has a compiler? Do Clojure files are compiled usually? Thanks. -- 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

Installing Clojure on OS X

2010-08-17 Thread HB
Hey, How to install Clojure on Mac OS X? I googled the web, some use MacPorts, others write some shell scripts. Is there a -standard- way to install Clojure on OS X (if possible, please don't refer me to MacPorts)? Thanks all for help and time. -- You received this message because you are

Re: Installing Clojure on OS X

2010-08-17 Thread HB
Currently, I just to play around Clojure and TextMate. Ne need for the heavy guns :) On Aug 17, 6:39 pm, cej38 junkerme...@gmail.com wrote: My first question would be how do you want to interact with clojure? Are you going to be using something like Netbeans, or emacs, or [shudder] vi?  The

Re: Installing Clojure on OS X

2010-08-17 Thread HB
How cake is differ from Dejour? http://github.com/russolsen/dejour Thanks all for help. On Aug 17, 6:41 pm, David Nolen dnolen.li...@gmail.com wrote: On Tue, Aug 17, 2010 at 10:59 AM, HB hubaghd...@gmail.com wrote: Hey, How to install Clojure on Mac OS X? I googled the web, some use

Re: What is reference?

2010-08-16 Thread HB
://clojure.org/concurrent_programming On Mon, Aug 16, 2010 at 4:32 AM, Wilson MacGyver wmacgy...@gmail.com wrote: It's clojure's STM(Software Transaction Memory). More info athttp://clojure.org/concurrent_programming On Aug 15, 2010, at 11:26 PM, HB hubaghd...@gmail.com wrote: Hey, I

What is reference?

2010-08-15 Thread HB
Hey, I don't understand what references are. (ref #{}) This creates a reference to an empty set but what is reference any way? Thanks for help and time. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Clojure and OOP

2010-02-11 Thread HB
Hey, Since Clojure is a LISP dialect, does this mean that it doesn't support OOP? Thanks. -- 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 -

Re: *1 *2 isn't working properly

2009-01-15 Thread HB
Do *1 *2 *3 ... are saved in a built in sequence that we can inspect its contents? On Jan 14, 2:20 pm, Martin Wood-Mitrovski marvot...@gmail.com wrote: On Wed, 14 Jan 2009 04:15:18 -0800 (PST) HB hubaghd...@gmail.com wrote: Lets say that the result of each method invocation will be saved

Re: *1 *2 isn't working properly

2009-01-15 Thread HB
As a group, *1, *2, and *3 form (effectively) a small queue (not a stack as someone mentioned previously). It was me :) On Jan 15, 3:00 pm, Stephen C. Gilardi squee...@mac.com wrote: On Jan 15, 2009, at 7:28 AM, HB wrote: Do *1 *2 *3 ... are saved in a built in sequence that we can inspect

*1 *2 isn't working properly

2009-01-14 Thread HB
Hey, I'm trying to run my first Clojure example user= (defn hello [name] (str Cool! name)) #'user/hello user= (hello Google) Cool! Google user= (hello Wicket) Cool! Wicket user= (str *1) Cool! Wicket user= (str *2) Cool! Wicket Isn't (str *2) supposed to return Cool! Google ? Environment:

Re: *1 *2 isn't working properly

2009-01-14 Thread HB
evaluations count. In short, you were Heisenberged. --Steve On Jan 14, 2009, at 3:59 AM, HB hubaghd...@gmail.com wrote: Hey, I'm trying to run my first Clojure example user= (defn hello [name] (str Cool! name)) #'user/hello user= (hello Google) Cool! Google user= (hello Wicket

Re: *1 *2 isn't working properly

2009-01-14 Thread HB
into the stack. So the stack now contains: Google, Wicket, Wicket Am I right? On Jan 14, 1:33 pm, Martin Wood-Mitrovski marvot...@gmail.com wrote: On Wed, 14 Jan 2009 02:47:23 -0800 (PST) HB hubaghd...@gmail.com wrote: I didn't get you, would you please hold my hand and walking me as you explain line

Re: *1 *2 isn't working properly

2009-01-14 Thread HB
is that just for fun or can it be used in programs? Consider it a shenanigan :) HB, how'd you even learn about that so fast? do I suck at reading? I'm reading the beta version of Programming Clojure ; Am I doing fine Stu? :D On Jan 14, 2:31 pm, e evier...@gmail.com wrote: is that just

Re: IntelliJ Plugin

2009-01-14 Thread HB
I'm an IntelliJ 8 user and I can test the plugin on my own machine if this helps the plugin's development. On Jan 14, 3:52 pm, Peter Wolf opus...@gmail.com wrote: Hi Aria, Actually, I am just in the process of writing up the install instructions.  Watch this space! aria42 wrote: Did you

Re: How much Clojure source code is complicated?

2009-01-13 Thread HB
(conj {:arglists (list 'quote (sigs fdecl))} m)]           (list 'def (with-meta name (conj (if (meta name) (meta name) {}) m))                 (cons `fn fdecl) On Jan 13, 8:51 am, HB hubaghd...@gmail.com wrote: Hey, How much Clojure source code is complicated? I'm not a programming

Re: How much Clojure source code is complicated?

2009-01-13 Thread HB
of clojure. That is the source. http://code.google.com/p/clojure/source/browse/trunk/src/clj/clojure/... On Jan 13, 9:04 am, HB hubaghd...@gmail.com wrote: Do you suggest that I read Programming Clojure first and then trying to study the source code? What is the best place (file, package

Re: How much Clojure source code is complicated?

2009-01-13 Thread HB
you'll need a reply from Chouser or Rich (or someone alike) when they wake up. The best I can give you is this part of the source, where (I think) it is defined how clojure is build upon java. http://code.google.com/p/clojure/source/browse/trunk/src/?r=1205#src/... On Jan 13, 9:41 am, HB

How can I be useful to Clojure?

2009-01-12 Thread HB
Hey, I would like to contribute to Clojure but I'm not a language designer, neither familiar with LISP :( How can I be useful to Clojure project? Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure

What is a LISP dialect?

2009-01-12 Thread HB
Hey, Clojure is described as a modern dialect of LISP. What is a LISP dialect? Thanks. --~--~-~--~~~---~--~~ 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 To

Re: YACS - Yes another one (Snake that is)

2009-01-12 Thread HB
What is (Yet Another Clojure Snake)? Something like YACC? On Jan 12, 1:15 pm, Tom Ayerst tom.aye...@gmail.com wrote: For example, I am pretty sure I don't need to wrap 'send' in 'dosync' (it works without it). Tom 2009/1/12 Tom Ayerst tom.aye...@gmail.com Hi, Following in a growing

How much Clojure source code is complicated?

2009-01-12 Thread HB
Hey, How much Clojure source code is complicated? I'm not a programming Godfather but I would like to study Clojure source code. Could an intermediate programmer like me grasp the source code? Thanks. --~--~-~--~~~---~--~~ You received this message because you are