thout motivation, all interesting knowledge will vaporize.
"Immutable? It must be something great! but I don't care."
Cheers,
Takahiro
2013/10/6 bernardH
> Hi all,
>
> I intend to (ab)use my authority as a teacher to enlighten unsuspecting
> students
> about Clojure.
&g
the meet-up. The language spoken there is Japanese.
Unfortunately here in Tokyo we have not formed a "tight" community while
the number of Clojurians is obviously increasing. I am looking for some
good ways to set-up a core of the community here.
Cheers,
Takahiro SAWADA
2013年10月3日
space support is there for.
Takahiro
On Sunday, August 4, 2013 11:25:34 AM UTC+9, Ye He wrote:
>
> Yesterday, I spent hours trying to figure out why some code didn't work.
> The code is like so:
> (defn replace-symbol-in-ast-node [old new ast]
> (tree-replace (symbol ol
I think clojure.walk is suited to this purpose.
https://github.com/clojure/clojure/blob/master/src/clj/clojure/walk.clj
See keywordize-keys as an example.
On Saturday, July 27, 2013 2:31:21 AM UTC+9, Yoshinori Kohyama wrote:
>
> Thank you Gary.
> There's no reason why this need to be a macro.
> It
> I hate it mainly in blogs, where they explain some new API. They :use
like 3 namespaces and you have to guess which fn is from which ns :)
Agree.
Code is read much more often than it is written, so omitting a few
character is not effective time-saving.
I also don't like :refer :all.
I think it
Shen, Thank you for your announcement.
2013/5/6 Shen, Feng
> Hi,
>
> It's a bug fix release. *If using the WebSocket support, please upgrade.
> All older version has this bug.*
>
> The bug is "Large websocket requests get corrupted". Detail:
> https://github.com/http-kit/http-kit/issues/47. And
Thanks for amazing work!
I want to know how typical CRUD application is implemented.
Do you use single gigantic graph with lazy-compile or separated graph
for each operation?
How do you handle validation and error?
Will almost all x->y function disappear?
On Jan 30, 3:46 am, Aria Haghighi wrote:
Hi Bruce,
Try `into` instead of `concat`.
Applying concat to growing data is like "Schlemiel the Painter's
algorithm".
Cheers.
On 2月1日, 午後4:19, bruce li wrote:
> Hello, everyone. I'm experience some performance issue when using clojure.
> The scenario is as follows:
>
> I have a huge list of xls
As more and more projects are using edn format for config,
communication and etc, I think that default value of *read-eval*,
which is true, is source of vulnerability such as recently reported
ring issue [1].
And I don't understand why read-string depends on *read-eval* instead
of argument.
I belie
Paul, Raoul, David, Mimmo, JvJ,
Thanks for use cases. I have better understanding now.
Cheers,
- Takahiro
On Nov 14, 12:56 am, Paul deGrandis wrote:
> Here's one use case:
>
> Let's say you want to develop a library that monitors system behavior and
> resources while func
d of metadata is also good enough for the
purpose.
[1] https://github.com/drewr/postal
Cheers,
-Takahiro
On Nov 13, 6:01 am, JvJ wrote:
> Metadata is a really useful feature, and it's been helping me a lot. It
> seems like a flash of genius on the part of Mr. Hickey. I'm wo
> :require :as is always good and generally preferred over :refer or :use
:only.
I think we all agree with this, but in reality :use with/without :only is
very widely used in a number of real project I've seen on github.
:use (especially without :only) makes code reading painful and usually
read
tion, then you may have some
preference.
Cheers,
- Takahiro
On Monday, September 24, 2012 3:11:23 PM UTC+9, Gregorius R. wrote:
>
> Hello Clojurists!
>
> I'm a person in middle age (you know, too old to rock'n'roll, to young to
> die) and would like to progr
t.
Cheers,
- Takahiro
--
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 f
Hi Jim,
Thank you for comprehensible explanation.
I understand.
Thanks,
- Takahiro
On Sep 12, 10:45 am, Jim Crossley wrote:
> Hi Takahiro,
>
> When considering a specific library in isolation, e.g. HornetQ, there is
> little difference between using it within or without a
heers,
- Takahiro
On Sep 12, 4:30 am, Jim Crossley wrote:
> We released our third official version of Immutant today!
>
> With this release we now publish the Immutant namespaces to Clojars. They
> are of limited use when run outside of Immutant, of course, but they'll at
> least com
owser-repl frequently because I refresh the
browser in a short time interval.
> - same problem with multimethods as JVM Clojure ?
Sorry, I don't understand what this means.
Anyway I don't recommend using multimethods in cljs because it is not
fast.
Cheers,
- Takahiro
On Sep 11, 4:
er every change you make, you're doing it wrong. What is this,
2009?"
I think this is somewhat exaggeration.
REPL isn't good enough to push the all changes into browser.
Cheers,
- Takahiro
On Tuesday, September 11, 2012 1:28:44 AM UTC+9, lpetit wrote:
>
> Hello,
>
>
one considered generally more readable? I think the following
> is clearer while still not having as much noise as the first filter example:
>
> (filter (partial not nil?) coll)
>
> On Sun, Aug 12, 2012 at 1:35 PM, Takahiro Hozumi
>
> > wrote:
>
>> Hi,
>>
Hi,
I would like to know common technics that make code succinct.
For example:
(or (:b {:a 1}) 0)
(:b {:a 1} 0)
(if-not x 1 2)
(if x 2 1)
(filter #(not (nil? %)) coll)
(filter identity coll) ;; nearly equal
Please let me know any tips you found.
Cheers,
Takahiro.
--
You received this
ers this is one key-stroke(M-.)
task.
Cheers,
Takahiro.
On Friday, July 27, 2012 4:59:46 AM UTC+9, Aaron Lebo wrote:
>
> Hello!
>
> Sometime around 2 and a half months ago, I started to work on a new
> project using Clojure. I've been using Python heavily for about 6 six
> Instead of calling the ExceptionInfo ctor & .getData directly,
it's better to use ex-info & ex-data instead.
Baishampayan
Thank you for the information. I agree with you.
On Friday, July 27, 2012 6:39:29 PM UTC+9, Baishampayan Ghose wrote:
>
> On Thu, Jul 26, 2012 at 10:
If you build simple json API, combining validation function which return
validation error as a map and clojure.lang.ExceptionInfo can
reduce intermediate error handling code.
(when-let [m (validate params)]
(throw (clojure.lang.ExceptionInfo. "validation error" m)))
(defn wrap-validation-ex
Baishampayan
I didn't know `map->Foo`. Thank you for the infomation!
On Monday, July 23, 2012 2:11:45 PM UTC+9, Baishampayan Ghose wrote:
>
> On Mon, Jul 23, 2012 at 10:37 AM, Takahiro Hozumi
> wrote:
> > 2. The construction of record depends on an order of arguments.
hich has internally
efficient tree data structure, but record is compiled into class with
fields as something like POJO.
I suspect efficiency of record when repeated assoc/dissoc.
But I could be wrong.
Regards,
Takahiro.
On Monday, July 23, 2012 12:54:03 PM UTC+9, Warren Lynn wrote:
>
>
> I've read in some recent posts that Clorujians prefer data to APIs. I'm not
> sure I understand what this means, in practice. When I'm in the early
> stages of developing an application, the data structures undergo a great
> deal of change. One of the ways, I isolate parts of the code from the
Timothy
It seems that HashMap also clones whole.
https://github.com/clojure/clojurescript/blob/master/src/cljs/cljs/core.cljs#L2371
David
I see. I guessed that overhead of persistent data structure might be considered.
Thanks.
2012/2/16 Timothy Baldridge :
>>Is this design choice intended for so
Hi,
I found that assoc can be slow in ClojureScript.
This is my app profile.
http://twitpic.com/8kbupv/full
I think the cause is that entire clone happen when assoc is called.
https://github.com/clojure/clojurescript/blob/master/src/cljs/cljs/core.cljs#L2284
Is this design choice intended for som
gt;>1 hello>>33")
;=> ["hello " [">>1"] " hello" [">>33"] ""]
Thanks.
2012/2/13 Tassilo Horn :
> Takahiro Hozumi writes:
>
> Hi!
>
>> I want to make a sequence from string as follows.
>> input
Hi,
I want to make a sequence from string as follows.
input: "hello >>1 world >>2"
output: ("hello " [">>1"] " world " [">>2"])
What is efficient way to achieve this in ClojureScript?
Thanks.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post t
suit your data. I think in most
cases obj is string. So we can ignore details.
2012/2/4 Cedric Greevey :
> On Thu, Feb 2, 2012 at 8:30 PM, Takahiro Hozumi wrote:
>> 1. Resolve a server name which client should be connected to.
>> If a client need to be connected to specific resour
If you need scalability, two phase connect might be necessary.
1. Resolve a server name which client should be connected to.
If a client need to be connected to specific resource (chat room etc)
consistent hashing is useful.
http://nakkaya.com/2010/05/05/consistent-hashing-with-clojure/
2. Connect.
>> How about using (extend-type default ...) ? Is it safe to use it?
> Oops, extend-type with default does work and it seems to work well.
This is what I am looking for! Thanks.
2012/1/26 David Nolen :
> On Fri, Jan 13, 2012 at 1:32 PM, Jozef Wagner
> wrote:
>>
>> How about using (extend-type def
Thank you for your response.
The reasons why I didn't use protocols are following.
1.
Currently ClojureScript doesn't have `extend`, which makes inheritance
easy.
http://david-mcneil.com/post/1475458103/implementation-inheritance-in-clojure
2.
I think an entity which is created by deftype or defr
I've experienced rewriting my ClojureScript code into multimethods
base.
I'd share my results.
Initially I implemented polymorphism behavior as simple hashmap like
this:
(def parent
{:foo (fn [x] ...)
:bar (fn [x] ...)})
(def child
(merge parent {:foo (fn [x] ...)}))
For some reason
Hi,
I found that ::keyword doesn't have correct namespace in
ClojureScript.
If this is not only my environemnt problem, I will create an issue.
(.log js/console ::mykeyword)
Evaluate this in file, not repl.
Thanks.
--
You received this message because you are subscribed to the Google
Groups "Cl
ces.
>
> We found a couple of problems with the ClojureScript REPL while
> working on One and will address them soon. If you confirm that this is
> the problem, please let us know. Also, feel free to add an issue to
> JIRA with the steps to reproduce.
>
> Thanks,
> Brenton
>
Hi,
In my browser repl, which follows the ClojureScript wiki[1], I must
specify variables with namespace even if `in-ns` is used, but I
noticed that I don't have to do in the repl of ClojureScript One[2].
Am I the only one who cannot access variables without namespace?
What makes the diffirence?
Hi,
I want to set a default behavior on a protocol.
The following article describes how to implement inheritance in
Clojure by using `extend`, but `extend` doesn't exist in
ClojureScript.
Is there a way to set a default behavior on a protocol in
ClojureScript?
(david-mcneil.com :blog), Implementat
I've created an issue about this.
http://dev.clojure.org/jira/browse/CLJS-120
Thanks.
On Jan 10, 5:31 am, Stuart Sierra wrote:
> I would like to have NodeList be seqable. Please file a ticket with a
> patch. Perhaps someone else can shed light on why Opera doesn't work.
> -S
--
You received th
Hi,
Following code cause an error, because NodeList doesn't extend
ISeqable.
(doseq [u (goog.dom/getElementsByClass "myclass")]
...)
Uncaught Error: No protocol method ISeqable.-seq defined for type
object: [object NodeList]
So I implemented ISeqable for NodeList.
(extend-type js/NodeList
> ($ (css ))> > could wire an atom to a css (or
> other) dom attribute, by placing a> watcher on the atom and automatically
> updating the dom on change.Interesting idea!
On 1月7日, 午前5:02, kovas boguta wrote:
> Great, looking forward to see what Chris has come up with. I'm not
> enough of a JS
ts.
2012/1/2 Phil Hagelberg :
> Takahiro writes:
>
>> http://imgur.com/5NCEW
>> Is any procedure needed?
>> I've tried 1.3.4 with clojure 1.2.1/1.3.0 and Emacs 23.3.
>> My .emacs.el includes only load-path and marmalade settings.
>>
>>>> including
In MVC pattern, Model should take responsibility for business logic.
Therefore I write validate function for creating in the model.
If creating a instance of the model should be safe, I must validate a
parameter in the create function.
My problem is that a controller have to validate a parameter tw
Hi,
Putting javascript at the bottom of body is nice idea.
Thanks.
2012/1/2 Stuart Sierra :
> Hi Takahiro,
>
> This will work. It's not 100% idiomatic Clojure, but it's an acceptable
> workaround to the DOM loading issue.
>
> If ClojureScript had `alter-var-root`, whi
th> The only way I could get the colorized stack-trace was to use M-x
> clojure-jack-in.
> I'm also using emacs 24 and clojure-mode 1.11.5.
I switched emacs to 24 and get the same results.
Thanks!
2011/12/29 Sean Corfield :
> On Wed, Dec 28, 2011 at 6:43 PM, Takahiro wrote:
>&g
Hi,
I don't get colored stacktrace.
http://imgur.com/5NCEW
Is any procedure needed?
I've tried 1.3.4 with clojure 1.2.1/1.3.0 and Emacs 23.3.
My .emacs.el includes only load-path and marmalade settings.
>> including [ring "1.0.1"] in my project.clj, which uses clj-stacktrace
>> 0.2.2 instead of 0.
Hi,
In order to manipulate dom, I often want to bind elements into
variable through def, but we cannot manipulate it until load event.
So I wrapped all def into a load event handler in the following way.
https://gist.github.com/1521051
I don't use let, because many elements cause deep nested let,
a
David
Thanks. Nice design!
(extend-type java.util.HashMap
ma/IMatchLookup
(val-at* [this k not-found]
(or (.get this k) not-found)))
2011/12/13 David Nolen :
> You can extend-type to IMatchLookup.
>
> David
>
>
> On Mon, Dec 12, 2011 at 10:56 AM, Takahi
Hi,
I'd like to use core.match with java.util.HashMap without converting
into {}.
The core.match doesn't support it as below.
(let [m (java.util.HashMap. {"a" 1})]
(match m
{"a" 1} true))
;=> nil
Is it difficult?
Thanks.
--
You received this message because you are subscribe
I think clojure.java.io is latest one.
http://clojure.github.com/clojure/clojure.java.io-api.html
Since clojure.java.io returns raw java object, you need to use java
interop directly for write-lines etc.
BTW clojure.java.io is beautiful example of protocol, I think.
2011/11/25 Daniel Glauser :
>
Or you should hook load event.
(ns foo
(:require [clojure.browser.repl :as repl]
[goog.events :as gevents]))
(defn main [] (repl/connect "http://localhost:9000/repl";)
(gevents/listen js/window (aget gevents/EventType "LOAD") main)
2011/11/25 Takahiro :
>
In your html, a script tag seems to have to be in body tag, not head
tag, when you use browser repl.
If you use Chrome, look at a console in Developer Tools.
Is there an xpc error?
2011/11/25 Wilkes Joiner :
> The browser repl in the samples directory works fine for me in emacs. I'm
> guessing it
Hi, Meikel
I didn't know there is a lower level operation. Thanks.
!paws is a tony name :)
> However, my suspicion is, that you don't clearly divide the state handling
> from the program logic. The peek should happen in the update function you
> pass to swap!. If this is not side-effect free, it
gt; ;; usage
>> (let [queue (atom (into PersistentQueue/EMPTY [1 2 3]))]
>> (swap! queue process-item) ; prints 1
>> (swap! queue process-item) ; prints 2
>> (swap! queue process-item)) ; prints 3
>>
>> Probably better examples but that's the basic idea.
>
t; (pop queue))
>
> ;; usage
> (let [queue (atom (into PersistentQueue/EMPTY [1 2 3]))]
> (swap! queue process-item) ; prints 1
> (swap! queue process-item) ; prints 2
> (swap! queue process-item)) ; prints 3
>
> Probably better examples but that's the basic idea.
>
Hi,
To avoid peeking same element of a queue, I think PersistentQueue must
be stored in ref not atom.
Is this correct?
;;Ref: safe
(dosync
(let [item (peek @r)]
(alter r pop)
item))
;Atom: unsafe
(let [item (peek @a)]
(swap! a pop)
item))
Thanks.
--
You received this message bec
C in S-expression approach might be helpful, if you just want to write
C in Clojure syntax.
The advantage of this pure translator approach is you can fully
recognize what you do.
Such implementation already exist in Scheme.
http://practical-scheme.net/gauche/man/gauche-refe_76.html
I think transla
Hi,
I'm interested in useful utility which you create.
Please show me your favorite utility.
For example, _-> is that for me.
_-> is like ->, but it can insert expression in arbitrary place by
marking underscore.
(_-> :a (assoc {} _ 1))
;=> {:a 1}
Therefore It can unify -> and ->> behavior.
https:
o
> determine whether the sequence is empty you would have to call seq on
> it.
>
> On Mar 23, 6:23 pm, Takahiro Hozumi wrote:
>
>
>
>
>
>
>
> > Hi,
> > I think destructure should not produce nthnext, because it realize an
> > element of sequence mor
Hi,
I think destructure should not produce nthnext, because it realize an
element of sequence more than needed.
For example:
(defn inc-seq [i]
(iterate #(let [x (inc %)] (println "realize:" x) x) i))
;=> #'user/inc-seq
(take 1 (inc-seq 0))
;=> (0)
(take 1 (let [[x & xs] (inc-seq 0)] (cons x xs
Hi,
Please bump up my JIRA membership level to make edits and I will fix
this bug.
I have an account named Takahiro Hozumi on dev.clojure.org already.
CA is also already sent.
Thanks.
On 3月11日, 午後10:55, Stuart Sierra wrote:
> > (require '[clojure.string :as str])
> > (str/repla
Hi,
I have two questions about clojure.string/replace-first.
1.
Is this expected behavior of replace-first?
(require '[clojure.string :as str])
(str/replace-first "abc def" #"ghi" (fn [a] (str a a)))
=> nil
I don't think so, because string / string argument version returns
original string when m
more concise:
(defn enmap [args]
(reduce #(hash-map %2 %1) (reverse args)))
2011/3/11 Takahiro :
> Interesting. Here is my attempt.
>
> (defn enmap [args]
> (let [[fs & res] (reverse args)]
> (reduce (fn [v k] (hash-map k v)) fs res)))
>
>> (enmap [1 2 3 4 {5 6
Interesting. Here is my attempt.
(defn enmap [args]
(let [[fs & res] (reverse args)]
(reduce (fn [v k] (hash-map k v)) fs res)))
> (enmap [1 2 3 4 {5 6 7 8}])
=> {1 {2 {3 {4 {5 6, 7 8}
>(let [[tail more] ((juxt last (comp reverse butlast)) [1 2 3 4 {5 6 7 8}])]
> (reduce #(hash-map %2
I had same problem.
Add following line in your project.cjj.
:warn-on-reflection true
On Feb 26, 9:11 am, Seth wrote:
> Has any gotten the warn-on-reflection to work in slime when compiling
> a buffer? Warning occur when i paste a function into the repl, but no
> reflections occur when i compile
Hi,
Thank you for the introduction. Here is my little feed back:
1. I want to see a example using callbacks.
2. Is RequestBuilderWrapper.java necessary? Why not simply use
RequestBuilder?
3. I prefer reify or defrecord to proxy for performance reason, when
implement interface.
4. I think hash-map i
ter *counts*
(fn [m]
(let [n (m key)]
(if (< 1 n)
(assoc m key (dec n))
(dissoc m key)))
I think former style is normal, but latter is easy to replace ref with
atom.
Thanks.
--
Takahiro Hozumi
--
You received this message becau
68 matches
Mail list logo