Sorry for the newbie question, but this seems a strange error
message. Either it is saying that a java.lang.Integer cannot be cast
to an Object, or it is saying that it can't be cast to a particular
object. Some enlightenment would be appreciated.
user=> (. String format "%d" 28)
java.lang.Class
at doesn't mean we shouldn't set something like this up;
sometimes it's nice to get a bigger slice of the community.
Anyway, I'll post here again when I've got something working. If anyone
wants to help with coding "Planet Clojure", let me know. Not that it's a
ha
ed it with JRuby, but it's meant to work with any
JVM-hosted language. It seems like it addresses a pain point that is
particularly onerous with Clojure.
-Phil
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
ax highlighting.
htmlize.el works like a dream: http://www.emacswiki.org/emacs/Htmlize
If you're going to blog about code, you definitely want it highlighted;
monochrome code is really hard to read. My brain basically just shuts
off when it sees it; I'
"Tom Emerson" writes:
> On Thu, Dec 18, 2008 at 12:56 PM, Phil Hagelberg
> wrote:
>> This was one of the most disorienting things I encountered when starting
>> with clojure. I'm used to codebases providing a bin/ directory or at
>> least a shell script
You could ask the Eclipse devs to dual-license. =)
I'm not too well-versed in legal lore, but as I understand it, the
compatibility issues come into play if you're creating a "derived
work". It doesn't matter if GPL-licensed files are *distributed* with
clojure-dev;
r come into play. It's only
about incorporating it into another codebase.
-Phil
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to clojure@googlegrou
um, is called an
> "aggregate" if the compilation and its resulting copyright are not
> used to limit the access or legal rights of the compilation's users
> beyond what the individual works permit. Inclusion of a covered work
> in an aggregat
Chouser writes:
> I've added shell-out to clojure-contrib, with an 'sh' function that
> allows usage like:
This is great; I was wondering where such a function was a couple weeks
ago.
Thanks!
-Phil
--~--~-~--~~~---~--~~
You received thi
s great, but it's a far cry from an actual structure editor.
-Phil
--~--~-~--~~~---~--~~
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
To u
e codebase so it can be used independently of how
the application was launched.
There's got to be a way around this problem, but I haven't found it yet.
-Phil
[1] - http://en.wikipedia.org/wiki/Don%27t_repeat_yourself
--~--~-~--~~~---~--~~
You receiv
dependency. It's not a big deal for stuff you'd use internally, but for
open-source projects I like to keep the installation process to a couple
lines. I guess I could bundle a copy of swank-clojure to streamline
things.
Or I could wait until I actually have so
I would love to see clojure.core code in one color, java-level code in
another, "unknown source" (repl-entered) code in another, and my
application's code in white.
I'll definitely be using this; thanks.
-Phil
--~--~-~--~~~---~--~~
You received this
.0 is released without this it would be a shame.
-Phil
--~--~-~--~~~---~--~~
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
To unsubscribe from this g
his part is lazy and therefore not really recursive:
(stateful-map fn-item fn-state
(fn-state state item) (rest coll))
This example can be optimised a little more by using an inner fn, which
should make it a little shorter still.
Hope that helps,
~phil
--~--~-~--~--
e from the wiki for a different non-repl purpose.)
-Phil
--~--~-~--~~~---~--~~
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
To unsubscribe from thi
Craig McDaniel writes:
> On Jan 19, 11:45 am, Phil Hagelberg wrote:
>> I noticed that very little of this code is specific to the REPL; the
>> bulk of it is just dealing with creating and doing things with server
>> sockets. Perhaps it could be included in clojure-contri
get
beginners started? It's rather unconventional, but it seems like it
could address a very common problem.
1) How well does it work for others?
-Phil
[1] - har har.
[2] -
http://github.com/technomancy/clojure-mode/blob/0f28b61de90ce8a09d75bf1668
ds of dependencies were
written and achieved wide use within the Clojure community, that would
be even better. But we need to consider the current situation. There's
definitely a need for The Simplest Thing That Could Possibly Work.
-Phil
--~--~-~--~~~---~--~---
ell, I think the rebinding should be what _most_ users of the function
should want to do rather than _every_ use. The atypical uses can require
a little more work if it streamlines the common cases IMHO. You could
always write to *err* for debugging.
But I guess I can't as
ve already
got an automated SLIME/etc installer, but it just trusts the latest
versions of everything.
-Phil
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send
ing particularly
confusing after reading and trying it out, feel free to ask about it.
The bulk of the functionality is in commands.clj, with some boring
server bits in mire.clj.
It may not be the most idiomatic code as I haven't read that much
Clojure code from other projects,
e.rooms/*rooms* :start))]
In this case *rooms* is a ref that refers to a map, so we're looking up
:start in that map and setting the *current-room* ref to that value.
-Phil
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Goog
ncy.us/122
I've tested this on GNU/Linux systems (Emacs 23 and 22), and it's been
reported to work well on Mac OS X also. Please let me know how it works
for you or if you have any comments. This has definitely been a pain
point in the past, and it would be great if it could be
list from a directory listing and then include
the elisp code to do so in the source directory:
(setq concourse-dir (file-name-directory
(or (buffer-file-name) load-file-name))
swank-clojure-jar-path (concat concourse-dir "/jars/clojure.jar")
swank-clojure-ext
nterested in it. Would be great to have
some more people representing next time.
http://tech.groups.yahoo.com/group/SeaFunc/
-Phil
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to
x slime
> told me it "Cannot open load file: slime-repl". I am guessing it is
> because I use a different slime git.
Your slime checkout should have a contrib directory containing
slime-repl.el. If this doesn't exist, then it's a problem with the
checkout. If it does, it&
p =)
>
> I'd be OK with shuffle, I guess, but I don't know if one-of is
> descriptive enough for my taste. I feel like neither are used so
> often that a slightly longer and descriptive name isn't merited.
I'm not a fan of "one-of". If it has to be shor
Jason Wolfe writes:
> OK, fine. Any objections to "shuffle" and "rand-elt", to parallel "rand-int"?
I think that the bike shed should definitely be red.
=)
-Phil
(http://en.wikipedia.org/wiki/Color_of_the_bikeshed)
--~--~-~--~~~-
set up for you.
http://github.com/technomancy/emacs-starter-kit
> (setq swank-clojure-jar-path (concat clojure-src-root
> "/clojure/clojure.jar")
> swank-clojure-extra-classpaths
> (list (concat clojure-src-root "/contrib/src/"
This isn
without modifying any existing code.
Does this seem like a decent idea? I'm fine if the correct answer is
just "quit your whining, it's not that bad", but I'd like to know if I'm
the only person this bothers--at least in that case I can attempt to
adjust my aest
Phil Hagelberg writes:
> I've got a problem where I have a reader (it's a java.io.BufferedReader
> that came from duck-streams, if that matters at all) and I want to call
> "read" on it.
I should mention that I know *how* to do this:
(read (java.io.PushbackRe
aightforward. I've submitted my CA already.
-Phil
--~--~-~--~~~---~--~~
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
To unsubscribe fro
ne-seq". So we can't have it both ways. Blame Java's
> over-engineered I/O.
I'm no Java IO expert, but it sounds like a BufferedReader is the right
thing in the majority of cases. I think having "read" wrap its stream in
a PushbackReader where necessary is a much
...) form that will handle the
> binding and close the reader when it exists (which may or may not be
> what you want).
I don't see with-reader in contrib anywhere. Maybe this comes from
somewhere else?
-Phil
--~--~-~--~~~---~--~~
You received this mes
t the same is not true of
binding. (I'm just repeating what I heard on IRC.) The asymmetry of it
is unfortunate, but I think it's definitely worth the convenience in the
let case. It's definitely nicer than having let, let*, and letrec all be
separate forms as in Scheme.
Certainly wor
hem back on seems a
little odd to me--isn't there a way to just "peek" at the next character
without consuming from it? That's how I expected this to work.
Otherwise it seems to be a bit of a Gordian Knot.
-Phil
--~--~-~--~~~---~--~~
You receive
;.clj' buffer
> (Newly loaded files get the menu, as they should).
Yeah, I've thought about a hook that runs after SLIME loads to activate
slime-mode for all pre-existing clojure-mode buffers; just haven't
gotten around to it.
If you're handy with elisp, I
st]
>(if (cons? lst)
> (+ (if (= (first lst) obj) 1 0)
> (instances-in (rest lst)))
> 0))]
> (map instances-in lsts)))
This is a pretty direct translation; you could make it more idiomatic in
other
hould be on sale in a week or two. I'll be
sure to announce it here when it is, of course.
-Phil
http://technomancy.us
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post
ctually handy
> with elisp!
Calling slime-mode with an argument of t forces it to enable rather than
toggling it. I don't know about multiple slime connections though; it
seems kind of edge-casey, though I can look into it if it causes
problems.
Thanks for getting the ball rolling on this
est of the arguments to apply becoming
the argument list to the first function. In Clojure you see functions
being passed as arguments to other functions a lot; this is the biggest
difference from the Ruby version.
-Phil
--~--~-~--~~~---~--~~
You received this message becau
ity) or add a comment to it requesting that it be
> withdrawn?
Well I definitely don't think my patch will cut it, and I can't think of
another way around the problem.
Looks like I can't close the issue myself though, but I'm fine with
having it closed out.
-Phil
--~--~-~
l "constant naming
convention". Perhaps some kind of convention for naming non-constants
would be more appropriate since they're the exception rather than the
rule, but I don't know of any such convention. The fact that those
identifiers are always prefixed with @ fo
x27;t change and using a value as a logical constant? Are
you talking about changing the value of a var by calling "def" on it
again instead of using "binding"?
-Phil
--~--~-~--~~~---~--~~
You received this message because you are subscribed to th
rtable with its
syntax. Parentheses aren't some embarrassing historical accident;
they're part of the reason lisps are so powerful.
-Phil
[1] http://www.dwheeler.com/readable/sweet-expressions.html
http://www.lispin.org/
http://www.archub.org/noparen.arc
http://pschombe.wordpress.com/2
line in your test buffers? If so then the
mode is activated correctly. I'm still working through some bugs that
surface unpredictably due to the asynchronous nature of SLIME, so if you
don't see anything be sure to try C-c C-, a number of times.
-Phil
--~--~-~--~~
#x27;t set that it defaults to
$HOME/src/clojure? This is what clojure-mode.el's M-x clojure-install
uses, and folks seem to find that useful.
-Phil
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure&qu
terms of numerics-only. I'm a big fan of functions
doing the most helpful thing by default but being able to offer better
speed when you need it.
Convenience vs speed is always a trade-off, but I think convenience
should win in the default case. What
nj
> > "foo" (str 2))
>
> Agree
I agree regarding concatenation as well, but I think the case for
comparison of non-numerics is still pretty strong.
-Phil
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Googl
reTo(y) == -1
> (< x y)
> => true
>
> I would find that useful.
I'm not sure of the details since I don't know much about Java, but that
sounds about right. I'm working on a date library, and having to use
functions like earl
to
> java.lang.Integer (NO_SOURCE_FILE:0)
>
> And:
>
> user=> (.equals (Integer. "10") (Long. "10"))
> false
Curses, Java! Foiled again.
> Given these consequences, I think the current behavior is the best compromise.
Agreed. Am curious as to what the
David Nolen writes:
> What about something like:
>
> (defn gt [str1 str2]
> (first (sort [str1 str2])))
>
> (gt "Zoe" "Bob") ; -> "Bob"
If nothing exists yet, defining <, >, <=, and >= in str-utils might work.
-Phil
--~--~--
It's a pretty common idiom in other languages for substring functions to
count from the end if given a negative index.
(substring "hello world!" 6 -1) ;; => "world"
I'd be glad if Clojure's "subs" function could work like this. Should I
c
Paul Stadig writes:
> I've recently done some experimentation with Clojure and Terracotta.
> I've detailed my experience at:
>
> http://paul.stadig.name/2009/02/clojure-terracotta-yeah-baby.html
Very exciting; I'm looking forward to trying this out!
Phil Hagelberg writes:
> It's a pretty common idiom in other languages for substring functions
> to count from the end if given a negative index.
>
> (substring "hello world!" 6 -1) ;; => "world"
>
> I'd be glad if Clojure's "subs&q
Michael Wood writes:
> Makes sense to me, but there's a bug in your function. You want (< %
> 0) instead of (< 0 %).
Quite right; good catch.
thanks,
Phil
--~--~-~--~~~---~--~~
You received this message because you are subscribed to
hoice.
Also, instead of calling (deref cells), you can use @cells for short.
-Phil
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to clojure@googlegrou
> The code is available in either mine or Phil's github forks of clojure-
> contrib:
>
> http://github.com/cooldude127/clojure-contrib/
> http://github.com/technomancy/clojure-contrib/
>
> We'd like to hear opinions and whether people are willing to admit
> t
lj, but I didn't want to attach
two "chrono.clj" files, so I renamed it. Here's the link:
http://github.com/technomancy/clojure-contrib/blob/de4afee3dbfef2ed7f095ce1e7c2b7ea98e13e71/src/clojure/contrib/test_contrib/chrono.clj
-Phil
--~--~-~--~~~---~--~~
look through their test suite.
-Phil
--~--~-~--~~~---~--~~
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
To unsubscribe from this grou
u can still poke under the covers and get at the
underlying calendar objects, but there's no danger that someone would do
that without knowing what they were getting into.
It would be pretty easy to always return a copy of the underlying
calendar
ther thing I can think of is short-lived command-line tools
that need subsecond launch times.
-Phil
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to cloju
estigating performance problems. If you are feeling the need to step
into a debugger to deal with correctness problems, it's merely a sign
that your test suite is lacking in coverage.
-Phil
http://technomancy.us
--~--~-~--~~~---~--~~
You received this message
ll end up with a lot of the same concepts as
> Joda, and definitely won't have the same API as you do now. If you
> base Chrono on Joda you can avoid all of that pain now.
Yes, but any library that requires third-party jars can't be used out of
the box in contrib, and I think a languag
asionally, keeping a server running all the
time may not be an wise solution.
-Phil
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to clojure@googlegro
o work well for everyone I've talked with. Give it a shot and let me
know how it works for you.
-Phil
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to
get the speed you need from maps. Neither of these are true when you're
just starting out on a piece of code.
-Phil
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this
can't expect
things that are true here to be true across the board.
-Phil
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to clojure@googlegroup
ard to test,
it's probably because they need to be broken out differently.
-Phil
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to clojure@googlegroups.co
I'm interested in getting the location on disk of the current file. It
appears *file* provides this, but unfortunately it doesn't provide an
absolute path.
Inside the file /home/phil/src/mire/src/mire/rooms.clj:
mire/rooms.clj
I tried using java.io.File so I'd have access to
of hoops to jump through.
I don't think I could have figured that out on my own; thanks!
-Phil
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to cl
sp* buffer for load-time errors.
If you're seeing the SLIME error buffers for run-time errors, sometimes
you need to press 1 to see the cause of the current exception before the
correct line number is shown.
-Phil
--~--~-~--~~~---~--~~
You received this
days without actually running your code, then you
deserve what you get. A test suite would catch this for you every time;
developing without one is irresponsible.
-Phil
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
&qu
enefits balance that must leads to the conclusion that automatic
> unit tests are good or not for your project.
That's true; certain types of programs (particularly GUIs and JS-heavy
cross-browser web applications) are extremely difficult to automate
tests for. But this is the exceptio
Laurent PETIT writes:
> 2009/3/16 Phil Hagelberg
>
> Laurent PETIT writes:
>
> > But please, think about it twice before saying people are
> > irresponsible. Unit tests are not the only answer to bug-free and
> > quality programs.
>
&
OK, so I've posted a fair amount of "smack talk" about test suites and
how important they are--I figure it's time to help out.
What are some ways in which test-clojure is lacking? How can I help
improve the coverage?
-Phil
--~--~-~--~~~---~-
environment, so when you load them back in, there's no guarantee that
they'll behave the same way.
It's probably possible to serialize them in a way that would only work
for functions that don't rely on their enclosed scope, but this is a
p
se a
file in an arbitrary location as a template?
thanks,
Phil
--~--~-~--~~~---~--~~
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
To unsubscribe from
'd start a thread here so that people who
> are going can indicate that, and we can keep an eye out for each other.
>
> it's too bad we don't yet have clojure pins. ;-)
Just show up wearing one of these:
http://www.zazzle.com/clojure+tshirts
-Phil
--~--~-
tion call results in a string.
This behaviour seems really strange. I feel like maybe there's some
logic I'm missing and that it's not the string/function call difference
that determines replacement vs insertion, but I can't figure
king on the classpath since it means you can
store your template inside a jar and distribute everything that way. But
I think it would be convenient if it could check for the existence of
the file relative to the current directory first.
> Phil, what's your usecase for inserting raw html, w
to
run the tests and hope you remember to re-comment it before you commit.
> I'll add support for java.io.File and java.net.URL as an argument to
> template/deftemplate/snippet/defsnippet in complement of String and xml
> tree.
Sounds great; thanks.
-Phil
--~--~-~--~--
y, I need at least version 2.3.1
of a library, or I need any version in the 0.9 series starting with
0.9.1 but allowing in bugfix point-releases.)
Anything else? I'd love to help out with implementation, whether by
hacking Sauron or some other (hopefully less evil) alternative,
e details to diagnose what's wrong with
yours though. Generally the simplest way to get going with SLIME and
Clojure is to load a recent copy of clojure-mode.el, hit M-x
clojure-install, and follow the instructions it gives you.
-Phil
--~--~-~--~~~---~--~~
slime. Looks really
> neat. Plus, they've removed paredit; maybe they've integrated it
> directly.
That's right; once clojure-mode is installed, M-x clojure-install will
perform a checkout of clojure, clojure-contrib, slime, and swank-clojure
and configure these for you.
Pare
eq and map worked the same way, you would be tempted to use them
interchangably. This would be a mistake as they are each suited for
vastly different paradigms, despite superficial similarities in the way
they work.
-Phil
--~--~-~--~~~---~--~~
You received this me
#x27;m also quite willing to help with such an effort, but I don't feel
qualified to lead it myself as I haven't had any exposure to other
dependency-management tools on the JVM, though I have hacked a lot on
RubyGems. But the needs for
very
least, and it could be expanded in the future to support some of the
arguments the "jar" command line utility supports if those are deemed
useful.
-Phil
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
&qu
agnation.
-Phil
--~--~-~--~~~---~--~~
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
To unsubscribe from this group, send email to
at is :release for releases and :interim for non?
I like how that sounds. Either that or having a :prerelease key that
maps to true in interim releases.
Additionally release candidates should have a :release-candidate key if
we end up going down that path.
-Phil
--~--~-~--~~--
ike a bigger number than major/minor.
> Other than that, makes sense to me.
The term I've often seen is :bugfix for the least-significant version segment.
-Phil
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Group
slime-lisp-implementations)))
(cd original-dir)))
This uses maven's bytecode target directory conventions. It assumes
clojure, contrib, etc are unpacked in target/dependency. This has the
additional benefit of not requiring you to restart SLIME
delete-file f)))
This seems like it would be a helpful addition to contrib, since you
have to do this a lot with unit tests that write to disk in order to
clean up after yourself. I can create an issue+patch if others think
this is desirable.
-Phil
--~--~-~--~~~---~--~---
> Perhaps also renaming the parameters of the functions to file,
> although this may conflict with the function file that you are using.
Yeah, I had originally put this in the clojure.contrib.java-utils
namespace, which defines file. Not sure if that's the best pla
ure-preview.mov
Hope you like it!
-Phil Hagelberg
http://technomancy.us
--~--~-~--~~~---~--~~
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
To un
On Fri, Apr 24, 2009 at 2:08 PM, Scott Jaderholm wrote:
> Thanks Phil! I just bought it and look forward to watching it this weekend.
>
> Are you planning something more advanced?
We don't have any plans for that right now, but if it sells well it's
definitely a
d, you could try using M-x clojure-install from
a recent copy of clojure-mode.el. This should download and configure
all the necessary things to hook up Emacs and Clojure via SLIME.
If it's still not working, try pasting the contents of you
suggest having one file for clojure slime config and one for sbcl, and
only load one of them per Emacs instance.
I'm sure someone who's more familiar with SLIME and Common Lisp could
figure out a solution, but this seems like simplest solution.
-Phil
--~--~-~--~~-
forward to is the ability to add metadata to
fn values:
http://code.google.com/p/clojure/issues/detail?id=90
-Phil
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this grou
1 - 100 of 991 matches
Mail list logo