Re: defrecord, equality, hashing, and performance

2015-06-12 Thread Sun Ning

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Prismatic has some document for deftype/defrecord/map, hope it's useful
to you:
https://github.com/Prismatic/eng-practices/blob/master/clojure/20130926-data-representation.md

On 06/12/2015 02:36 AM, Mars0i wrote:
 I think that the following is all correct, but I could be wrong about 
 something.

 The datatypes page at clojure.org http://clojure.org/datatypes says:
defrecord provides ... value-based equality and hashCode, while
deftype does not.   So
 (defrecord Rec [x])
 (= (Rec. 42) (Rec. 42)) ;= true
 but
 (deftype Typ [x])
 (= (Typ. 42) (Typ. 42)) ;= false.
 This also means, as I understand it, that data structures that use
hashing--maps and sets, for example--hash on value for records, but on
identity for types.  I believe that the same is true when Java
hashtables compare records, or compare types, although I haven't
carefully tested this.

 It makes sense that the primary, most fully functional user-definable
datatypes in Clojure should use value-based equality; that's fully in
the spirit of a functional language, and is very convenient in many
contexts, and hashing should follow the equality semantics of the
datatypes.  You can always use identical? if you want to test records
for identity rather than equality.

 However, you can't tell maps and sets to use identity for records,
afaik.  This makes records undesirable if you only care about identity,
and need to use a data structure that uses hashing, and care about
performance, because value-based hashing is presumably a lot slower than
identity-based hashing (which is what my experiments seem to show).

 On the other hand, records are obviously way, way, more convenient
than types in many contexts because the functionality provided by
deftype is so bare-bones.  It really bothers me that I have to choose
between speed and using convenient, idiomatic functionality (defrecord)
that is one of several significant reasons that I love Clojure.  (This
is in an application in which value-based equality would /never/ be what
I wanted for my datatypes.)

 Should there be an alternative?  Either a way to define e.g. a special
kind of set that uses identity rather than value for records, or a way
to make records use identity for equality, or another datatype that's
just like defrecord but ..., or a way to get more functionality with
deftype, or ...?  (I don't think that Clojure should include every
option or functionality that someone thinks might be convenient in some
context.  Another reason that I love Clojure is that it /doesn't/ do
that, but instead provides limited, well-thought out options that allow
a lot of flexibility.)

 In an earlier thread
https://groups.google.com/forum/#!topic/clojure/EdjnSxRkOPk, Stephen
Yi pointed out that although you're allowed to override some Object
methods in defrecord, you can't override Object.equals and
Object.hashCode.  It isn't documented, but the compiler throws an
exception if you try it.  That makes quite a bit of sense, since
changing the meaning of equality for a datatype would be an easy way to
introduce confusing bugs.  On the other hand, if you do override
Object.equals and Object.hashCode for defrecord, you probably know that
you're doing something weird, and that you'd better take precautions, if
necessary, to avoid later confusion.
 --
 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 email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google
Groups Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send
an email to clojure+unsubscr...@googlegroups.com
mailto:clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQEcBAEBCAAGBQJVen1zAAoJEBnCozJnPTdiq6UH/3pKe17SGwNV0a/PajDOLbfe
R86c/U0faXgtr4hL4IrhSEK9HWlGHWy8FHE57TYQstc8OSryJXsbNp3/OjpfIpfB
QBpQwgBmwkrA/EkLJEmBsGu50R8nQgwLiG6S0T8gSFPUSM2NkQJyBkczTz0AVX7y
bUjliAb3lGaWG8t4uJhPt0feq+acfpjR1bG5V6ckISFtcJW+N8aG0lQKkDmTqcQZ
AppdpFrjiDw+SoyPcEB+vpRyQxwnxYk/g9qZHjEoFi7DG0e59gHFG19dLlXeH5Nv
tKR6rRGXsJQROxdxGWNS2HYa4ASSJJd80reoehl341A2xZ0z46SASw51T2QqpZs=
=3/P/
-END PGP SIGNATURE-

-- 
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 email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this 

Re: CIDER 0.8.2 released!

2014-12-22 Thread Sun Ning
Good Job, Bozhidar! I've already updated from MELPA. Everything works 
like a charm.





On 12/21/2014 08:39 PM, Bruce Durling wrote:

Thanks!

cheers,
Bruce

On Sun, Dec 21, 2014 at 10:54 AM, Bozhidar Batsov bozhi...@batsov.com wrote:

Ladies and gentlemen, I’m happy to inform you that CIDER 0.8.2 is out! It’s
a bugfix-only release (which means you totally want to use it). Have a look
at the release notes
(https://github.com/clojure-emacs/cider/releases/tag/v0.8.2) for all the
gory details.

This will be the final release in the 0.8.x series (unless some terrible
regression doesn’t pop up). There are no concrete plans for 0.9 yet, but I
hope it will introduce some (or ideally all) of the following:

* better cljs support

* comint-based REPL buffers

* boot support

* better handling of multiple nREPL connections

* and whatever else we manage to fit in :-)

Please, report bugs and submit suggestions for improvements here
https://github.com/clojure-emacs/cider/issues. If you like clojure-mode,
CIDER and inf-clojure you can support their development via Gratipay
https://gratipay.com/bbatsov/

P.S. In related news - squiggly-clojure
(https://github.com/clojure-emacs/squiggly-clojure), a flycheck extension
for CIDER is now an official clojure-emacs project.

--

Cheers,
Bozhidar

--
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 email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an
email to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
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 email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups Clojure group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] async-sockets - work with sockets using core.async channels

2014-10-07 Thread Sun Ning

BTW, is there any network based core.async channel available now?

On 10/08/2014 04:36 AM, adrian.med...@mail.yu.edu wrote:
It's not about 'safety' (depending on what that means in this 
context), but as Zach pointed out, if you aren't careful about 
backpressure you can run into performance bottlenecks with 
unrestrained async IO operations because although they let you code as 
if you could handle an unlimited amount of connections, obviously that 
isn't true. There is only a finite amount of data that can be buffered 
in and out of any network according to its hardware. When you don't 
regulate that, your system will end up spending an inordinate amount 
of time compensating for this. You don't need to worry about this with 
regular io because the thread per connection abstraction 
effectively bounds your activity within the acceptable physical 
constraints of the server.


On Tuesday, October 7, 2014 2:49:30 PM UTC-4, Brian Guthrie wrote:


On Mon, Oct 6, 2014 at 12:10 AM, adrian...@mail.yu.edu
javascript: wrote:

Zach makes an excellent point; I've used AsyncSocketChannels
and its irk

(http://docs.oracle.com/javase/8/docs/api/java/nio/channels/AsynchronousServerSocketChannel.html

http://docs.oracle.com/javase/8/docs/api/java/nio/channels/AsynchronousServerSocketChannel.html),
with core.async in the past. Perhaps replacing your direct
java.net.Sockets with nio classes that can be given
CompletionHandlers

(http://docs.oracle.com/javase/7/docs/api/java/nio/channels/CompletionHandler.html

http://docs.oracle.com/javase/7/docs/api/java/nio/channels/CompletionHandler.html)
would be a better fit.


Once I do some performance instrumentation I'll give that a shot.
I admit that I'm not familiar with all the implications of using
the nio classes; were I to switch, is it safe to continue using go
blocks, or is it worth explicitly allocating a single thread per
socket?

Brian

--
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 email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google 
Groups Clojure group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to clojure+unsubscr...@googlegroups.com 
mailto:clojure+unsubscr...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
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 email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups Clojure group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Taoensso library updates / 2014 September

2014-09-02 Thread Sun Ning

Good job! I will adapt Nippy 2.7.0 in my projects soon.

On 09/02/2014 10:28 PM, Peter Taoussanis wrote:
(All new releases are now on BreakVersioning, 
https://github.com/ptaoussanis/encore/blob/master/BREAK-VERSIONING.md).


*Sente - v1.0.0 / 2014 Sep 2 (today)*
*==*
/Realtime web comms for Clojure/Script (think Socket.IO but with 
Transit  core.async)./
https://github.com/ptaoussanis/sente/releases 
https://github.com/ptaoussanis/sente/releases
Notable recent changes: v1 release, optional Transit support, 
efficiency improvements (perf+bandwidth).


*Carmine - v2.7.0 / 2014 Aug 27 (-6days)*
*==*
/Clojure Redis client + message queue./
https://github.com/ptaoussanis/carmine/releases 
https://github.com/ptaoussanis/carmine/releases
Notable recent changes: lock-free Apache Commons Pool 2 pooling, 
updated Redis commands.


*Faraday - v1.5.0 / 2014 July 26 (-38days)*
*==*
/Clojure DynamoDB client./
https://github.com/ptaoussanis/faraday/releases 
https://github.com/ptaoussanis/faraday/releases
Notable recent changes: allow reading of unserialized bin values 
written with other clients.


*Nippy - v2.7.0-RC1 / 2014 Aug 27 (-6days)*
*==*
/High-performance Clojure binary serialization./
https://github.com/ptaoussanis/nippy/releases 
https://github.com/ptaoussanis/nippy/releases
Notable recent changes: ~40% perf bump over v2.6.0, LZ4 compressor, 
id'd extension types, Fressian comparison benchmarks.


*Timbre - v3.3.0 / 2014 May 8 (-4months)*
*==*
/Pure-Clojure logging + profiling./
https://github.com/ptaoussanis/timbre/releases 
https://github.com/ptaoussanis/timbre/releases

Recent changes: some minor fixes, appender updates.

*Tower - v3.0.0 / 2014 Aug 28 (-5days)*
*==*
/i18n and L10n library for Clojure./
https://github.com/ptaoussanis/tower/releases 
https://github.com/ptaoussanis/tower/releases
Recent changes: final ClojureScript support, a bunch of general API 
improvements.


*Touchstone - v2.0.2 / 2014 Mar 30 (-5months)*
*==*
/A/B testing for Clojure./
https://github.com/ptaoussanis/touchstone/releases 
https://github.com/ptaoussanis/touchstone/releases

Recent changes: stable.

*Encore - v1.7.3 / 2014 Sep 1 (yesterday)*
*==*
/General cross-platform Clojure/Script utils./
https://github.com/ptaoussanis/encore/releases
Recent changes: nothing major- a few new utils, a few fixes.


*Useful links*
*==**
*
Libs on GitHub: https://github.com/ptaoussanis?tab=repositories 
https://github.com/ptaoussanis?tab=repositories
Libs homepage: https://www.taoensso.com/clojure-libraries 
https://www.taoensso.com/clojure-libraries
Twitter (lib announcements, etc.): https://twitter.com/ptaoussanis 
https://twitter.com/ptaoussanis



As usual, please feel free to ping with any 
questions/problems/suggestions/whatever.


Happy hacking/Tuesday, cheers! :-)

--
*Peter Taoussanis
*ptaoussanis at taoensso.com http://taoensso.com/
--
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 email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google 
Groups Clojure group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to clojure+unsubscr...@googlegroups.com 
mailto:clojure+unsubscr...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
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 email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups Clojure group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ANN] Debug: clojure port of node debug

2014-07-05 Thread Sun Ning

Hi all,

I just ported node debug[1] library to clojure, hoping it could be 
helpful in clojure world. The debug library is widely used in node 
projects. The usage is very simple: print debug message when certain 
namespace is enabled via environment variable DEBUG.


https://github.com/sunng87/debug

The Clojure version of debug has almost all features of node one. And 
there are some advantages:


* No need to configure module name since we have *ns* in clojure
* Zero overhead in runtime if debug is disabled: the debug macro won't 
produce anything


Compared with logging tools of clojure, the debug library is:

* Much simpler, no xml or properties at all
* Light weight, no additional dependencies



[1] https://github.com/visionmedia/debug

--
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 email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups Clojure group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ANN] RPC library Slacker and Slacker Cluster 0.12

2014-06-10 Thread Sun Ning

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 detail, please 
move to the project pages:


https://github.com/sunng87/slacker
https://github.com/sunng87/slacker-cluster

In case you have no idea about Slacker, it's a clojure library provides 
completely transparent experience on remote function call. And the 
cluster module supports large scale high availability architecture. The 
development of slacker was started in late 2011. Now it's used in 
avoscloud.com for backend service integration


--
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 email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups Clojure group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Leiningen 2.4.0

2014-06-10 Thread Sun Ning
I have been using lein-release 
(https://github.com/relaynetwork/lein-release) for a while. It's surely 
nice to see this feature built into core.


On Tue 10 Jun 2014 06:11:06 PM CST, Atamert Ölçgen wrote:

Thanks for bringing deploy-repositories to my attention, I didn't know
it was there.



On Tue, Jun 10, 2014 at 5:22 AM, Phil Hagelberg p...@hagelb.org
mailto:p...@hagelb.org wrote:


Greetings!

I'm pleased to announce the release of Leiningen 2.4.0, our most
significant release in quite some time. The star of the show is
the new
`release` task, which can automate all the common steps behind the
release of a new version of a library.

The idea is that `lein release` will run a series of tasks you've
specified as release steps. This defaults to running the equivalent of
these commands:

* lein vcs assert-committed
* lein change version leiningen.release/bump-version release
* lein vcs commit
* lein vcs tag
* lein deploy
* lein change version leiningen.release/bump-version patch
* lein vcs commit
* lein vcs push

The `vcs` and `change` tasks are also new. The `vcs` subtasks
above are
self-explanatory, but the `change` task allows for programmatic
modification of any given key in defproject using an arbitrary
function,
without altering formatting or comments. Out of the box we ship a
function to bump version numbers, but you can call functions from
plugins, and we hope to add more built-in functions in future
releases.

Note that the release task runs `lein deploy` rather than `lein deploy
clojars`; this is in order to prevent accidental deploys of private
artifacts to Clojars. In order to deploy an open source library to
Clojars it's necessary to add `:deploy-repositories {releases
:clojars}`
to your project.clj file.

Other highlights include fixes to the search task to report index
download progress, improved multi-field queries, and the default
to make
useful uberjars even when not AOTing a -main function.

A full list of significant changes:

* Allow aliases to splice in values from the project map. (Phil
Hagelberg)
* Allow plugins to override built-in tasks. (Phil Hagelberg)
* Add `release` task for automating common release steps. (Wayne
Warren, Chris Truter, Phil Hagelberg)
* Add `change` task for programmatc `project.clj` manipulation.
(Chris Truter, Max Barnash)
* Abort when `defproject` contains duplicate keys. (Peter Garbers)
* Add `vcs` task to automate version control. (Phil Hagelberg,
Wayne Warren)
* Automatically `clean` before `deploy` to avoid AOT in libraries.
(Phil Hagelberg)
* Emit warnings to stderr. (Andy Chambers)
* Use `clojure.main` for uberjars that don't declare their own
`:main`. (Phil Hagelberg)
* Allow templates to load from `:plugin-repositories`. (Phil
Hagelberg)
* Fix a race condition on printing during dependency resolution.
(Phil Hagelberg)
* Allow `new` templates to operate on existing directories with
`--force` option. (Matthew Blair)
* Fix `search` task to allow queries on multiple fields. (Colin Jones)
* Fix a bug where errors in `run` task were mis-reported. (Gary
Fredericks)
* Report download progress of search indices. (Matthew Blair)
* Protection from harmful `:clean-targets` settings. (Craig McDaniel)
* Faster loading of help text. (David Grayson, Ryan Mulligan)
* Add `LEIN_SILENT` option to suppress `*info*` output. (Phil
Hagelberg)

As usual, for those who manually installed `lein upgrade` will pull in
the latest, and `lein upgrade 2.3.4` will back it down to the previous
version if you run into any issues.

Thanks to all the contributors who made this happen!

-Phil

ps. The Clojars artifacts for this release are still pending
investigation of some deploy issues, but they should be right
around the
corner.






--
Kind Regards,
Atamert Ölçgen

-+-
--+
+++

www.muhuk.com http://www.muhuk.com

--
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 email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google
Groups Clojure group.
To unsubscribe from this group and stop receiving emails from it, send
an email to clojure+unsubscr...@googlegroups.com
mailto:clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
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

Re: 求教:使用uberjar后,如何能覆盖log4j.properties

2014-03-11 Thread Sun Ning

试试启动参数 -Dlog4j.configuration 什么的呢,你可以搜一下

On Tue 11 Mar 2014 11:16:13 PM CST, sonic pan wrote:

把项目用uberjar打包后,如何覆盖日志配置文件log4j.properties?
试了  java -cp resources -jar xxx.jar 貌似不能覆盖

--
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 email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google
Groups Clojure group.
To unsubscribe from this group and stop receiving emails from it, send
an email to clojure+unsubscr...@googlegroups.com
mailto:clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
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 email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups Clojure group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: compojure in production

2012-12-19 Thread Sun Ning
Check out ring-jetty-adapter  
https://github.com/ring-clojure/ring/tree/master/ring-jetty-adapter

The compojure app can be treated as a ring app.

On Thu 20 Dec 2012 08:22:19 AM CST, Maris wrote:


How can I run my compojure app without leiningen ?

I want to use dedicated jetty server (not war file).

--
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 email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


--
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 email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Anonymous Macros

2012-11-06 Thread Sun Ning
I'm afraid not. Macro should be bound on a var. The clojure compile 
checks an attribute (isMacro) on a var to determine if it's a macro or 
function.

And Since a macro has no value, you cannot write it with some literals.

On Wed 07 Nov 2012 08:16:42 AM CST, Sean Neilan wrote:

Is there any way to write an anonymous macro in Clojure?

This post:
http://stackoverflow.com/questions/4074961/anonymous-macros-in-clojure
says it's possible with some hacks and in version 1.3 Clojure will
have some kind of support for this.

Thank you for your time.

-Sean

--
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 email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


--
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 email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: {ANN} ring.velocity: render apache velocity templates for ring in clojure.

2012-07-17 Thread Sun Ning

enlive最大的好处是页面html页面不会掺入任何模板语言,直接就可以在浏览器里预览页面设计
但是用的时候思维确实和传统的模板引擎不太一样

On Wed 18 Jul 2012 12:50:39 PM CST, Shen, Feng wrote:

同感enlive较复杂。前段时间,转向了Mustache。

沈锋
美味书签 http://mei.fm



On Wed, Jul 18, 2012 at 11:59 AM, dennis zhuang killme2...@gmail.com
mailto:killme2...@gmail.com wrote:

其实就是几行代码封装下,我觉的velocity比什么enlive好用多了。

2012/7/18 Shen, Feng shen...@gmail.com mailto:shen...@gmail.com

不错不错。
velocity 在java中用得较广。
这样为potential 的 clojure用户铺了一下道路。

沈锋
美味书签 http://meiwei.fm http://mei.fm



On Wed, Jul 18, 2012 at 12:00 AM, dennis zhuang
killme2...@gmail.com mailto:killme2...@gmail.com wrote:

A little error in getting started missing :age


|(render test.vm :name dennis :age 29)|


2012/7/17 dennis zhuang killme2...@gmail.com
mailto:killme2...@gmail.com

Hi,all

Apache velocity http://velocity.apache.org/is a
great java template engine used widely. I want to use
it in clojure with compojure and ring framework,so
i've created this project---ring.velocity.

Home: https://github.com/killme2008/ring.velocity
Getting started:

Adds dependency in leiningen project.clj:


|   [ring.velocity 0.1.0-SNAPSHOT]
|

Create a directory named |templates| in your project
directory to keep all velocity templates.

Create a template |templates/test.vm|:


|   hello,$name,your age is $age.
|

Use ring.velocity in your namespace:


|   (use '[ring.velocity.core :only [render]])
|

Use |render| function to render template with vars:


|   (render test.vm :name dennis 29)
|

The |test.vm| will be interpreted equals to:


|   hello,dennis,your age is 29.
|

Use ring.velocity in compojure:


|   (defroutes app-routes
  (GET / [] (render test.vm :name dennis :age 29))
  (route/not-found Not Found))
|

Use ring.velocity in ring:


|   (use '[ring.util.response])
   (response (render test.vm :name dennis :age 29))
|

Custom velocity properties,just put a file named
|ring-velocity.properties| to your classpath or
resource paths.The default velocity properties is in
src/default/velocity.properties

https://github.com/killme2008/ring.velocity/blob/master/src/default/velocity.properties.


--
庄晓丹
Email: killme2...@gmail.com
mailto:killme2...@gmail.com xzhu...@avos.com
mailto:xzhu...@avos.com
Site: http://fnil.net http://fnil.net
Twitter:  @killme2008






--
庄晓丹
Email: killme2...@gmail.com mailto:killme2...@gmail.com
xzhu...@avos.com mailto:xzhu...@avos.com
Site: http://fnil.net http://fnil.net
Twitter:  @killme2008







--
庄晓丹
Email: killme2...@gmail.com mailto:killme2...@gmail.com
xzhu...@avos.com mailto:xzhu...@avos.com
Site: http://fnil.net http://fnil.net
Twitter:  @killme2008






--
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 email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: How to convert a python list to clojure?

2012-06-24 Thread Sun Ning
Take a look at my pyclj library, which could dump/loads clojure literal 
to python data structures.


https://github.com/sunng87/pyclj


You can dump you cc and use read-string to load it into clojure.

import clj
print clj.dumps(cc)


On 06/24/2012 06:05 PM, Antonio Recio wrote:

I have this list in python:
cc = list()
for i in range(256):
cc.append(ctf.GetColor(float(i) / 255.0))

And I would know if this is correct conversion in clojure?
(def cc
  [(for [i (range 256)]
 (.. ctf GetColor (/ i 255.0)))])

--
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 email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en 



--
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 email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Clojure job scheduler

2012-06-11 Thread Sun Ning
By the way, overtone has made a simple library for scheduled task. You 
may take a look:

https://github.com/overtone/at-at

On Mon 11 Jun 2012 04:31:41 PM CST, Joao_Salcedo wrote:

hi Trevor could you share how did you solve the issue.

I would like to learn more about it.
If you can share your solution would be great

On Saturday, January 8, 2011 4:13:17 AM UTC+11, Trevor wrote:

What's the best way to kick off Clojure code at scheduled times? I
have some that would run once a day. Some that might run 2 or 3 times
a day based upon a test being met.

1. I could write a function that sleeps an interval, check the time
differential to perform a time-box triggered function, but would that
consume too much memory?, cause long term problems?

2. I could use quartz, but that seems like overkill.

3. I could set a job-schedule using the OS to run a clojure script.
I'd rather not, I would like to do things like send emails / check
status via web app (making option 1 more appealing).

I'm looking for input/guidance. What are your experiences?

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 from new members are moderated - please be patient
with your first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


--
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 email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: [ANN] Leiningen 2.0.0-preview5 released

2012-06-01 Thread Sun Ning
I'm running preview5 on OpenJDK 7, also got this issue both when upgrade 
and self-install.


On 06/01/2012 02:40 PM, mnicky wrote:
After upgrade from preview4 and installation of OpenJDK, 'lein2 repl' 
worked exactly once. Since then, it fails with:


Exception in thread main java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at clojure.lang.RT.loadClassForName(RT.java:2056)
at clojure.lang.RT.load(RT.java:419)
at clojure.lang.RT.load(RT.java:400)
at clojure.core$load$fn__4890.invoke(core.clj:5415)
at clojure.core$load.doInvoke(core.clj:5414)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5227)
at clojure.core$load_lib.doInvoke(core.clj:5264)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:603)
at clojure.core$load_libs.doInvoke(core.clj:5298)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:603)
at clojure.core$require.doInvoke(core.clj:5381)
at clojure.lang.RestFn.invoke(RestFn.java:436)
at reply.reader.jline$loading__4784__auto__.invoke(jline.clj:1)
at reply.reader.jline__init.load(Unknown Source)
at reply.reader.jline__init.clinit(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at clojure.lang.RT.loadClassForName(RT.java:2056)
at clojure.lang.RT.load(RT.java:419)
at clojure.lang.RT.load(RT.java:400)
at clojure.core$load$fn__4890.invoke(core.clj:5415)
at clojure.core$load.doInvoke(core.clj:5414)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5227)
at clojure.core$load_lib.doInvoke(core.clj:5264)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:603)
at clojure.core$load_libs.doInvoke(core.clj:5298)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:603)
at clojure.core$require.doInvoke(core.clj:5381)
at clojure.lang.RestFn.invoke(RestFn.java:805)
at reply.eval_modes.nrepl$loading__4784__auto__.invoke(nrepl.clj:1)
at reply.eval_modes.nrepl__init.load(Unknown Source)
at reply.eval_modes.nrepl__init.clinit(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at clojure.lang.RT.loadClassForName(RT.java:2056)
at clojure.lang.RT.load(RT.java:419)
at clojure.lang.RT.load(RT.java:400)
at clojure.core$load$fn__4890.invoke(core.clj:5415)
at clojure.core$load.doInvoke(core.clj:5414)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5227)
at clojure.core$load_lib.doInvoke(core.clj:5264)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:603)
at clojure.core$load_libs.doInvoke(core.clj:5298)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:603)
at clojure.core$require.doInvoke(core.clj:5381)
at clojure.lang.RestFn.invoke(RestFn.java:703)
at reply.main$loading__4784__auto__.invoke(main.clj:1)
at reply.main__init.load(Unknown Source)
at reply.main__init.clinit(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at clojure.lang.RT.loadClassForName(RT.java:2056)
at clojure.lang.RT.load(RT.java:419)
at clojure.lang.RT.load(RT.java:400)
at clojure.core$load$fn__4890.invoke(core.clj:5415)
at clojure.core$load.doInvoke(core.clj:5414)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5227)
at clojure.core$load_lib.doInvoke(core.clj:5264)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:603)
at clojure.core$load_libs.doInvoke(core.clj:5298)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:603)
at clojure.core$require.doInvoke(core.clj:5381)
at clojure.lang.RestFn.invoke(RestFn.java:1096)
at leiningen.repl$loading__4784__auto__.invoke(repl.clj:1)
at leiningen.repl__init.load(Unknown Source)
at leiningen.repl__init.clinit(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at clojure.lang.RT.loadClassForName(RT.java:2056)
at clojure.lang.RT.load(RT.java:419)
at clojure.lang.RT.load(RT.java:400)
at clojure.core$load$fn__4890.invoke(core.clj:5415)
at clojure.core$load.doInvoke(core.clj:5414)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5227)
at clojure.core$load_lib.doInvoke(core.clj:5264)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:603)
at clojure.core$load_libs.doInvoke(core.clj:5298)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:603)
at clojure.core$require.doInvoke(core.clj:5381)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at leiningen.core.main$resolve_task.invoke(main.clj:65)
at leiningen.core.main$resolve_task.invoke(main.clj:73)
at leiningen.core.main$apply_task.invoke(main.clj:84)

Re: ANN factual-clojure-driver 1.3.1, Factual's officially supported Clojure driver

2012-05-31 Thread Sun Ning

Awesome geo-data service! Can't wait to try out your APIs.

On 06/01/2012 10:33 AM, dirtyvagabond wrote:

factual-clojure-driver is Factual's officially supported Clojure driver:
https://github.com/Factual/factual-clojure-driver

Version 1.3.1 has been upgraded to support the latest API feature set:

  * Core: Find places around a given geocode, filter by any
combination of attributes, and conduct full-text searches across
all attributes
  * Places Crosswalk - Lookup places and business entities across 40+
services including Facebook, Foursquare, Yelp, and Twitter
  * Resolve: Enrich, augment and de-dupe existing datasets
  * Geopulse: Low-latency location data for geotargeting
  * Reverse Geocoder: Convert coordinates into addresses

--
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 email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en 


--
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 email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Socket Library in Clojure

2012-04-27 Thread Sun Ning

Take a look at aleph:
https://github.com/ztellman/aleph

Aleph is a high-level library for event-driven network programming.

On 04/27/2012 06:12 PM, Murtaza Husain wrote:

Hi,

I was looking for socket libraries in clojure. The requirement is to 
connect via telnet to a mainframe based system and run commands on it.


Thanks,
Murtaza
--
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 email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en 


--
Sun Ning
Software developer
Nanjing, China (N32°3'42'' E118°46'40'')
http://about.me/sunng/bio

--
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 email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


[ANN] slacker (RPC framework) 0.8.0 released

2012-04-22 Thread Sun Ning

Hi all,

Glad to announce the new release of slacker, an RPC framework for clojure:
https://github.com/sunng87/slacker

Major changes in this release:
* clojure 1.3 compatible
* performance boost: 8x faster than previous release
* ring app wrapper: slacker can be wrapped as a ring app

If you have any question about slacker, feel free to drop me an email.

--
Sun Ning
Software developer
Nanjing, China (N32°3'42'' E118°46'40'')
http://about.me/sunng/bio

--
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 email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: any advice for translating the book The Joy of Clojure?

2012-04-22 Thread Sun Ning
I don't think the book is an open source one, so you should have to find a
publisher in China first. And ask them to contact Manning for the importing
details.
 On Apr 23, 2012 1:59 AM, Zhitong He hez...@gmail.com wrote:

 BTW, is there any way to get the book's source code (latex or other)?
 so that I can do a fully translation, with the right typesetting, etc.

 I will try to publish the book translated if chances, and contribute all
 the remuneration (if any) to the Clojure community.
 I would like to know if this will be an act of tort, thank you.


 On Monday, April 23, 2012 1:40:24 AM UTC+8, Zhitong He wrote:

 Hi, all. I am new to Clojure and feel exciting playing with it.

 Recently, I read the book The Joy of Clojure, and got a strong
 feeling toward translating the book from English to Chinese, to
 introduce Clojure to more programmers in China.

 Actually I am working now. However, though having some experience in
 translating blog articles, I have never translate a real book, any
 advice about organization tools?

 Thank you.

 --
 Zhitong He
 Sun Yat-sen University

  --
 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 email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

-- 
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 email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: [ANN] lein-deps-tree 0.1.0

2012-04-02 Thread Sun Ning

lein2 has a built-in command: `lein deps :tree` for this task
it would be great to have the plugin in lein 1.x
But I got error below:

Exception in thread main java.io.FileNotFoundException: Could not 
locate leiningen/core/classpath__init.class or 
leiningen/core/classpath.clj on classpath:  (deps_tree.clj:1)


On Mon 02 Apr 2012 08:39:34 PM CST, Moritz Ulrich wrote:

I'm happy to announce the first release of lein-deps-tree[1].

It's a leiningen plugin which prints the all dependencies of a project
as a nicely formatted tree.


Please report any issues (especially with leiningen 1.x) as Github issues.


[1]: https://github.com/the-kenny/lein-deps-tree

Cheers,
Moritz



--
Sun Ning
Software developer
Nanjing, China (N32°3'42'' E118°46'40'')
http://about.me/sunng/bio

--
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 email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Cheap way to find function (defn) name using a macro?

2012-03-29 Thread Sun Ning
Since you want to use the plain defn, what about thinking in a different 
way ?
Write a macro like `with-function-name`, wraps the function call instead 
of the function definition.


(defmacro with-function-name [fn-name args]
  ...)

In clojure, because you can assign function to a var at any time. So the 
wrapped defn could not always work.

For example:

(defn* plus [a b] ...)
(def plus-alias plus)

Then you will call plus-alias but got the name as plus. I know this is a 
special case, but it's actually there.



On 03/28/2012 11:02 PM, Shantanu Kumar wrote:

Hi,

Is it possible to write a macro that when used in a top-level function
(created using defn) can find out the name of the immediate top-level
function? I know *ns* returns the namespace and it's possible to walk
the current thread's stack trace to find out the function name, but I
am looking for a computationally cheap way to do it.

Thanks,
Shantanu



--
Sun Ning
Software developer
Nanjing, China (N32°3'42'' E118°46'40'')
http://about.me/sunng/bio

--
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 email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Parallel SSH and system monitoring in Clojure

2012-03-18 Thread Sun Ning
You might interested in clojure-control[1], which has similar 
functionality to your library.


[1] https://github.com/killme2008/clojure-control

On 03/16/2012 06:12 AM, Chris McBride wrote:

Hi,

I releases two simple clojure libraries to help running commands
via SSH on multiple servers. Hopefully someone will find it useful.


http://info.rjmetrics.com/blog/bid/54114/Parallel-SSH-and-system-monitoring-in-Clojure
https://github.com/RJMetrics/Parallel-SSH
https://github.com/RJMetrics/Server-Stats

Best,
Chris McBride



--
Sun Ning
Software developer
Nanjing, China (N32°3'42'' E118°46'40'')
http://about.me/sunng/bio

--
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 email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


[ANN] slacker 0.6.1 released

2012-02-06 Thread Sun Ning

Hi all,

Slacker 0.6.1 has been pushed to clojars. Slacker is an RPC framework 
designed for clojure.

In 0.6.1, HA cluster coordinated by zookeeper is just supported.
https://github.com/sunng87/slacker


--
Sun Ning
Software developer
Nanjing, China (N32°3'42'' E118°46'40'')
http://about.me/sunng/bio

--
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 email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Contrib for Clojure 1.3

2012-01-31 Thread Sun Ning
As the wiki says, there is an unofficial branch of contrib compiled 
against 1.3


https://github.com/arohner/clojure-contrib/tree/1.3-compat

On 01/31/2012 09:22 AM, kohyama wrote:

Dear Sirs and Madams

I'm going to use clojure 1.3.
What should we do, when we're trying to do things like we've been 
doing with clojure 1.2 and contrib 1.2?

Such as things with contrib.io, contrib.duck-stream, contrib.string.

For example, to get lines in a file as a list of strings and do some 
modification for each line,

I've been doing:
(map
/some-modification/
  (clojure.contrib.duck-streams/read-lines  /a-path-name/))
.

1) Use other functions using *in* in clojure 1.3, with binding *in* to 
a file reader.

2) Use the contrib1.2 compiled for clojure 1.3.
3) Use other libraries derived from contrib 1.2.

When we're trying to port large sources of clojure 1.2 for clojure 
1.3, I guess we should take 2).

But I want to know what should we do with new developments after now.

Best regards,
Yoshinori Kohyama (@kohyama https://twitter.com/#%21/kohyama)
--
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 email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en 


--
Sun Ning
Software developer
Nanjing, China (N32°3'42'' E118°46'40'')
http://about.me/sunng/bio

--
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 email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


[ANN] slacker (Clojure RPC framework) 0.3.0 released

2011-12-17 Thread Sun Ning

Hi all,

I have released my clojure RPC framework, slacker, 0.3.0 to clojars.
Server interceptor is supported in this version, you can now add custom 
function to slacker server like logging, statistics. More detail about 
the interceptor framework is here:

https://github.com/sunng87/slacker/wiki/Interceptors

For those not aware of slacker, it's a RPC framework built by clojure 
and for clojure. It has some advantages over existed solutions:

* it uses direct function call instead of eval, which is faster and securer
* it serialize data to binary format instead using prn/read, which is 
faster and compacter


Also the client API is designed to be non-invasive. You will use slacker 
RPC just like calling the function from the same process.


You can find the project on github:
https://github.com/sunng87/slacker

Any suggestions are always welcomed.

--
Sun Ning
Software developer
Nanjing, China (N32°3'42'' E118°46'40'')
http://about.me/sunng/bio

--
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 email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


How to refer to nodejs Buffer in clojurescript ?

2011-12-13 Thread Sun Ning

Hi, all

I'm trying to use clojurescript compiled to nodejs. I ran into a problem 
with nodejs Buffer class, which doesn't have a namespace.


I tried different ways to refer Buffer:

(def b (Buffer. 1))
compiled to:
b = new mynamespace.Buffer(1)
this leads to an undefined error on runtime

If I use it under cljs.nodejs namespace
(require cljs.nodejs :as node)
(def b (node/Buffer. 1))
it will be compiled to:
b = new cljs.nodejs.Buffer(1)
But still got error because I didn't see Buffer registered into 
cljs.nodejs like process or other module.


So how can I refer to such nodejs class like Buffer which doesn't have a 
namespace ?


--
Sun Ning
Software developer
Nanjing, China (N32°3'42'' E118°46'40'')
http://about.me/sunng/bio

--
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 email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


[ANN] slacker 0.1.0: RPC by clojure and for clojure

2011-12-02 Thread Sun Ning
Glad to announse the first release of slacker. Slacker is an RPC 
framework for clojure. It provides a set of non-invasive, transparent 
APIs for both server and client. You can switch between remote 
invocation and local invocation effectivly. Different from remote eval 
approach, slacker is faster and securer because you only expose what you 
like to (all public functions under a namespace). Currently, slacker 
runs on aleph(transport) and carbonite(serialization).


The 0.1.0 has been pushed to clojars.
[info.sunng/slacker 0.1.0]

You can find the project on github. There are some examples.
https://github.com/sunng87/slacker

If you have any suggestion about this project, feel free to get 
connected with github or from this mailing list. Enjoy.


--
Sun Ning
Software developer
Nanjing, China (N32°3'42'' E118°46'40'')
http://about.me/sunng/bio

--
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 email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en