Huahai Yang

Greenhorn
+ Follow
since May 25, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
2
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Huahai Yang

I work as a research scientist in a big IT company, and I am using Clojure for all my R&D projects started since last year: mostly text analytics (information extraction, sentiment analysis, etc) at the backend and visualization for the Web front end. If we are very successful in these projects and the management plays the politics right, one of these projects has some chances of getting into products. For now, it is too soon to tell...
12 years ago
Thanks Amit and Java Ranch.

To a greater numbers of Clojurians in action.
12 years ago
I use compojure for routing and just use hiccup for templating. The lein-ring plugin is very handy for development, as it supports live changes to the application, no reloading is necessary, just refresh the browser, the change is already there.


Dan King wrote:

Sean Corfield wrote:Other options include deploying source code in a folder tree on the classpath, load the entry point scripts with clojure.lang.RT and start invoking code from the host language (the Clojure scripts are compiled to bytecode on the fly, not interpreted). That's mostly how I use Clojure from my web application right now - I can make changes to the Clojure code, and just reload it into the runtime without any restarts needed.



As an side, do you use a clojure web framework? If yes, which one and why?

12 years ago
Same here.

Sean Corfield wrote:

John Todd wrote:Excellent note Sean and welcome to the Ranch.


Thank you! I guess it's a little ironic that after doing Java for 14 years, what finally got me to create an account on the Ranch was Clojure

12 years ago
Eclipse has a Clojure plugin called counterclockwise (ccw) that have most features and are rapidly maturing.

One thing the beginners of Clojure need to know is that Clojure development is REPL heavy, which is a completely different process from that of static languages like Java. Basically, one experiment in REPL, build small functions, then compose them, the debugging needs is very different from write-compile-test way of development.
12 years ago
I would refrain from learning Clojure from Scheme books at the beginning. It might be good idea to try those books after having familiarized with Clojure already.
12 years ago
The insight to me seems to be the freedom of expressing and composing high level data transformations. Once I realize that, I feel this is a more human like thinking than what imperative language taught us to do. Now I feel the imperative languages are glorified machine codes, one is still manipulating registers, memory locations, and such. These are all notions of the implementation details of a Von Neuman machine. OOP tried to hide those, but in the process created another layer of details for us to get around. Functional language let you think directly about how you are going to manipulate YOUR DATA, regardless how the data might be represented in the machine.
12 years ago
I don't think a killer app is the way to go for a general purpose language, because people tend to tie the language to the domain of its killer app. For example, Ruby is popular, but only for Web programming. I believe Clojure has a much bigger aspiration than that.

As to your point that Clojure loving requires prior lisp, math, or functional experience, I think that generalization is not true. I did not have any of that prior experience and did imperative programming for 20 years, and I learned to love Clojure recently. It tooks about 10 months on and off. I first started with Clojure interp with Java, which got me familiar with Clojure syntax, but I still didn't have the feel of mastery like I had with Java. Then I tried to do programming exercises on 4clojure.com, that's what really got me hooked. So I think it is important to actually dive into the language instead of just reading about it. The more people do that, the more people will love the language.
12 years ago
What you have is not a map, it is a two-maps-inside-a-list.

For a map m, , you can get all the values by using vals function: gives you (1 2). If you want only the value of the key :a, there are 3 ways: either , or , or .


Rajith Gamage wrote:How can I get all values in Map?

suppose I have map like this.
({:a 1,:b 2}{:a 3,:b 6})

So I want to get the values of key 'a' . How can I get that ?

12 years ago
As a Java programmer since 1997 (with prior experience in Pascal, C, Assembly and various scripting languages), I recently successfully transformed myself into a Clojure programmer, and I am not going back. So it is certainly possible for a Java programmer to love Clojure . During my transformation process, syntax was not the main obstacle since the Clojure syntax is actually a lot more regular and predictable than Java. The main problem for me was to learn the functional way of thinking. Unfortunately, reading books and reading other people's code won't help too much here, the only way to learn functional programming is to write functional code yourself. It is like learning math. What I did was to do exercises on 4clojure.com and avoided the use of loop. I also got myself very familiar with the core sequence functions of Clojure core, and read the source code of those functions. After a while, functional way of thinking becomes natural to me.
12 years ago