I'm still trying to get my head around the new features. Seeing more
code examples will definitely help. In the meantime, here is some
stream-of-consciousness thoughts and questions.
Datatypes:
I'm a little worried about the strong overlap between reify/proxy,
deftype/defstruct, and defclass/ge
On Nov 12, 1:10 pm, Rich Hickey wrote:
> An early version of the code for a few important new language
> features, datatypes[1] and protocols[2] is now available in the 'new'
> branch[3]. Note also that the build system[4] has builds of the new
> branch, and that the new branch works with curren
Oh yes, thanks for refreshing my memory.
And indeed it makes sense to place the question mark in the "questioned" side :)
2009/11/13 Wilson MacGyver :
> Yes, it's groovy, and it's "?." It's called safe navigation operator
>
> http://groovy.codehaus.org/Operators#Operators-SafeNavigationOperator%28
Let's try this again:
(defn swap [coll i j]
(if (= i j) coll
(let [li (min i j) ui (max i j)]
(let [[pre-li post-li] (split-at li coll)]
(let [[post-li-pre-ui post-li-post-ui]
(split-at (- ui 1 li) (rest post-li))]
(concat
pre-li
Yes, it's groovy, and it's "?." It's called safe navigation operator
http://groovy.codehaus.org/Operators#Operators-SafeNavigationOperator%28%3F.%29
On Thu, Nov 12, 2009 at 6:03 PM, Laurent PETIT wrote:
> 2009/11/3 Alex Osborne :
>>
>> Sean Devlin wrote:
>>> This is slightly unrealted, but how d
Oh, I posted too soon. My implementation has a bug.
On Nov 12, 9:56 pm, Mark Tomko wrote:
> I came up with a way to do it, but I'm sure there's a simpler way.
> Here's what I have:
>
> (defn swap [coll i j]
> (let [li (min i j) ui (max i j)]
> (let [[pre-li post-li] (split-at li coll)]
>
I came up with a way to do it, but I'm sure there's a simpler way.
Here's what I have:
(defn swap [coll i j]
(let [li (min i j) ui (max i j)]
(let [[pre-li post-li] (split-at li coll)]
(let [[post-li-pre-ui post-li-post-ui] (split-at (- ui 1) (rest
post-li))]
(concat
p
On Thu, Nov 12, 2009 at 7:59 PM, Chouser wrote:
> On Thu, Nov 12, 2009 at 7:10 AM, Rich Hickey wrote:
>>
>> If you have the time and inclination, please try them out. Feedback is
>> particularly welcome as they are being refined.
>
> For what it's worth, here are 2-3 finger trees implemented usin
On Thu, Nov 12, 2009 at 7:10 AM, Rich Hickey wrote:
>
> If you have the time and inclination, please try them out. Feedback is
> particularly welcome as they are being refined.
For what it's worth, here are 2-3 finger trees implemented using
defprotocol and deftype.
http://tinyurl.com/yeh5fgg/fi
Hi,
Am 12.11.2009 um 13:10 schrieb Rich Hickey:
An early version of the code for a few important new language
features, datatypes[1] and protocols[2] is now available in the 'new'
branch[3]. Note also that the build system[4] has builds of the new
branch, and that the new branch works with curr
HI!
Current documentation on the clojure.org is not context based.
I know that there is a cheat sheet, but there should be also something like
this for HTML version,
where I just click a function link name and can read doc (and examples - but
about it read just below).
Current documentation giv
2009/11/3 Alex Osborne :
>
> Sean Devlin wrote:
>> This is slightly unrealted, but how does one pronounce ->, ->> and the
>> like? Is this documented?
>
> The doc-strings usually give you a nice hint. I usually use "thread"
> for -> and "thread last" for ->>. The actual symbols I think of as
> "
On Nov 13, 6:42 am, Albert Cardona wrote:
> 20:26 < chouser> leafw: sorted-set-by allows for an empty list of initial
> values, but passes that on to PersistentTreeSet/create as
> null, but create doesn't check for null it just blindly calls
> .
Oh its looks like Google Go (http://golang.org) and Nice Interfaces
(http://nice.sourceforge.net/).
Good! It sounds better than overrated polyphormism and class hierarchy.
Wiadomość napisana przez Rich Hickey w dniu 2009-11-12, o godz. 15:39:
>
>
> On Nov 12, 8:29 am, Sean Devlin wrote:
>> Ri
On Nov 12, 12:36 pm, Stuart Halloway
wrote:
> Using slime is moving higher on my todo list every day.
>
> Right now, I have the tags working across all my clojure projects.
> Will slime give me that if I compile them all into jars (with source)
> and put them on the classpath?
Yep.
I've got
There have been a lot of "write Clojure from home" references on the
list lately, so here is the opposite end of the spectrum. Want to come
hang out in meatspace with a bunch of Clojurians*, working in several
interesting problem domains?
http://blog.thinkrelevance.com/2009/11/11/hacker-in-r
Using slime is moving higher on my todo list every day.
Right now, I have the tags working across all my clojure projects.
Will slime give me that if I compile them all into jars (with source)
and put them on the classpath?
Stu
> On Nov 9, 6:36 am, Stuart Halloway wrote:
>> I have a poor ma
Hi all,
When creating a sorted set, the function sorted-set-by
cannot be called without at least one element, despite
the elements being optional.
Chouser on irc.freenode.net #clojure suggested this is a bug, because:
20:26 < chouser> leafw: sorted-set-by allows for an empty list of initial
Hi,
On Nov 12, 5:01 pm, MarkSwanson wrote:
> > >> See if this makes a difference:
> > >> syntax sync fromstart
>
> I think one of the primary objectives of vimclojure should be to
> consistently render correctly - and it can only do that with 'syntax
> sync fromstart'.
Once upon a time, sync fr
Personally I think preventing unexpected gensym collisions is the more
important property, otherwise it's not even worth having, might as
well just make your own cryptic names. I don't think you can have
both.
--
You received this message because you are subscribed to the Google
Groups "Clojure
Blargh!!! I've committed a good old-fashioned PEBCAK.
I should have been more specific. I executed this in SLIME/OSX and
enclojure/XP. The problem was that the output wasn't going to *out*
like I'd expect.
I tried a different example, and everything is cool.
user=>(def my-agent (agent 0))
us
On Thu, Nov 12, 2009 at 07:50:31AM -0800, Sean Devlin wrote:
>(defn daemon
> "Creates a new daemon thread and sets runnable to f"
> [f]
> (let [t (Thread. f)]
>(do
> (.setDaemon t true)
> (.start t)
> t)))
>
>And I tried calling
>
>user=>(daemon #(println "foo"))
>
>I get the
> >> See if this makes a difference:
> >> syntax sync fromstart
I think one of the primary objectives of vimclojure should be to
consistently render correctly - and it can only do that with 'syntax
sync fromstart'.
--
You received this message because you are subscribed to the Google
Groups "Clo
Hi all,
I'm trying to get a periodic daemon thread working. I've read some of
the stuff here:
http://groups.google.com/group/clojure/browse_thread/thread/4bc06d413fda157f/e953bb0c9286c5a7
With no luck. My code looks like this
(defn daemon
"Creates a new daemon thread and sets runnable to f"
2009/11/12 Meikel Brandmeyer :
> Hi,
>
> On Nov 12, 11:30 am, Michael Wood wrote:
>
>> See if this makes a difference:
>> syntax sync fromstart
>>
>> (although I've been having trouble making that work from .vimrc or
>> similar. It seems to be ignored and I haven't yet managed to track
>> down wh
On Nov 12, 8:29 am, Sean Devlin wrote:
> Rich,
> Just read the section on reify. I'm not quite sure what this new
> mechanism lets me do. Could you provide an example of the problem it
> solves? I personally would benefit from seeing the "Old, painful way"
> contrasted to the "New, awesome wa
On Thu, Nov 12, 2009 at 6:38 PM, Robert Campbell wrote:
> C:\dev\clojure>java -cp clojure.jar clojure.lang.Repl
> Clojure 1.1.0-alpha-SNAPSHOT
> user=> (def grid1 [01 02 03 04 05 06 07])
> #'user/grid1
> user=> grid1
> [1 2 3 4 5 6 7]
> user=> (def grid2 [01 02 03 04 05 06 07 08])
> java.lang.Numb
Oh, that's pretty neat. Thanks!
On Thu, Nov 12, 2009 at 2:36 PM, Fogus wrote:
>> Why does Clojure hate 8's? :-)
>
> It doesn't. By adding a leading zero you're telling Clojure that you
> want octal numbers. There is no number 08 in octal, instead to write
> the base-10 number 8 you would use 0
> Why does Clojure hate 8's? :-)
It doesn't. By adding a leading zero you're telling Clojure that you
want octal numbers. There is no number 08 in octal, instead to write
the base-10 number 8 you would use 010 in octal.
-m
--
You received this message because you are subscribed to the Google
Rich,
Just read the section on reify. I'm not quite sure what this new
mechanism lets me do. Could you provide an example of the problem it
solves? I personally would benefit from seeing the "Old, painful way"
contrasted to the "New, awesome way". This would probably help with
the other feature
C:\dev\clojure>java -cp clojure.jar clojure.lang.Repl
Clojure 1.1.0-alpha-SNAPSHOT
user=> (def grid1 [01 02 03 04 05 06 07])
#'user/grid1
user=> grid1
[1 2 3 4 5 6 7]
user=> (def grid2 [01 02 03 04 05 06 07 08])
java.lang.NumberFormatException: Invalid number: 08
java.lang.Exception: Unmatched deli
An early version of the code for a few important new language
features, datatypes[1] and protocols[2] is now available in the 'new'
branch[3]. Note also that the build system[4] has builds of the new
branch, and that the new branch works with current contrib.
If you have the time and inclination,
Hi,
On Nov 12, 11:30 am, Michael Wood wrote:
> See if this makes a difference:
> syntax sync fromstart
>
> (although I've been having trouble making that work from .vimrc or
> similar. It seems to be ignored and I haven't yet managed to track
> down why or where it's overridden.)
It may be set
Hi,
On Nov 12, 9:10 am, David Brown wrote:
> Speaking of vimclojure, has anyone else encountered situations where
> the vimclojure indent decides that the indentation of top-level
> constructs should be two spaces over? I haven't been able to figure
> out a pattern, and sometimes I can even fix
Hi,
On Nov 12, 12:21 am, John Ky wrote:
> Does anyone know why if the first character in my *.clj file is '#', then
> when I open it in VIM, ClojureVIM fails to recognise it as a Clojure file?
Ok. I could reproduce the issue and also found the solution. The
culprit is setfiletype in ftdetect/cl
Hi,
Am 12.11.2009 um 00:21 schrieb John Ky:
Does anyone know why if the first character in my *.clj file is '#',
then when I open it in VIM, ClojureVIM fails to recognise it as a
Clojure file?
What does ":echo &ft" say? I have the general symptom, that Vim
sometimes does not recognise th
2009/11/12 Jeff Rose :
> Yes, I also have the same issue. Sometimes if I re-indent the file it
> goes away, and other times I re-indent the file and all of a sudden
> half of the functions are 2 spaces over. (2 spaces is my tab width
> though, so I'm not sure if it's a tab or always 2 spaces...)
http://paste.lisp.org/display/87611#2
"infinite seq of swing events"
On Thu, Nov 12, 2009 at 1:48 AM, Jeff Rose wrote:
> On Nov 12, 1:22 am, nchubrich wrote:
>> I'm curious what the best idiomatic way of handling events is (e.g.
>> receiving a series of messages and dispatching functions on the
On Nov 12, 1:22 am, nchubrich wrote:
> I'm curious what the best idiomatic way of handling events is (e.g.
> receiving a series of messages and dispatching functions on the basis
> of the messages). One could use the 'experimental' add-watch(er)
> functions. But it might also be nice to do somet
Yes, I also have the same issue. Sometimes if I re-indent the file it
goes away, and other times I re-indent the file and all of a sudden
half of the functions are 2 spaces over. (2 spaces is my tab width
though, so I'm not sure if it's a tab or always 2 spaces...)
-Jeff
On Nov 12, 9:10 am, Dav
Speaking of vimclojure, has anyone else encountered situations where
the vimclojure indent decides that the indentation of top-level
constructs should be two spaces over? I haven't been able to figure
out a pattern, and sometimes I can even fix it by just scrolling up
and back.
David
--
You rec
On Thu, Nov 12, 2009 at 10:21:32AM +1100, John Ky wrote:
>Does anyone know why if the first character in my *.clj file is '#', then
>when I open it in VIM, ClojureVIM fails to recognise it as a Clojure file?
Vim runs the type detectors that examine the file before the ones
based on filename. The
42 matches
Mail list logo