Re: Can Simple be done with Static Typing?

2011-10-24 Thread ngocdaothanh
More about Scala: http://www.slideshare.net/El_Picador/scala-vs-ruby -- 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

Re: aquamacs, slime and clojure on OS X

2011-09-25 Thread ngocdaothanh
Coming from Eclipse, I can't live without the file browser. I'm having this problem with ECB, please help: http://stackoverflow.com/questions/7541693/ecb-context-menu-in-aquamacs Thanks, Ngoc -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to

Re: How often do you use REPL?

2010-09-27 Thread ngocdaothanh
cake (http://github.com/ninjudd/cake) has the "tab completion" feature. Because this is very useful, I wonder if this feature should be added to leiningen or Clojure itself. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send

Re: Feature idea: meta-macros

2010-09-15 Thread ngocdaothanh
> consider using or writing a preprocessor like m4 Could you elaborate on that? -- 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 p

Re: Docstrings in Clojure?

2010-08-19 Thread ngocdaothanh
> (defn foo >    "..." >    ([a] ...) >    ([a b] ...)) Is there any way to add docstring for each case? (One for summary, one for [a], and one for [a b].) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@g

FSM

2010-08-15 Thread ngocdaothanh
I have used Erlang's gen_fsm and like it very much: http://erlang.org/doc/design_principles/fsm.html I want to write a game in Clojure and I need a FSM library (best if it supports timeout event). I would like to ask if there is any Java (or Clojure?) FSM library that works well with Clojure. Tha

Re: chinese character in hiccup

2010-08-13 Thread ngocdaothanh
> Perhaps Jetty add a charset of iso-8859-1 if there isn't one in response I think this behavior is specified in the servlet spec: "If no charset is specified, ISO-8859-1 will be used" http://download.oracle.com/docs/cd/E17802_01/products/products/servlet/2.5/docs/servlet-2_5-mr2/javax/servlet/Ser

Re: why the def of run-jetty looks like "defn #^Server run-jetty"

2010-08-10 Thread ngocdaothanh
> The main usage (at least for me) is avoiding reflection in the context > of direct call to a Java method. > > if you write: > (defn foo [x] >   (.clone x)) Thank you for the insightful explanation. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To

Re: looking for a simpler implementation of a function I'm using

2010-08-10 Thread ngocdaothanh
> What I'm looking for is a natural, conceptually clean approach. Erlang programmers do version 2 all the time and it can be call "Erlang-style". You should be confident with version 2. Version 2 is cleaner if you write the inner loop as a separate function. -- You received this message because

Re: Today is "Get Your App on Clojure 1.2" Day

2010-07-30 Thread ngocdaothanh
My project.clj: (defproject maho "0.1-SNAPSHOT" :dependencies [[org.clojure/clojure "1.2.0-RC1"] [org.clojure/clojure-contrib "1.2.0-RC1"] [ring"0.2.5"] [clout "0.2.0"] [clj

Re: Clojure 1.2 RC1

2010-07-30 Thread ngocdaothanh
>          :dependencies [[org.clojure/clojure "1.2.0-RC"] [org.clojure/clojure "1.2.0-RC"] did not work for me. Changing to [org.clojure/clojure "1.2.0-RC1"] works. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email t

Re: Log SQL in clojure.contrib.sql

2010-07-28 Thread ngocdaothanh
I found: http://code.google.com/p/log4jdbc/ On Jul 27, 11:31 pm, ngocdaothanh wrote: > Hi, > > I would like to ask if there is a way to log SQL generated by > clojure.contrib.sql to console for inspection. > > Thanks. -- You received this message because you are subscr

Log SQL in clojure.contrib.sql

2010-07-27 Thread ngocdaothanh
Hi, I would like to ask if there is a way to log SQL generated by clojure.contrib.sql to console for inspection. 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 fr

Re: Clojure 1.2 Beta 1

2010-07-14 Thread ngocdaothanh
Report: There is still "call to contains can't be resolved" for defrecord. After googling for this message, I see that it has been discussed (and can be easily fixed?). -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email

Re: A DSL for writing scripts which have restricted memory and cpu usage

2010-07-12 Thread ngocdaothanh
> Are there any ways to restrict how many resources a user has access to? If you use Linux, you see /etc/security/limits.conf. -- 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 pos

Re: Clojure on BEAM

2010-07-12 Thread ngocdaothanh
This is not Clojure: http://github.com/rvirding/lfe > Are there any works or current attempts currently available? -- 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

Re: Recent builds have failed on http://build.clojure.org

2010-07-10 Thread ngocdaothanh
I think it is because the last commit of the master branch is on June 24, 2010: http://github.com/richhickey/clojure/commits/master On Jul 10, 12:24 pm, Dmitry Kakurin wrote: > The last successful build was on June 23rd. > > - Dmitry -- You received this message because you are subscribed to t

Re: ANN: Aleph, an asynchronous web server

2010-07-07 Thread ngocdaothanh
> For some reason I couldn't get 3.2.1.Final to come in via maven. I think you need to add this to project.clj: :repositories [["jboss" "http://repository.jboss.org/nexus/content/ groups/public/"]] > What qualities is it missing that make the bang misleading? I thinks ! means something dangerous

Re: ANN: Aleph, an asynchronous web server

2010-07-07 Thread ngocdaothanh
> [org.jboss.netty/netty "3.2.0.BETA1"] Netty 3.2.1.Final has been released. I think the ! mark in "respond!" is kind of misleading. Why not change it to "arespond"? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email t

Re: Clojure 1.2: Unicode string length bug?

2010-07-03 Thread ngocdaothanh
Adding Dfile.encoding=UTF-8 solves the problem: java -Dfile.encoding=UTF-8 -cp clojure-1.2.0- master-20100623.220259-87.jar clojure.main I think it is because when Java reads the input, it does not know the correct encoding. -- You received this message because you are subscribed to the Google G

Link to API document in the cheat sheet

2010-07-03 Thread ngocdaothanh
Hi, This is my nth attempt to learn Clojure. I think it will be an improvement if there are links to API document for functions in the cheat sheet (http://clojure.org/cheatsheet). Clicking a function name will jump right to the description for the function is very convenient for newbies. -- You

Re: Clojure 1.2: Unicode string length bug?

2010-07-01 Thread ngocdaothanh
I'm on Snow Leopard. I think there's something wrong with Terminal - $ java -cp clojure-1.2.0-master-20100623.220259-87.jar clojure.main Clojure 1.2.0-master-SNAPSHOT user=> (def t "車馬象士將士象馬車") #'user/t user=> t "車馬象士將士象馬車" user=> (count t) 27 user=> (.length t) 27

Clojure 1.2: Unicode string length bug?

2010-07-01 Thread ngocdaothanh
With 1.2-master-SNAPSHOT: (def t "車馬象士將士象馬車") (count t) ; => 27 (.length t) ; => 27 With 1.1, the result is 9. -- 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 m

Lift equivalent

2010-01-02 Thread ngocdaothanh
Scala has Lift with many advanced features: http://blog.lostlake.org/index.php?/archives/16-Web-Framework-Manifesto.html http://blog.lostlake.org/index.php?/archives/25-Why-the-world-needs-another-web-framework.html If a similar (or better) web framework is written in Clojure, how will it be imple

Re: Clojure 1.1 release

2010-01-02 Thread ngocdaothanh
If http://build.clojure.org/snapshots is official, I think it is great to add a link to it to the homepage of Clojure. On Jan 2, 3:01 pm, Phil Hagelberg wrote: > Howard Lewis Ship writes: > > > Is this available via a Maven repo yet and, if so, what version of > > clojure-contrib is compatible

Re: Language similarities

2009-12-28 Thread ngocdaothanh
I don't know Algol, but I think you're correct: http://www.paulgraham.com/diff.html On Dec 29, 1:14 pm, jim wrote: > Had an interesting conversation with a programmer friend of mine. He's > skeptical of my Lisp leanings and mostly sticks to the 'normal' > languages; C++, Java, etc. > > I made th

Re: Parenthesis Inference

2009-12-20 Thread ngocdaothanh
I have been studying Clojure for 3 months. My experience: * After knowing about Lisp coding style and indents: parens disappeared * After knowing about reading from inside to outside: Clojure code is more understandable (http://groups.google.com/group/clojure/ browse_thread/thread/144142dcb5586292/

Re: Code arrangement for understandability

2009-12-11 Thread ngocdaothanh
it be rearrange for more understandability? Thanks On Dec 12, 5:16 am, ataggart wrote: > On Dec 11, 1:14 am, ngocdaothanh wrote: > > > > > > Do you come from a Python background? > > > For the sake of this discussion, I would say I come from Erlang. > > > > Jud

Re: Code arrangement for understandability

2009-12-11 Thread ngocdaothanh
> Do you come from a Python background? For the sake of this discussion, I would say I come from Erlang. > Judging by you examples, I looks like you're still getting used to the lisp > style of coding. Everything is a chained function call. You're correct. Comming from Erlang: * I tend to see

Code arrangement for understandability

2009-12-10 Thread ngocdaothanh
Hi, I want to ask about code arrangement and understandability (readability). Consider this "normal" code: x = 1 ... f(x) ... y = x + 2 ... g(y) x, f, y, g have the same "abstractness" level, so they are indented to the same level. My Clojure code: (let [x 1] ... (f x) ... (let [y (+ x

Re: leiningen - a Clojure build tool

2009-11-18 Thread ngocdaothanh
Which IDE and Ant plugin do you use? I think you can use "lein pom" to have an pom.xml file for use with Maven. Hope that your fantastic IDE supports Maven. On Nov 18, 5:39 pm, Shantanu Kumar wrote: > Is any IDE support planned for this? As it turns out, many people > (including me) stick with

Re: leiningen - a Clojure build tool

2009-11-18 Thread ngocdaothanh
Lein is super easy to install and use! To demonstrate the ease of installation, the "Installation" part in README should say: 1. Download only one file: wget http://github.com/technomancy/leiningen/raw/master/bin/lein 2. chmod +x lein 3. ./lein self-install Thanks for the work. On Nov 18, 4:41

Re: Clojure Web Libraries

2009-11-16 Thread ngocdaothanh
Could someone provide an example about using Clojure with Restlet? I found: http://github.com/stuartsierra/altlaw-clojure-restlet but don't understand how the code works as a web application. Thanks. On Nov 15, 11:06 pm, Stefan Tilkov wrote: > On Nov 15, 2009, at 4:58 AM, ngocdaotha

Re: Clojure Web Libraries

2009-11-14 Thread ngocdaothanh
Hi Stuart, Can you elaborate on Restlet? After some short investigation I think it uses annotation but Clojure does not support it, so Clojure is not "Restlet-ready". Thanks On Jan 23, 1:44 am, Stuart Sierra wrote: > Hi Frank, > I'd also recommend looking atRestlet and

Re: ANN: Clojure live-repl

2009-10-29 Thread ngocdaothanh
I think it would be great if JLine is integrated in live-repl. I have some questions: * Why not use maven and clojure-maven-plugin? * Is it OK if live-repl uses one version of Clojure and the attached process uses another? On Oct 29, 9:35 am, David Powell wrote: > > Under Linux I had to fix th

Re: STM talk

2009-10-24 Thread ngocdaothanh
After reading your PDF, I now understand what Clojure means by the term "coordinate". Thanks a lot! -- coordinating activities of multiple actors (i.e. transactions) • may want to send messages to multiple actors within a txn and guarantee that either all messages are proc

Re: Clojure is two!

2009-10-19 Thread ngocdaothanh
Because most materials on Clojure are only at introduction level, I think a "Clojure Cookbook" which provides solutions to many many small real world problems would definitely be a best seller. For most programming languages, I only need 2 books: an introduction one and a cookbook one. On Oct 2

Re: Clojure Cheat Sheet

2009-10-18 Thread ngocdaothanh
The bottom of that page says: Original source (pdf, tex). So it is probably TeX. On Oct 19, 8:06 am, Gorsal wrote: > All right, so this is probably way off topic, but what software was > used to create the clojure cheat sheet?http://clojure.org/cheatsheet > I really like the format and would li

Re: server-socket on exit event

2009-10-16 Thread ngocdaothanh
. On Oct 16, 4:06 pm, Emeka wrote: > Ngo, > > I checked out your github , it is great. I have not used netty, it looks > clean. However, what is the meaning of this, (def reshedule nil)? > > Regards, > Emeka > > On Thu, Oct 15, 2009 at 3:02 AM, ngocdaothanh wrot

Re: server-socket on exit event

2009-10-14 Thread ngocdaothanh
I created this (Netty is used instead of server-socket): http://github.com/ngocdaothanh/telchat-clojure I am going to create a Scala version of the same program to have a feeling of Clojure vs Scala, it will be telchat-scala. On Oct 14, 10:12 pm, Emeka wrote: > Ngo, > > Honestly  s

Re: clojureshell-maven-plugin - easier clojure startup with maven

2009-10-14 Thread ngocdaothanh
://tapestry.formos.com/maven-snapshot-repository/ ... On Oct 15, 4:40 am, Stuart Sierra wrote: > On Oct 14, 1:03 pm, ngocdaothanh wrote: > > > Is there a way to run a .clj file (with classpath correctly set by > > Maven)? I don't want REPL, I

Re: clojureshell-maven-plugin - easier clojure startup with maven

2009-10-14 Thread ngocdaothanh
Is there a way to run a .clj file (with classpath correctly set by Maven)? I don't want REPL, I just want to run a .clj file without compiling. On Sep 5, 12:40 am, "J. McConnell" wrote: > On Fri, Sep 4, 2009 at 3:35 AM, Fredrik Appelberg < > > > > fredrik.appelb...@gmail.com> wrote: > > On Fri,

Re: Agent send-off: ~20k/s

2009-10-07 Thread ngocdaothanh
Mark, What tool did you use to see the CPU utilization, especially when the test run time is so short? Just curious. On Oct 7, 12:58 pm, MarkSwanson wrote: > > (You wrote "atom" several times but I guess you meant "agent".) > > Heh heh... yeah. --~--~-~--~~~---~--~-

Re: Agent send-off: ~20k/s

2009-10-04 Thread ngocdaothanh
I think it is not "spawn about 20K agents / second", it is 20K message passings / second. The number is about that of Erlang. On Oct 5, 11:45 am, MarkSwanson wrote: > I recently integrated Clojure with two async messaging systems. > I wound up doing "send" operations through a Clojure agent. >

Re: server-socket on exit event

2009-10-03 Thread ngocdaothanh
gt; Emeka > > On Fri, Oct 2, 2009 at 3:13 AM, ngocdaothanh wrote: > > > > I'm not sure TCP/IP has a native facility for that. > > > I'm afraid John's statement is correct: > > >http://www.velocityreviews.com/forums/t125620-client-socket-disconnec

Re: REPL integration in a existing java project

2009-10-01 Thread ngocdaothanh
You can create-repl-server: http://richhickey.github.com/clojure-contrib/server-socket-api.html and access the server remotely from telnet. On Oct 1, 9:29 pm, DomS wrote: > Hello all, > > I'm trying to integrate an REPL in a existing java project, but i dont > know how it works or where to star

Re: server-socket on exit event

2009-10-01 Thread ngocdaothanh
tart (new Thread (fn [] (create-server 8080 chat-loop On Oct 2, 5:20 am, John Harrop wrote: > On Thu, Oct 1, 2009 at 4:02 PM, Roger Gilliar wrote: > > Am 01.10.2009 um 21:28 schrieb ngocdaothanh: > > > Roger, your code is not event based. > > What do you mean by not

Re: server-socket on exit event

2009-10-01 Thread ngocdaothanh
send-answers > (parse outstream (makestr xml))) >                                                                 (recur)) >                                                         (info > "disconnected" > > (def server (create-server *port* handle-client)) > > Am 01.10.2009 um 20:39 schrieb ngocdaothanh:

server-socket on exit event

2009-10-01 Thread ngocdaothanh
I want to write a simple socket server in Clojure. I want to perform some action when a client disconnects. I tried server-socket: http://richhickey.github.com/clojure-contrib/server-socket-api.html but it does not support on exit event. Is there a solution? Should I look at something like Grizz

Re: Can anyone here give a comparison between Clojure and Erlang on concurrent programming?

2009-09-24 Thread ngocdaothanh
I think there are 2 kinds of concurrency: local concurrency (one machine) and distributed concurrency (parallel). Is there a comparison about the speed of local concurrency of Clojure and Erlang? I would like to create an online multiplayer game server which serves thousands of persistent flash

Re: Lazy binding

2009-09-03 Thread ngocdaothanh
method then provide the attributes to > be bound to the template worked great. > > Cheers, > James Sofra > > On Sep 3, 11:23 pm, Stuart Sierra wrote: > > > Check outwww.stringtemplate.org, a Java template library with a > > functional design. > > -SS > >

Re: clojureshell-maven-plugin - easier clojure startup with maven

2009-09-03 Thread ngocdaothanh
What do you mean "Swank server"? Could you explain about that? On Sep 4, 1:40 am, Fredrik Appelberg wrote: > Hello everyone, > > I've just released the first tentative version of Clojureshell. It's a > simple maven plugin that allows you to easily start a clojure REPL or run a > Swank server in

Re: Lazy binding

2009-09-03 Thread ngocdaothanh
7;s defined ahead of time. > > (def my-name "bilbo") ; name is a reserved word > > (defn my-view [] >   (str "hello " my-name)) > (my-view) > "hello bilbo" > > The my-name variable doesn't even have to be bound in this case, just > cre

Lazy binding

2009-09-03 Thread ngocdaothanh
Hi, In Rails you can create a view like this: my_view.erb: <%= "hello" + @name %> I'm new to Clojure. I want to create something like the above like this: (defn my-view [] (str "hello" name)) The point is: * name is not known when my-view is defined * I don't want to pass name as a argument

I18n

2009-08-27 Thread ngocdaothanh
Hi all, Is there an i18n library for Clojure? What Java i18n library should I use in a Clojure program (it suits Clojure syntax for example)? For Ruby and Erlang I prefer Gettext, but for Java it seems that .properties files are in major use. Thanks, Ngoc. --~--~-~--~~~-

Enumerate namespaces

2009-08-27 Thread ngocdaothanh
Hi all, To have dynamic to study Clojure, I would like to create a pluggable (like Rails Engines) web framework based on Compojure. It will add some conventions like: * Controllers files are prefixed with "c-", ex: src/main/clojure/myapp/ c-article.clj * To make controllers pluggable, routes are

Connection pool with clojure.contrib.sql

2009-08-26 Thread ngocdaothanh
Hi. As I understand clojure.contrib.sql's with-connection opens DB connection at the beginning and closes it at the end of each call. How do I create a connection pool so that with-connection can reuse connections? Thanks, Ngoc. --~--~-~--~~~---~--~~ You received

Re: clojure vs scala

2009-08-26 Thread ngocdaothanh
> In the meantime this may be helpful: > http://en.wikibooks.org/wiki/Clojure_Programming/Examples/API_Example... Thank you, this is very helpful. > > * Clojure doc is hard to understand. > > Have you seen http://ociweb.com/mark/clojure/article.html? Yes I have, this may be the best Clojure doc

Re: clojure vs scala

2009-08-25 Thread ngocdaothanh
I think there are a lot of people who need to choose between Clojure and Scala to study as a "new" language. I must say that both are bad: * Clojure doc is hard to understand. * Scala grammar is complicated. I prefer Clojure. I think Clojure feature at this time is OK, thus the decisive point to

Re: ANN: clojure-maven-plugin 1.0 released and in maven central

2009-08-24 Thread ngocdaothanh
rojects, I have compojure and some other libs included as > git-submodules in my repository, and have configured additional > to compile. > > -- > > On Tue, Aug 25, 2009 at 4:19 PM, ngocdaothanh wrote: > > > Is clojure-contrib included? > > > I tried but mvn clojur

Re: ANN: clojure-maven-plugin 1.0 released and in maven central

2009-08-24 Thread ngocdaothanh
Hi, Is clojure-contrib included? I tried but mvn clojure:compile gives: Exception in thread "main" java.io.FileNotFoundException: Could not locate clojure/contrib/json/read__init.class or clojure/contrib/json/ read.clj on classpath pom.xml: http://gist.github.com/174217 hello.clj: (ns hello) (

Fwd: Annotations and gen-class

2009-08-24 Thread ngocdaothanh
Hi, I'm new to Clojure. How can I add @ChannelPipelineCoverage("one") annotation to a proxy as in? http://viewvc.jboss.org/cgi-bin/viewvc.cgi/netty/trunk/src/main/java/org/jboss/netty/example/http/snoop/HttpResponseHandler.java?view=markup I tried: (def handler (proxy [SimpleChannelUpstreamHan

proxy and annotation

2009-08-24 Thread ngocdaothanh
Hi, How can I define annotation for a proxy? For example: Java code: http://viewvc.jboss.org/cgi-bin/viewvc.cgi/netty/trunk/src/main/java/org/jboss/netty/example/http/snoop/HttpResponseHandler.java?view=markup Clojure code: (def handler (proxy [SimpleChannelUpstreamHandler] [] (message