Re: [ANN] Red Planet Labs, a new well-funded Clojure startup

2019-04-06 Thread Robert Luo
Cool, very curious about the idea. On Thursday, April 4, 2019 at 3:37:59 AM UTC+8, Nathan Marz wrote: > > I'm really happy to announce my startup Red Planet Labs with $5M in > funding. We have some incredible investors on board including Max Levchin, > Naval Ravikant, and Alexis Ohanian. We're

Re: Release a lib w/ specs

2018-09-16 Thread Robert Luo
My two cents: Adding spec inside the original namespace is more readable, provide documentation just in place, and the user do not need to require a separate namespace to get spec of your API, I will prefer it. For users stay in < clojure 1.9.0, I use this macro in my code: (defmacro

[ANN] Fun-map 0.2.0, blurs the line between identity, state and function

2018-09-08 Thread Robert Luo
*Update* Version 0.2.0 simplified the implementation even more (shaved another 10 more lines from 100 LOC), introduce flexible *fw* macro, function wrapped in a fun-map can cache and update the cache when its dependencies updated. *Background* A fun-map is a map can automatically unwrap any

Re: [ANN] fun-map: put your code into this map, it turns value when you access it

2018-05-10 Thread Robert Luo
Yes. Fun-map can be used like a `graph` in plumbing. It actually has a macro named `fnk` just like plumbing. Both of fun-map and plumbing can link functions toghether by the name of arguments, hence can be used as a dependency injection tool. However, the implementation of fun-map is very

[ANN] fun-map: put your code into this map, it turns value when you access it

2018-05-08 Thread Robert Luo
*Github Link: https://github.com/robertluo/fun-map* It is a lazy map: (def m (fun-map {:a 4 :b (delay (println "accessing :b") 10)})) and can also be a future map: (def m (fun-map {:a (future (do (Thread/sleep 1000) 10)) :b (future (do (Thread/sleep 1000) 20))})) or mixed:

[ANN] Fun-map: put your code into a map, it turns value whenever you need them

2018-05-08 Thread Robert Luo
*- Github link: https://github.com/robertluo/fun-map* >From the project's README: In clojure, code is data, the fun-map turns value fetching function call into map value accessing. For example, when we store a delay as a value inside a map, we may want to retrieve the value wrapped

how to reuse fspec for fdef?

2016-05-27 Thread Robert Luo
I already defined a spec for one kind of functions: (s/def ::my-handler (s/fspec :args ... :ret ...)) Then I define an instance of ::my-handler, e.g. real-handler, which I can use s/fdef to register it to registry, but can I just reuse the spec like this? (s/fdef real-handler ::my-handler)

Re: [ANN] RPC library Slacker and Slacker Cluster 0.12

2014-06-10 Thread Robert Luo
Cool update! On Tuesday, June 10, 2014 10:29:34 PM UTC+8, Sun Ning wrote: Hello Everyone, I just released Slacker 0.12 and its cluster support module. In this release, several bugs got fixed and there are also lovely features added (nippy serialization, leader election, etc). For more

Re: Correct usage of data-readers

2012-10-17 Thread Robert Luo
Is #db/id defined in datomic library? -- 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

Re: Clojure turns 5

2012-10-16 Thread Robert Luo
It was an incredible language, five years with clojure is an incredible journey, helping me understand programming better, and do programming better. Thanks Rich! On Wednesday, October 17, 2012 9:53:55 AM UTC+8, Rich Hickey wrote: I released Clojure 5 years ago today. It's been a terrific

How to view the doc of a ns in 1.3-beta3?

2011-09-08 Thread Robert Luo
When I use (doc clojure.test) It triggers a ClassNotFoundException. -- 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

clojurescript: How to transform a clojurescript map to a javascript object?

2011-07-23 Thread Robert Luo
To interact with various javascript libraries, they often requires you provide data in javascript object, while in clojurescript we normally use a map. How can we transform a map to javascript object and vice versa? BTW, now I use (js* {width: 400, height: 300}) to do it. -- You received this

Lazy map implementation

2010-05-28 Thread Robert Luo
I need a lazy map in my compojure based application to inject data into handlers. I searched the web for an implementation, I got one from Meikel which was written in 2008. Is there any recommendation? Thanks. -- You received this message because you are subscribed to the Google Groups Clojure

Re: Lazy map implementation

2010-05-28 Thread Robert Luo
On 5月28日, 下午11时01分, Sean Devlin francoisdev...@gmail.com wrote: Can memoize do the job for you? No. What I need is something can act as a map to replace the request map in compojure/ring so that it can be used in any middleware/ handles. -- You received this message because you are subscribed

Re: Lazy map implementation

2010-05-28 Thread Robert Luo
Just FYI: It's still maintained and will soon move to deftype to be ready for 1.2. Then I will also put a release on Clojars. Sincerely Meikel Thanks Meikel, I will try your implementation in my application. -- You received this message because you are subscribed to the Google Groups

Re: Lazy map implementation

2010-05-28 Thread Robert Luo
On 5月29日, 上午12时50分, Joost jo...@zeekat.nl wrote: I don't really see what you're trying to do with this, but as an alternative, you can assoc lazy-seqs to a standard map. That is, if your values are going to be seqs (IME, most of the things you want lazy evaluation for are). Joost. The

lazy-seq question

2010-05-05 Thread Robert Luo
I wrote a function as: (defn repeated-seq [f start] (let [coll (f start)] (concat coll (lazy-seq (repeated-seq f (last coll)) it is OK when I call it with: (repeated-seq #(range % 5) 0) the elements are: 0 1 2 3 4 4 5 6 7 8 8 ... However, I want to get rid of the duplicated index

Re: lazy-seq question

2010-05-05 Thread Robert Luo
Thanks Meikel. On 5月5日, 下午9时40分, Meikel Brandmeyer m...@kotka.de wrote: Hi, On 5 Mai, 14:54, Robert Luo robort...@gmail.com wrote: (defn repeated-seq [f start] (let [coll (f start)] (concat coll (lazy-seq (repeated-seq f (last coll)) it is OK when I call

Re: lazy-seq question

2010-05-05 Thread Robert Luo
On 5月5日, 下午9时43分, Krukow karl.kru...@gmail.com wrote: On May 5, 2:54 pm, Robert Luo robort...@gmail.com wrote: [snip] (repeated-seq #(range % 5) 0) the elements are:0 1 2 3 4 4 5 6 7 8 8... I think you mean, (def s (repeated-seq #(range % (+ % 5)) 0) ) Nope. The code is what I want

Data structure design question

2009-10-08 Thread Robert Luo
Hi, I am working on a server project, which requires thousands records of data stored in memory, and they will be accessed by thousands of threads simultaneously. I intend to use datalog to store all my data, sharing the whole database by a reference. However, I am afraid of concurrency of this

questions about datalog

2009-09-12 Thread Robert Luo
I am trying to use datalog now, have the following questions: 1. How about the memory consumption of datalog? 2. There are examples of datalog, but can I find more detailed document about the query language? --~--~-~--~~~---~--~~ You received this message because

Re: questions about datalog

2009-09-12 Thread Robert Luo
Two more questions: 3. In datalog.database , it is required that every tuple must has exactly same field as in database define, is that possible to just define some necessary fields, and tuples appended can have additional optional fields? 4. What is a magic transformation? I googled the term,

Re: questions about datalog

2009-09-12 Thread Robert Luo
Thank you Josh for your answer. I have read the sources of datalog, however, literal.clj and the ideas of the query language behind it is unknown for me, thus I can not understand it quite well. The same thing happens when I saw magic.clj, in which file I saw magic transformation. I ran the

Possible bug of clojure.contrib.json.read

2009-04-17 Thread Robert Luo
the following code: (read-json-string (json-str {3 1})) results NumberFormatException, I think maybe it does not expect integer keys for a map. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To