On Mon, Mar 19, 2012 at 2:40 PM, Bojan bojandoli...@hotmail.com wrote:
Hi!
I'm a beginner at clojure and enjoying the learning process. While writing
my first nontrivial program, I noticed that I'm transforming only first
elements in the list, so I factored this transformation out by writing
On Wed, Jan 25, 2012 at 10:45 AM, Simon Holgate simon.holg...@gmail.com wrote:
I've retrieved some data from my database which is returned as a
clojure.lang.PersistentVector:
org.psmsl.netcdf.core res
[{:name BREST, :time #Date 1807-01-01, :rlrdata 6882M} {:name
BREST, :time #Date 1807-02-01,
Den 16 januari 2012 16:58 skrev joachim joachim.de.be...@gmail.com:
However, when I try the same in an emacs repl, I get Lisp connection
closed unexpectedly: connection broken by remote peer. I have no idea
what is going on or how to deal with this problem. Sometimes during
development I like
.
the Encoding Guy at your service,
Rasmus Svensson (raek)
--
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
2011/8/16 Thomas th.vanderv...@gmail.com:
Hi everyone,
I have been struggling with this, hopefully, simple problem now for
quite sometime, What I want to do is:
*) read a file line by line
*) modify each line
*) write it back to a different file
This is a bit of sample code that
2011/7/21 octopusgrabbus octopusgrab...@gmail.com:
Thanks. You're right.
(:require [clojure.contrib.string :as cstr]) ; str already defined
There should be no conflict between the var str (clojure.core/str)
and the namespace alias str (clojure.string). Names for vars and
namespaces never occur
2011/7/14 OGINO Masanori masanori.og...@gmail.com:
Hello.
What is the right way to display namespace docstrings?
One day, as usual, I typed:
(doc 'clojure.core) ; or other namespace
Then the REPL said clojure.lang.Cons cannot be cast to clojure.lang.Symbol.
I thought Ah, I know, the
are opened with the default encoding,
which I believe you set with the file.encoding property.
// Rasmus Svensson (raek)
--
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
into string syntax. If
you happen to want to serialize this object later (e.g. print it at
the repl or dump it to a text file), this regex object will print as
an ordinary regex literal.
* Using syntax-quote is probably more ideomatic here.
// Rasmus Svensson (raek)
--
You received this message
. Let me know if something in my instructions does not
work, or if you have other questions.
// Rasmus Svensson (raek)
--
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
2011/6/6 Base basselh...@gmail.com:
hi all,
I am working on an app that will parse web pages to do some NLP and
statistics. I am able to parse the HTML using several different tool
( enlive, HTML parser, etc). However I would like to discard all the
rest of the junk in the web page that is
expressions directly after the
tildes, but I wanted to demonstrate the possibility of using def here.
Hope this helps!
// Rasmus Svensson (raek)
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure
2011/4/27 John V johnv02...@gmail.com:
Hi, I would like to have syntax highlighting for Clojure code in
Emacs. I am using Emacs on Windows (23.2.1). I found this page:
http://dev.clojure.org/display/doc/Getting+Started+with+Emacs
... but it was clearly much more involved than I was looking
2011/4/27 John V johnv02...@gmail.com:
Hi, I would like to have syntax highlighting for Clojure code in
Emacs. I am using Emacs on Windows (23.2.1). I found this page:
http://dev.clojure.org/display/doc/Getting+Started+with+Emacs
... but it was clearly much more involved than I was looking
See this tread for why stdin is not directly available with lein:
http://groups.google.com/group/leiningen/browse_thread/thread/f9f9ed97eb8a2928/ccab95588ef50d05?lnk=gstq=stdin
This is currently impossible due to a bug in ant; it just swallows
stdin completely, and they seem to have no intention
The answer would be a mix of A and B, mostly because there seems to be
an assumption that you have to consider concurrency everywhere in
order to be able to have it at some point later. This is not the case.
You do tend to be very explicit about concurrency and only use the
concurrency primitives
2011/2/15 Thorsten Wilms t...@freenet.de:
Hi!
I managed to get to a Hello world level using appengine-magic, plus an
Emacs Swank/Slime setup.
I haven't used appengine-magic myself, but I do interactive web
programming from Emacs (mainly using Ring + Moustache + Enlive), so I
thought I'd share
P.S.
I forgot to mention that a lot of really useful slime commands are
documented at the swank-clojure project site:
https://github.com/technomancy/swank-clojure
// raek
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send
2011/2/8 Brian Marick mar...@exampler.com:
The header documentation for clojure.contrib.condition says:
Note: requires AOT compilation.
What do I therefore do differently? How should my program text change?
The clojure-contrib jar file that your build tool - or yourself, if
you do stuff
To turn a signed byte (-128 to 127) into an unsigned one:
(bit-and the-byte 0xff)
The byte (for example 0x80, which is negative) will be extended to an
int (0xff80) and anded with 0x00ff (and you get 0x0080,
which is positive).
The javadoc for the methods of DataInput[1] contain
2011/1/24 Michael Gardner gardne...@gmail.com:
Suppose I have a sequence of tasks I'd like to parallelize using pmap. The
amount of CPU time these tasks require varies greatly; in particular, many of
them will require virtually no work. Can I rely on pmap to divide the work
efficiently even
2011/1/27 Ken Wesson kwess...@gmail.com:
On Thu, Jan 27, 2011 at 2:09 PM, Michael Gardner gardne...@gmail.com wrote:
On Jan 27, 2011, at 7:24 AM, Rasmus Svensson wrote:
If you simply want all tasks to be performed as quickly as possible,
one alternative could be to use an ExecutorService
2011/1/16 Robert Campbell rrc...@gmail.com:
The second form - (.foo bar), expanded to (. bar foo) - eventually
calls Reflector.invokeNoArgInstanceMember.
For that form, the clojure compiler cannot infer the type of bar, and
does not know which exact method (class + type signature) .foo
2010/12/3 Andreas Kostler andreas.koestler.le...@gmail.com:
Hi All,
May I cite an Author of a populer Clojure book:
If you find yourself wishing yourself to repeatedly check a work queue to
see if there's an item of work to be popped off,
or if you want to use a queue to send a task to
2010/11/24 HiHeelHottie hiheelhot...@gmail.com:
Does anybody know of an implementation for a priority queue that can
be used for scheduling events in the future? I would like to put a
map associated with a timestamp into the queue and be able to pull out
all maps at or before a given time in
2010/11/21 HiHeelHottie hiheelhot...@gmail.com:
Does anybody know how to redirect the output into the repl?
Thread local bindings are not passed on to new threads. Since you
might have multiple connections to the swank server, there might me
multiple repls, each one with their own *out*. Most
2010/11/21 HiHeelHottie hiheelhot...@gmail.com:
I think ruby has nice string interpolation. You can put the following
in a textfield that a user can modify
This is a #{adjective} string.
Then, you can take that string, put it in quotes and have ruby
evaluate it as a string. What is the
I also noticed that clojure.org/agents does not mention the *agent* var...
// raek
--
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
2010/10/29 Dilvan dil...@gmail.com:
Any clues?
I don't know much about how Jython works, but from the stack trace it
seems like Clojure cannot load its source files from the classpath.
Are there other ways to add jars to the classpath in Jython?
// raek
--
You received this message because
It seems like this is a class loader issue... The guys working on
clojure-ant-tasks seems to have hit the same problem:
https://github.com/jmcconnell/clojure-ant-tasks/issues#issue/5/comment/223478
I also found these two issues:
http://dev.clojure.org/jira/browse/CLJ-260
2010/11/9 Carlos Moscoso moscoso@gmail.com:
user= (- {:a 1} (keyword a))
- is simply a code rewrite macro. You can use macroexpand-1 to see
how the rewrite is done:
user= (macroexpand-1 '(- {:a 1} (keyword a)))
(keyword {:a 1} a)
As Sunil said, you can get the desired behaviour by adding
2010/11/9 Greg g...@kinostudios.com:
I think to answer both questions I should explain the context of this
problem.
I'm currently in the process of learning Clojure, and as an ex cerise to
assist in this endeavor I set about solving a problem presented in the
classic game called Myst.
One of
For fun, I made my own code for proving your result:
https://gist.github.com/668830
(contains? (reachable-states [3 3 3]) [2 2 1])
= false
//raek
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to
2010/11/4 Ken Wesson kwess...@gmail.com:
The ns macro seems to be poorly documented as yet. The Namespaces page
at the main Clojure site does not go into detail about its syntax;
Yes. The docs related to the ns form are indeed insufficient and need attention.
However, have you seen the
I think there should be a link from the Namespaces page to the Libs
page. Hopefully, this will make it easier for people to find examples
on how to use the ns form.
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to
2010/11/1 tonyl celtich...@gmail.com:
I was wondering since it uses the dispatch macro and AFAIK
there is no api fn to create them like hash-maps to create maps,
vector/vec for vectors, or list for lists.
There are parallels to 'hash-map' and 'sorted-map' in the api:
user= (hash-set :a :b :c)
2010/10/31 Steven Arnold thoth.amon.i...@gmail.com:
Hello, I am trying to use the str-utils library with Clojure (or the
str-utils2, I understand str-utils was deprecated). Neither of these
work for me. I am on OS X 10.6.4 and have installed clojure-contrib
via the MacPorts system. The
2010/11/3 John Szakmeister j...@szakmeister.net:
I'm sorry... I don't quite understand this explanation. Do you mean
that reduce is realizing the entire list all at once? I would think
it would grab an element one at a time. Sorry for the stupid
question, but there's something subtle here
Hi Clojurians of Linköping!
This is an invitation for the upcoming startup meeting of a new
Clojure group in Linköping.
On 29th of September (next Wednesday), Linköping Clojure User Group
will have its first meeting. (Those of you who hang around in House B
at the University may have already
2010/9/20 Andrew Gwozdziewycz apg...@gmail.com:
I'd like to propose that we make an effort to list
these groups on Meetup Everywhere (http://www.meetup.com/everywhere),
which is a free platform useful for finding a nearby meetup about a
given topic.
Hi!
Linköping Clojure User Group will have
2010/9/24 cej38 junkerme...@gmail.com:
I noticed that clojure.string is not showing up on the API webpage,
http://clojure.github.com/clojure/, is that an oversight?
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email
There's also 'bytes', 'byte-array' and 'into-array':
(byte-array (map byte [1 2 3]))
(into-array Byte/TYPE (map byte [1 2 3]))
// raek
--
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
2010/8/17 jandot jan.ae...@gmail.com:
Hi all,
I'm trying to write a library to perform some statistical and data
mining analyses. Clojure has proven a great help here, especially with
the incanter library. Writing the code has been kind of an organic
process (read: no planning), and I ended
I think there's a lot of questions that a Clojure programmer faces
when doing web programming, not only regarding how the libraries work,
but also regarding how to design a larger-than-trivial web
applications.
A mail list would be a very good way to be able to ask for advice or
to be inspired by
2. multiline comments like java
/* this is a
multiline comment */
I don't know.
Comment blocks are usually done by starting each line with ;;
;; this is
;; a comment
;; block
(some-code)
Anything after a ; is a comment, like python's #. There is a
convention for how many ;s to begin
2010/8/16 Alan a...@malloys.org:
I hear that swank.core/break has more functionality in 1.2, so I am
trying to upgrade to it, but I think I don't have a clear enough
understanding of what is going on when lein/clojure run, as I am
running into problems.
$ cat project.clj
(defproject ddsolve
2010/8/12 James Reeves jree...@weavejester.com:
On 12 August 2010 14:33, limux liumengji...@gmail.com wrote:
The solution in http://tiny.cc/3cmrx is useful, thanks.
That what cause the issue should be compojure. That thread's time is
6, June.
and compjure haven't fixed it.
The solution you
I assume the problem is that there are no .class files in the jar. I
tried to rebuild the compojure jar using lein jar but still didn't
get .class files, even though:
Clojure looks for both .class files and .clj files, so you don't need
to compile anything manually.
I'm seeing the following
2010/8/10 limux liumengji...@gmail.com:
There is some chinese chararters in the tables. I want to display them
by hiccup, but browser display those chinese character as ???.
I spoke to him on #clojure and from what I could tell from some
experiments I asked him to run:
(map int 刘孟江) - (21016
I looked into the source of hiccup and tried entering the string 刘孟江
at various places, but I couldn't reproduce the error or find any code
that did any form of encoding.
When playing around with the repl, I was reminded that JLine (used by
lein repl) does not support multibyte encodings
2010/8/10 Alan a...@malloys.org:
I have the following function as part of a card-game system I'm
developing:
(defn make-suit
[suit owner ranks]
{suit (map (partial struct-map card
:suit suit
:owner owner
:rank)
2010/8/1 doug 395curra...@gmail.com
Hey all!
can't seem to get the last element to bind. tia -doug
user cj-mpdata
[0010335602 40.00 1060.51 6/23/2010 DISCOVER E-
PAYMENT 7796 (DISCOVER)]
user (let [[[_ ck db cr _ dt _ _ _][dsc]]
[[Acct Chk Debt Crd Bal Date Desc
2010/7/17 Moritz Ulrich ulrich.mor...@googlemail.com
clojure-namespaces should be treated like java-namespaces: (ns
foo.bar) instead of (ns foo-bar)
I think he refered to the fact that the hyphen in the (single) namespace
segment was not translated into an underscore.
// raek
--
You
This is most probably a repl-terminal encoding mismatch issue.
Are you using JLine? It seems to be the case that it cannot handle UTF-8.
There is a simple way to see if there is encoding mismatch issues: just make
a seq of the string:
(seq t)
if everything is working correctly:
= a seq of the 9
2010/6/18 Mohammad Khan beepl...@gmail.com
C:\Projects.cljjava -cp
c:\clojure-contrib\clojure-contrib.jar;c:\clojure\clojure.jar clojure.main
Clojure 1.1.0-alpha-SNAPSHOT
user= (require 'examples.introduction)
java.io.FileNotFoundException: Could not locate
examples/introduction__init.class
2010/5/11 Stuart Halloway stuart.hallo...@gmail.com
Assembla Ticket #311 [1] calls for the promotion of clojure.contrib.iointo
clojure (as
clojure.java.io). I have attached a patch, and am requesting comments and
code review from the community.
I think I have found a bug in the
2010/6/12 Dan Larkin d...@danlarkin.org
Does anyone have insight as to the reasoning here? Is it a bug? If it's
intended behavior is there something I can do to circumvent it?
I do think this is intentional.
Agents holding on to their sends until its state transition function is
done can be
I thought I'd just share some thoughts on special forms...
2010/5/20 Konrad Hinsen konrad.hin...@fastmail.net
You can't redefine special forms. What you define in your examples is the
symbols that serve to identify special forms. But they indicate special
forms only when used in the first
2009/10/19 Gorsal s...@tewebs.com:
All right, so this is probably way off topic, but what software was
used to create the clojure cheat sheet?
http://clojure.org/cheatsheet
I really like the format and would like to make one for my own
utilities so that I can actually remember what general
59 matches
Mail list logo