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 u
Hello friends,
I am new in clojure, i want to create document in couch db using
clojure. i got some error please help me.
my code is
(ns web-app.views.welcome
(:require [clj-file-utils.core :as f-util]
[noir.content.getting-started]
[noir.response :as resp])
(:use [noir.core :o
Here's a version I hacked up a while ago:
https://gist.github.com/1472163
-S
--
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 pat
I don't know if this works for this case, but the special namespace "js"
allows access to raw JavaScript objects. Try js/Buffer
-S
--
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 th
Thank you Tom!
Exactly was I was looking for!
I will TRY to add some documentation to clojuredocs.org just so people
won't be that afraid, this xml-functionality is a very sane way of doing
it, it's just takes a while to get used to it (I'll check that it's refered
to the correct namespace as wel
core.cache v0.5.0 Release Notes
===
core.cache is a new Clojure contrib library providing the following
features:
* An underlying `CacheProtocol` used as the base abstraction for
implementing new synchronous caches
* A `defcache` macro for hooking your `CacheProtocol`
Great. Happy to help!
On Dec 13, 7:39 am, Linus Ericsson
wrote:
> Thank you Tom!
>
> Exactly was I was looking for!
>
> I will TRY to add some documentation to clojuredocs.org just so people
> won't be that afraid, this xml-functionality is a very sane way of doing
> it, it's just takes a while t
I think I found a bug
user=> (bean "hi")
{:empty false, :class java.lang.String, :bytes #}
user=> (clojure.walk/stringify-keys (bean "hi"))
AbstractMethodError
clojure.lang.APersistentMap.empty()Lclojure/lang/IPersistentCollection;
clojure.core.proxy$clojure.lang.APersistentMap$0.empty (:-1)
Che
I've started working on a debugging infrastructure for ClojureScript based
on the WebKit Remote Debugging Protocol (WRDP). There's not much to see
here yet, but I've been surprised how much we get for free from the WRDP.
Most of the challenges will be around providing a good sexpr level
debugging e
Thanks Tom. Using proxy like this could work. But i'm worried about
one thing.What happens if I have many instances? With proxy there's a
new class with each instance. Could I run out of permgen space?
On Dec 13, 9:38 am, Tom Faulhaber wrote:
> Razvan,
>
> I think that you can implement your idea
I don't want to change the interface i'm exposing to the outer world.
May be that I'm thinking too javaish, but what I miss here is a
possibility to extend the base class. :)
On Dec 12, 9:31 pm, James Reeves wrote:
> On 12 December 2011 18:54, Razvan Rotaru wrote:
>
> > - function returns a valu
Thanks. I don't know how this hashmap works, but at the first glance
there seems to be one problem: the two values don't get garbage
collected at the same time. I'll look more into it, thanks.
On Dec 13, 3:10 am, Stephen Compall wrote:
> On Mon, 2011-12-12 at 10:54 -0800, Razvan Rotaru wrote:
> >
It's not clojure.walk, it's bean:
user=> (empty (bean "hi"))
AbstractMethodError
clojure.lang.APersistentMap.empty()Lclojure/lang/IPersistentCollection;
clojure.core.proxy$clojure.lang.APersistentMap$0.empty (:-1)
The generated class doesn't implement the 'empty' method.
Please file a JIRA ti
Issue is in bean, not walk. walk calls (empty foo) on its collection,
in order to make sure you get back a collection of the same type. bean
maps are, I guess, some special type rather than an ordinary
c.l.PersistentHashMap; and that type doesn't implement the full
IPersistentCollection contract (i
On Tue, Dec 13, 2011 at 11:38 AM, Alan Malloy wrote:
> Issue is in bean, not walk. walk calls (empty foo) on its collection,
> in order to make sure you get back a collection of the same type. bean
> maps are, I guess, some special type rather than an ordinary
> c.l.PersistentHashMap; and that typ
On Dec 13, 11:36 am, Stuart Sierra
wrote:
> It's not clojure.walk, it's bean:
>
> user=> (empty (bean "hi"))
> AbstractMethodError
> clojure.lang.APersistentMap.empty()Lclojure/lang/IPersistentCollection;
> clojure.core.proxy$clojure.lang.APersistentMap$0.empty (:-1)
>
> The generated class doesn'
I think I understand namespace and then I don't!
I try to run this example
(ns examples.core
(use [clarity.component :as c]))
(make :button "The Button")
I have programs stored in c:\projects\klarity.clj
I have clojure stored in c:\clojure-1.2.1\clojure-1.21.
I am running c:\cljr\clj-installer
On Tue, 2011-12-13 at 10:52 -0800, Razvan Rotaru wrote:
> Thanks. I don't know how this hashmap works, but at the first glance
> there seems to be one problem: the two values don't get garbage
> collected at the same time.
There are problems with weak hashmaps, but I wouldn't count that among
them
On Mon, 2011-12-12 at 10:53 -0800, Michael Jaaka wrote:
> (defn conr[ col item ]
> (lazy-seq
> (if (seq col)
> (cons (first col) (conr (rest col) item))
> (list item
>
> And now stick with it.
> All works as desired:
>
> (conr (c
On Tue, Dec 13, 2011 at 2:51 PM, Alan Malloy wrote:
> On Dec 13, 11:36 am, Stuart Sierra
> wrote:
>> It's not clojure.walk, it's bean:
>>
>> user=> (empty (bean "hi"))
>> AbstractMethodError
>> clojure.lang.APersistentMap.empty()Lclojure/lang/IPersistentCollection;
>> clojure.core.proxy$clojure.l
On Dec 13, 3:05 pm, Stephen Compall wrote:
> On Mon, 2011-12-12 at 10:53 -0800, Michael Jaaka wrote:
> > (defn conr[ col item ]
> > (lazy-seq
> > (if (seq col)
> > (cons (first col) (conr (rest col) item))
> > (list item
>
> > And now stick w
Thank you. It works now.
However, I think this is an issue of compiling clojurescript to
nodejs. *Buffer* is a nodejs specific function like *require* (a
nodejs function). So maybe we'd better use it like the way we use
require: (cljs.nodejs/require).
When compiled to nodejs, require is added to t
No, I'm sure to not use all the sequence, so I will follow your second
advice, but...
Cause of my non-perfect english I've not really understand the last
part.
Who is the caller ?
You suggest something like this:
(let [fl (clojure.java.io/reader "path/filename")
rd (lazy-reader fl)]
(do-m
On Tue, Dec 13, 2011 at 10:14 PM, Simone Mosciatti wrote:
> No, I'm sure to not use all the sequence, so I will follow your second
> advice, but...
>
> Cause of my non-perfect english I've not really understand the last
> part.
> Who is the caller ?
> You suggest something like this:
>
> (let [f
On Tue, 2011-12-13 at 16:28 -0800, Alan Malloy wrote:
> As you can see, only as many elements are realized as are needed to
> satisfy the user's request.
Yes, in the expression (conr (conr (conr '( 1 2 3) 4) 6) 7), all the
lazy-seqs implied by the conr calls must be forced immediately to yield
(1
Ok, now by now i think to have understand...
To do right, I should build a macro similar to let where I pass the
filename and after execute the body close the stream, right ?
On Dec 13, 9:42 pm, Cedric Greevey wrote:
> On Tue, Dec 13, 2011 at 10:14 PM, Simone Mosciatti wrote:
> > No, I'm sure t
As part of a larger project, Topoged, I am developing a Hibernate
library that makes working with Hibernate from within Clojure much
easier IMHO. It uses the standard Hibernate configuration and
provides wrappers and whatnot to simplify the interaction. For
example, to write a record to the data
On Tue, Dec 13, 2011 at 11:12 PM, Simone Mosciatti wrote:
> Ok, now by now i think to have understand...
>
> To do right, I should build a macro similar to let where I pass the
> filename and after execute the body close the stream, right ?
Easier to just use the pre-existing one: with-open.
Som
I am working on making library useful to the public:
https://github.com/m0smith/topoged-hibernate
One question I would like a comment on: I have been using entity-maps
rather than POJOs because it makes for a cleaner interop with
Clojure. The amount of code needed goes way down while the standa
On Dec 13, 7:56 pm, Stephen Compall wrote:
> On Tue, 2011-12-13 at 16:28 -0800, Alan Malloy wrote:
> > As you can see, only as many elements are realized as are needed to
> > satisfy the user's request.
>
> Yes, in the expression (conr (conr (conr '( 1 2 3) 4) 6) 7), all the
> lazy-seqs implied by
Where by now:
(defn lazy-reader [fl]
(assert ...)
(lazy-seq
(cons (.read fl) (lazy-reader fl
The first one ?
This means that I haven't understand nothing, right?
(I'm so sorry for this stupid question... :embarassed: )
On Dec 13, 10:23 pm, Cedric Greevey wrote:
> On Tue,
On Tue, Dec 13, 2011 at 11:25 PM, Alan Malloy wrote:
> On Dec 13, 7:56 pm, Stephen Compall wrote:
>> On Tue, 2011-12-13 at 16:28 -0800, Alan Malloy wrote:
>> > As you can see, only as many elements are realized as are needed to
>> > satisfy the user's request.
>>
>> Yes, in the expression (conr (
On Tue, Dec 13, 2011 at 11:33 PM, Simone Mosciatti wrote:
> Where by now:
> (defn lazy-reader [fl]
> (assert ...)
> (lazy-seq
> (cons (.read fl) (lazy-reader fl
>
> The first one ?
Er, buffering of the I/O is probably preferable, but that would
probably work OK in many cases.
Thank you so much, just one last thing, why you use a char-array ?
If I want use a byte-array, and no map all the whole sequence ?
On Dec 13, 10:39 pm, Cedric Greevey wrote:
> On Tue, Dec 13, 2011 at 11:33 PM, Simone Mosciatti wrote:
> > Where by now:
> > (defn lazy-reader [fl]
> > (assert .
Midje is getting better and better.
Congrats!
On Mon, Dec 12, 2011 at 5:41 PM, Brian Marick wrote:
> Midje 1.3's most important feature is compatibility with Clojure 1.3.
> https://github.com/marick/Midje
>
> Midje is a test framework for Clojure that supports top-down as well as
> bottom-up te
35 matches
Mail list logo