Chas,
thank you for the explanation, it confirmed my vague thoughts I had after
quick review of Clojure source code and inspection of values in prototype
maps before and after the change.
I understand the difference, however I think there are three points to
consider from Clojure design point
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 t
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
Antonio Recio:
> And I would know if this is correct conversion in clojure?
> (def cc
> [(for [i (range 256)]
> (.. ctf GetColor (/ i 255.0)))])
It is correct in the sense that it will do the same thing. If you have a
collection and need to calculate
a value for every element in it and re
I think versions with `for` is a hell more readable.
I vote for this:
(def cc
(for [i (range 256)]
(.GetColor ctf (/ i 255.0
воскресенье, 24 июня 2012 г., 16:15:14 UTC+6 пользователь Michael Klishin
написал:
>
> Antonio Recio:
>
> > And I would know if this is correct conversion in c
Dan,
Re: (2), yes, using higher-order functions effectively is a big part of
functional programming. But, no, passing a var to HOFs in every case instead
of dereferencing its value is not a good blanket policy. You need to have a
clear notion of what you want to happen and what the contract o
Funny,
We implemented something similar using zookeeper (thanks to David for
zookeeper-clj). We store data as Clojure expressions. This was a move to
have a cluster unified view of configuration data and go away from alien
representations (we used Yaml in several places).
I can't see the added v
Hey Everyone,
I've been using lamina channels to create queues to download files/web
pages in parallel. I'm using clj-http as my client as it supports proxies.
So basically I create a channel, then use map* to fetch process and queue
up pages in the channel. My fetch-url-with-proxy function, di
On Saturday, June 23, 2012 12:43:38 AM UTC+2, wingie wrote:
>
> Since you love FP I wanted to mention another option:
>
> LiveScript
>
>
> http://gkz.github.com/LiveScript/blog/functional-programming-in-javascript-using-livescript-and-prelude-ls.html
> http://gkz.github.com/LiveScript
> http://gkz.
Hi there,
My current development environment is that: Sublime Text 2 editor with
the fabulous SublimeREPL plugin to be able to copy code into the Clojure
REPL.
As absurd as it may seem... I can't find the combination of keys to send
functions or selected code to the REPL. It's supposed to be t
Hi,
I am looking for two seemingly simple operations which require adding
to the list:
(( 1 2 ) ( 20 30) (40)) 50 => (( 1 2 ) ( 20 30) (40 50))
and
(( 1 2 ) ( 20 30) (40 50)) 60 => (( 1 2 ) ( 20 30) (40 50) (60))
Basically it is appending an element as a list to the list
I guess you should use vectors, since you can't effectively add an element
to the end of list.
понедельник, 25 июня 2012 г., 0:46:24 UTC+6 пользователь Andy C написал:
>
> Hi,
>
> I am looking for two seemingly simple operations which require adding
> to the list:
>
> (( 1 2 ) ( 20 30) (40))
Yeah, this becomes much more straightforward using vectors.
--
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
fir
I have this python line that gives the number "1" as result
print vtkDataObject.FIELD_ASSOCIATION_CELLS
;=> 1
And I would like to convert it to clojure.I have tried this 3 way, but I
think they are incorrect. Which is the correct way?
(println (vtkDataSetAttributes.SCALARS))
;=> #
(println v
The python line that I have rote before is not the one that I want to
convert. The correct python line is this, and the result is "0". How I can
convert it to clojure?
print vtkDataSetAttributes.SCALARS
;=> 0
--
You received this message because you are subscribed to the Google
Groups "Clojure"
I know, but this is list :-)
--
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 th
Chas,
once again thank you for very detailed explanation :) I have not seen all
the implications of language implementation on top of JVM. I spent some
time thinking about the issue and now I see all design choices
and trade-offs, especially when type/prototype system must be fast and
thread safe
I discovered partition-all and came up with this function:
(fn [l x] (concat (butlast l) (partition-all 2 (concat (last l)
[x]
user> ((fn [l x] (concat (butlast l) (partition-all 2 (concat (last l)
[x]
'()
10)
((10))
user> ((fn [l x] (concat (butlast l) (partition-all 2 (con
Andy Coolware writes:
> Hi,
>
> I am looking for two seemingly simple operations which require adding
> to the list:
>
> (( 1 2 ) ( 20 30) (40)) 50 => (( 1 2 ) ( 20 30) (40 50))
>
> and
>
> (( 1 2 ) ( 20 30) (40 50)) 60 => (( 1 2 ) ( 20 30) (40 50) (60))
>
>
> Basically it
Or even shorter, but maybe not as fast because it flattens the given
list, then pairs it up again. Thus it also assumes the resulting list
should consist ENTIRELY of pairs and singletons, not just the last or
penultimate element:
(fn [l x] (partition-all 2 (concat (flatten l) [x])))
On Jun 24, 2
On Sun, Jun 24, 2012 at 11:20 AM, Jacobo Polavieja
wrote:
> Hi there,
>
> My current development environment is that: Sublime Text 2 editor with
> the fabulous SublimeREPL plugin to be able to copy code into the Clojure
> REPL.
>
> As absurd as it may seem... I can't find the combination of keys t
hi i need help!!!
i have a project to finish but i keep on hitting this error:
Could not locate clojure/contrib/string__init.class or
clojure/contrib/string.clj on classpath:
i tried everything i know (which is not much) and i read tons of metiral in
the net, but i still
cant figure out how to
omer writes:
> hi i need help!!!
> i have a project to finish but i keep on hitting this error:
> Could not locate clojure/contrib/string__init.class or
> clojure/contrib/string.clj on classpath:
> i tried everything i know (which is not much) and i read tons of metiral in
> the net, but i still
On Sunday, June 24, 2012 11:27:44 PM UTC+2, Charlie Griefer wrote:
>
> On Sun, Jun 24, 2012 at 11:20 AM, Jacobo Polavieja
> wrote:
> > Hi there,
> >
> > My current development environment is that: Sublime Text 2 editor with
> > the fabulous SublimeREPL plugin to be able to copy code into the
On Sun, Jun 24, 2012 at 2:54 PM, Jacobo Polavieja
wrote:
> In fact, those are some of the many ones I've tried, without success. When I
> press that combination it just writes the lowercase "L", as if I wasn't
> pressing the F2 button. I've tried it with both my notebook and an external
> keyboar
I'm trying to use contrib.string and i'm currently using clojure 1.3...
Basiclly i need the fuctionalty of . String as split, and such...
On 25 בJun 2012 00:53, "Moritz Ulrich" wrote:
>
> omer writes:
>
> > hi i need help!!!
> > i have a project to finish but i keep on hitting this error:
> > Co
Try clojure.string: http://clojuredocs.org/clojure_core/clojure.string
It's available in 1.3 and replaces clojure.contrib.string. You can
also access all methods of java.lang.String via java interop.
On Mon, Jun 25, 2012 at 12:12 AM, עומר כהן wrote:
> I'm trying to use contrib.string and i'm cu
On Monday, June 25, 2012 12:05:17 AM UTC+2, Charlie Griefer wrote:
>
> On Sun, Jun 24, 2012 at 2:54 PM, Jacobo Polavieja
> wrote:
>
> > In fact, those are some of the many ones I've tried, without success.
> When I
> > press that combination it just writes the lowercase "L", as if I wasn't
>
On Sun, Jun 24, 2012 at 3:59 PM, Jacobo Polavieja
wrote:
> On Monday, June 25, 2012 12:05:17 AM UTC+2, Charlie Griefer wrote:
>> Just to confirm... you're hitting F2, releasing F2, and _then_ hitting
>> the "l" key, correct? Not both keys simultaneously?
>
> I've tried both options, hehe! Same res
On Monday, June 25, 2012 1:05:42 AM UTC+2, Charlie Griefer wrote:
>
> On Sun, Jun 24, 2012 at 3:59 PM, Jacobo Polavieja
> wrote:
> > On Monday, June 25, 2012 12:05:17 AM UTC+2, Charlie Griefer wrote:
> >> Just to confirm... you're hitting F2, releasing F2, and _then_ hitting
> >> the "l" key,
On Sun, Jun 24, 2012 at 4:15 PM, Jacobo Polavieja
wrote:
>
> On Monday, June 25, 2012 1:05:42 AM UTC+2, Charlie Griefer wrote:
>>
>> On Sun, Jun 24, 2012 at 3:59 PM, Jacobo Polavieja
>> wrote:
>> > On Monday, June 25, 2012 12:05:17 AM UTC+2, Charlie Griefer wrote:
>> >> Just to confirm... you're
Hi all,
I was looking for a way to:
* encourage folks to write docs for their Clojure projects
* make usage examples available (like clojuredocs.org has, but for
general Clojure-related projects)
* help semi-standardize how Clojure projects are documented
So I made this:
http://www.unexpe
John Gabriele:
> Opinions? Concerns? Wild praise? Searing complaints? General disinterest?
This is a great initiative but so far it seems to focus only on the API
reference part of documentation.
I personally think that documentation guides are just as important [1].
For clojurewerkz.org projec
It's a great initiative indeed, but I found the project pretty useless in
its current state. Forking the repo and sending a pull request just to add
an example is painful. Also, I can read rendered readme on github (and have
the source code at hand), so why go to another site?
I think what woul
On Jun 25, 12:14 am, Michael Klishin
wrote:
> John Gabriele:
>
> > Opinions? Concerns? Wild praise? Searing complaints? General disinterest?
>
> This is a great initiative but so far it seems to focus only on the API
> reference part of documentation.
I'd think that autogenerated docstring docs
On Jun 25, 12:52 am, Vinzent wrote:
> It's a great initiative indeed, but I found the project pretty useless in
> its current state. Forking the repo and sending a pull request just to add
> an example is painful.
Hm. Thanks for the feedback.
> Also, I can read rendered readme on github (and hav
One thing I forgot to mention: it'd be nice to have Marginalia support,
since it can be used not only for annotated source code, but also for
documentation with embedded tests (although, two-column layout doesn't fit
very well for this purpose, but it's another question).
> That's true. The
37 matches
Mail list logo