Re: object identity

2014-02-26 Thread t x
[start slightly insane idea] Perhaps we need the following: * a way to tag a function as _pure_ * a map with uber_weak keys + values by "uber_weak", I mean the k/v pair vanishes when either the key _or_ the value is gc-ed Then, what we do here, is that every function auto-memoizes: (fun

Re: object identity

2014-02-26 Thread Bobby Eickhoff
This seems like a reasonable optimization. I read something similar a few years ago (http://lorgonblog.wordpress.com/2008/05/24/catamorphisms-part-four/): What we want is a function which will be smart, and only allocate new data structures when necessary. Indeed, one of the main advantages o

Re: object identity

2014-02-26 Thread Mikera
I would try to write code that behaves like this where possible, because it certainly improves performance (because of faster identity checks + less GC pressure as you suggest). I think it is good practice in general when implementing immutable data structures. However I would generally not *re

Re: The future of CongoMongo?

2014-02-26 Thread Michael Klishin
2014-02-27 4:56 GMT+04:00 Mark Engelberg : > I've looked at monger a couple of times, and felt it was more involved > than I wanted. For example, I was turned off by the need to manually > create object IDs as part of creating records. I like how congomongo does > it for me. See monger.collect

Re: object identity

2014-02-26 Thread Andy Fingerhut
There are likely to be common ways of writing data transforms that happen to return the same identical object as they were given, because 'primitives' like assoc often do. I don't know of anyone who intentionally relies upon this behavior for correctness of their code, and would strongly advise ag

Re: Latest web framework for clojure

2014-02-26 Thread Moritz Ulrich
Om is well-suited to handle the UI-part for you. It doesn't do any server communication or forces you into any particular programming style or project layout. On Thu, Feb 27, 2014 at 2:35 AM, Mark Engelberg wrote: > As far as I can tell, neither luminus nor caribou are well-suited to > building,

Re: Latest web framework for clojure

2014-02-26 Thread Mark Engelberg
As far as I can tell, neither luminus nor caribou are well-suited to building, for example, interactive "web apps" like this web-based chat room which serves as the "Hello World" for the Opa web framework: https://github.com/MLstate/opalang/wiki/Hello%2C-chat Is this the kind of thing that Pedesta

Re: The future of CongoMongo?

2014-02-26 Thread Leonardo Borges
> > I'd like to see CongoMongo's API completely overhauled, to remove > dependencies on dynamic global variables etc, so this would be introduce a > new API, and deprecate the old API. > I've used both libraries but since I haven't worked with Mongo extensively from Clojure I still don't have a

Re: The future of CongoMongo?

2014-02-26 Thread Mark Engelberg
I use and prefer congomongo, and am happy with its current state. It's lightweight and does what I want it to do. I've looked at monger a couple of times, and felt it was more involved than I wanted. For example, I was turned off by the need to manually create object IDs as part of creating reco

Re: Latest web framework for clojure

2014-02-26 Thread Chris Kuttruff
+1 to this... I've set up a basic site with these basic tools (jetty instead of http-kit for development simplicity with lein ring). Couldn't be any simpler to get going, and it's really nice to have everything explicitly namespaced... you can just organize things how want. Also, I would recom

The future of CongoMongo?

2014-02-26 Thread Sean Corfield
(this is a variant of a discussion I started on the congomongo-dev mailing list a while back) Do you use MongoDB with Clojure? Which library do you use? I seem to have become the de facto primary maintainer for CongoMongo now - I gather most other maintainers are not currently using MongoDB (o

Re: Can't start repl with Leiningen

2014-02-26 Thread Matej Fröbe
*#apt-get update#apt-cache show openjdk-7-jrePackage: openjdk-7-jreSource: openjdk-7Version: 7u21-2.3.9-5...* So if I understand correctly (I'm more or less a Linux newbie), this means that "update 21" is the version in distro's repositories. Am Mittwoch, 26. Februar 2014 21:36:39 UTC+1 s

Re: Can't start repl with Leiningen

2014-02-26 Thread Zach Oakes
Is their a reason your OpenJDK install is only on update 21? I believe the most recent is 51, though I doubt that is the problem. I also doubt it's a memory issue; I can run the REPL just fine on a netbook with 1GB of RAM running Ubuntu x64. On Wednesday, February 26, 2014 3:05:53 PM UTC-5, Mat

Re: Latest web framework for clojure

2014-02-26 Thread Moritz Ulrich
In addition to all the other message here please note, that it's very helpful to build a site with just http-kit, hiccup and compojure, which are all three independent components. This gives you the freedom to structure your application however you like without getting in your way like many framewo

[ANN]: Buddy 0.1.0-beta4: Authentication, Authorization & Signing library for Clojure.

2014-02-26 Thread Andrey Antukh
Hi! I am happy to announce a new release of buddy 0.1.0-beta4: authentication, authorization and signing library for clojure. Comparing it with previous release/announcement this comes with big api restructuring and simplification. Changes: - As previously mentioned: api restructuring (after th

Re: Can't start repl with Leiningen

2014-02-26 Thread Matej Fröbe
I only have 2GB. I tried adding -Xms1024M (and some lower and higher values) to the java command in lein script, but it didn't help. Am Mittwoch, 26. Februar 2014 19:52:49 UTC+1 schrieb Armando Blancas: > > I had the same problem with an old box I had around the house. Put Fedora > 20 on it wit

Re: [ANN] Sente - Clojure(Script) + core.async + WebSockets/Ajax

2014-02-26 Thread Base
Peter, This looks great! can't wait to try it out. Well done. On Wednesday, February 26, 2014 7:57:24 AM UTC-6, Peter Taoussanis wrote: > > Hi folks, > > Quick post to announce a new lib release: > https://github.com/ptaoussanis/sente > > From the README: > *Sente* is small client+server libra

Re: Latest web framework for clojure

2014-02-26 Thread Josh Kamau
If you are writting blog-like application , check out caribou http://caribou.github.io/caribou/docs/outline.html On Wed, Feb 26, 2014 at 9:44 PM, Curtis Gagliardi < gagliardi.cur...@gmail.com> wrote: > If you're interested in the url-generation and data-based routing, there > are some Compojure

Re: object identity

2014-02-26 Thread Brian Craft
Ok, trying a different way of asking this: Is it common practice in clojure to write data transforms in a way that will return the same object when possible (when the transform would be a noop), such as the mapv vs. reduce/assoc in my example? Would you do this to speed up equality checks, or t

Re: Can't start repl with Leiningen

2014-02-26 Thread Armando Blancas
I had the same problem with an old box I had around the house. Put Fedora 20 on it with a recent open jdk, but had just 1GB of memory total. I attributed the error to the lower memory since I never have that issue at work or other machines with at least 4GB. If you have more than 2GB, experimen

Re: Latest web framework for clojure

2014-02-26 Thread Curtis Gagliardi
If you're interested in the url-generation and data-based routing, there are some Compojure competitors like Bidi which have those features without bringing on something as large as Pedestal: https://github.com/juxt/bidi (the readme has a nice comparison chart). On Tuesday, February 25, 2014 1

Re: Can't start repl with Leiningen

2014-02-26 Thread Matej Fröbe
Debian jessie 32-bit Am Mittwoch, 26. Februar 2014 15:50:19 UTC+1 schrieb John Gabriele: > > On Wednesday, February 26, 2014 3:19:43 AM UTC-5, Matej Fröbe wrote: >> >> It seems that this is independent of where I run the project. >> >>> > Matej, > > What OS (and version) are you using? > >

Re: error in website text

2014-02-26 Thread John Gabriele
On Wednesday, February 26, 2014 10:01:16 AM UTC-5, Janek Warchoł wrote: > > Then it seems that i have completely misunderstood the point of that > paragraph - it may be worth rewording it. > Anyway, thanks for explanation. Best, > Janek > Could be changed to: "It endeavors to be a general-purpos

Re: Help with data structures and dereferencing

2014-02-26 Thread Robert Quinn
david, I think you're right. I've complicated things by conflating the two concepts. the overall structure of the data is a graph. when you look at an entity and their relationships it's a tree. entity (LHS) has a set of relationships. that was my reason for even thinking a zipper might he

Re: error in website text

2014-02-26 Thread Janek Warchoł
Then it seems that i have completely misunderstood the point of that paragraph - it may be worth rewording it. Anyway, thanks for explanation. Best, Janek W dniu środa, 26 lutego 2014 15:20:08 UTC+1 użytkownik Fogus napisał: > > I do believe that the sentence is correct as written. That is, >

Re: Can't start repl with Leiningen

2014-02-26 Thread John Gabriele
On Wednesday, February 26, 2014 3:19:43 AM UTC-5, Matej Fröbe wrote: > > It seems that this is independent of where I run the project. > >> >>> Matej, What OS (and version) are you using? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to t

Re: error in website text

2014-02-26 Thread haosdent
I think "not" isn't missing. ;-) On Wed, Feb 26, 2014 at 9:58 PM, Janek Warchoł < lemniskata.bernoull...@gmail.com> wrote: > Hello, > > On clojure.org/rationale there is a sentence > > It endeavors to be a general-purpose language suitable in those areas >> where Java is suitable > > > It seems

Re: error in website text

2014-02-26 Thread Michael Fogus
I do believe that the sentence is correct as written. That is, Clojure strives to solve the same kinds of problems that Java is typically used to solve. On Wed, Feb 26, 2014 at 8:58 AM, Janek Warchoł wrote: > Hello, > > On clojure.org/rationale there is a sentence > >> It endeavors to be a gener

error in website text

2014-02-26 Thread Janek Warchoł
Hello, On clojure.org/rationale there is a sentence It endeavors to be a general-purpose language suitable in those areas where > Java is suitable It seems that a "not" is missing at the end. best, Janek Warchoł -- You received this message because you are subscribed to the Google Groups

Re: Source code reloading with leiningen checkouts

2014-02-26 Thread Sven Richter
Hi, I tried it with a junction already and tried it now once more with the tool you provided as a link. It still does not work. This are the project.clj of the two projects: (defproject lweb "0.1.0-SNAPSHOT" :repl-options {:init-ns lweb.repl} :dependencies [[ring-server "0.3.1"] depe

[ANN] Sente - Clojure(Script) + core.async + WebSockets/Ajax

2014-02-26 Thread Peter Taoussanis
Hi folks, Quick post to announce a new lib release: https://github.com/ptaoussanis/sente >From the README: *Sente* is small client+server library that makes it easy to build *reliable, high-performance realtime web applications with Clojure*. * *Bidirectional a/sync comms* over both *WebSocket

Re: How to override the default port on 3000?

2014-02-26 Thread action
It's ok! Think you for all the answer! 在 2014年2月25日星期二UTC+8下午10时21分05秒,action写道: > > I do like this: > #lein new compojure-app guestbook > #cd guestbook > #lein ring server > > The server runs on port 3000 by default. > But how to override the default port? > Such as runs on port 80? > > thinks >

Re: Clojure / polyglot position at OpinionLab in Chicago

2014-02-26 Thread John Jacobsen
On Monday, February 24, 2014 8:46:58 PM UTC-6, Devin Walters (devn) wrote: > > It seems like this comes up with many of the job posts. Perhaps we should > have some guidelines around what details should be provided in the average > job post to cut down on some of the noise that follows. > That m

Re: Comparing Regular Expression pattens for equality?

2014-02-26 Thread Jan Herich
Clojure re-uses java.util.regex.Pattern objects. This object doesn't override equals method, so object references are always compared. But you can easily get pattern string from compiled pattern and then compare just them: user=> (= (.pattern #"test") (.pattern #"test")) true Dňa streda, 26.

Re: Comparing Regular Expression pattens for equality?

2014-02-26 Thread Michael Gardner
You can compare the output of the .pattern or .toString methods if all you care about is finding regexes made from the exact same patterns. There's no simple way to detect equivalent regexes made from different patterns, though. As for why = doesn't do this, you'd have to talk to the Java folks

Comparing Regular Expression pattens for equality?

2014-02-26 Thread Thomas
Hi Everyone, I am creating some regular expressions programmatically with re-pattern. In order to avoid creating the same regex pattern again I want to check if it already exists. But comparing regex pattern doesn't seem to be work: user=> (= #"test" #"test") false user=> (identical? #"test" #"

Re: Is there a function to determine if code is run as script or library ?

2014-02-26 Thread Rob Day
'lein run -m ' will run the "main-" function of a namespace, which otherwise won't be run unless deliberately invoked (like all functions). Is that what you're looking for? (See https://github.com/technomancy/leiningen#basic-usage). On 26 February 2014 09:57, Aaron France wrote: > > Hi, > > > Yo

Re: Interested in GSOC

2014-02-26 Thread Rohan Prinja
Hi Maik, thanks for the pointers! Will follow up on protocols and the Data Set implementation as mentioned. On Wednesday, 26 February 2014 03:24:00 UTC+5:30, Maik Schünemann wrote: > > Hi, > > On Tue, Feb 25, 2014 at 8:59 PM, Rohan Prinja > > > wrote: > > Hi everyone. I'm Rohan Prinja, a thir

Re: Is there a function to determine if code is run as script or library ?

2014-02-26 Thread Aaron France
Hi, You can implement https://github.com/clojure-cookbook/my-daemon for your application. I've had great success with this. Aaron On Wed, Feb 26, 2014 at 01:50:43AM -0800, macdevign mac wrote: >Hi, >is there a function to determine if the clojure code is running as library >or as s

Is there a function to determine if code is run as script or library ?

2014-02-26 Thread macdevign mac
Hi, is there a function to determine if the clojure code is running as library or as script ? In ruby, there is if __FILE__==$0 # this will only run if the script was the main, not load'd or require'dend In Java, we could include main method in class, and choose to run it, How about cloju

Re: Source code reloading with leiningen checkouts

2014-02-26 Thread Shantanu Kumar
On Wednesday, 26 February 2014 14:58:06 UTC+5:30, Niels van Klaveren wrote: > > Windows (7) has different versions of linking. For checkouts to work on > Windows 7 you need to have a *junction* to the directory, not a symbolic > link. > I make mine with Link Shell Extension for Windows > Explo

Re: Source code reloading with leiningen checkouts

2014-02-26 Thread Niels van Klaveren
Windows (7) has different versions of linking. For checkouts to work on Windows 7 you need to have a *junction* to the directory, not a symbolic link. I make mine with Link Shell Extension for Windows Explorer, and have no probl

Re: Can't start repl with Leiningen

2014-02-26 Thread Matej Fröbe
It seems that this is independent of where I run the project. It happens with default project, which has no ":eval-in :trampoline" in it: *$ lein new my-project$ cat my-project/project.clj (defproject my-project "0.1.0-SNAPSHOT" :description "FIXME: write description" :url "http:/