motivation, all interesting knowledge will vaporize.
Immutable? It must be something great! but I don't care.
Cheers,
Takahiro
2013/10/6 bernardH un.compte.pour.tes...@gmail.com
Hi all,
I intend to (ab)use my authority as a teacher to enlighten unsuspecting
students
about Clojure.
On the plus
of 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日木曜日 16時07分55秒
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 old) (symbol new) ast))
I use tree-replace
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 shen...@gmail.com
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:
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
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 leilmy...@gmail.com wrote:
Hello, everyone. I'm experience some performance issue when using clojure.
The scenario is as follows:
I have a
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
Paul, Raoul, David, Mimmo, JvJ,
Thanks for use cases. I have better understanding now.
Cheers,
- Takahiro
On Nov 14, 12:56 am, Paul deGrandis paul.degran...@gmail.com wrote:
Here's one use case:
Let's say you want to develop a library that monitors system behavior and
resources while
is also good enough for the
purpose.
[1] https://github.com/drewr/postal
Cheers,
-Takahiro
On Nov 13, 6:01 am, JvJ kfjwhee...@gmail.com 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 wondering
: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
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 programm but starting with functional programming.
Regarding
,
- 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 from this group, send
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:52 pm, Laurent PETIT laurent.pe...@gmail.com wrote:
2012/9/10
,
- Takahiro
On Sep 12, 4:30 am, Jim Crossley jcrossl...@gmail.com 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 compile so you can
Hi Jim,
Thank you for comprehensible explanation.
I understand.
Thanks,
- Takahiro
On Sep 12, 10:45 am, Jim Crossley jcrossl...@gmail.com wrote:
Hi Takahiro,
When considering a specific library in isolation, e.g. HornetQ, there is
little difference between using it within or without an app
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,
A ClojureScript workflow newbie question
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
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
fat...@googlemail.comjavascript:
wrote:
Hi,
I would like to know common technics
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 years
working for a small
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:19 PM, Takahiro Hozumi fat
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
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 don't think you're
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 fat...@googlemail.com
wrote:
2. The construction of record depends on an order of arguments
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 these
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
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 tbaldri...@gmail.com:
Is this design
] ]
Thanks.
2012/2/13 Tassilo Horn tass...@member.fsf.org:
Takahiro Hozumi fat...@googlemail.com writes:
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?
This is a JVM
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 to this group, send
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.
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 dnolen.li...@gmail.com:
On Fri, Jan 13, 2012 at 1:32 PM, Jozef Wagner jozef.wag...@gmail.com
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
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
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
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?
namespaces.
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
On Jan 15, 6:57 am, Takahiro
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),
I've created an issue about this.
http://dev.clojure.org/jira/browse/CLJS-120
Thanks.
On Jan 10, 5:31 am, Stuart Sierra the.stuart.sie...@gmail.com 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.
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
Hi,
Putting javascript at the bottom of body is nice idea.
Thanks.
2012/1/2 Stuart Sierra the.stuart.sie...@gmail.com:
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`, which
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
p...@hagelb.org:
Takahiro fat...@googlemail.com 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 [ring 1.0.1] in my project.clj, which uses clj-stacktrace
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.2.4.
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 seancorfi...@gmail.com:
On Wed, Dec 28, 2011 at 6:43 PM, Takahiro fat...@googlemail.com wrote:
I think
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,
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 subscribed to
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 dnolen.li...@gmail.com:
You can extend-type to IMatchLookup.
David
On Mon, Dec 12, 2011 at 10:56 AM, Takahiro Hozumi
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 wilkesjoi...@gmail.com:
The browser repl in the samples directory works fine for me in
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 fat...@googlemail.com:
In your
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
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
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
))
;; 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.
Allen
On Wed, Nov 9, 2011 at 8:46 PM, Takahiro Hozumi fat
(swap! queue process-item) ; prints 2
(swap! queue process-item)) ; prints 3
Probably better examples but that's the basic idea.
Allen
On Wed, Nov 9, 2011 at 8:46 PM, Takahiro Hozumi fat...@googlemail.com
wrote:
Hi,
To avoid peeking same element of a queue, I think PersistentQueue
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
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.
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)))
, 6:23 pm, Takahiro Hozumi fat...@googlemail.com wrote:
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
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 %1)
more concise:
(defn enmap [args]
(reduce #(hash-map %2 %1) (reverse args)))
2011/3/11 Takahiro fat...@googlemail.com:
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
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
I had same problem.
Add following line in your project.cjj.
:warn-on-reflection true
On Feb 26, 9:11 am, Seth wbu...@gmail.com 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
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
*
(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 because you
65 matches
Mail list logo