Fantastic! Thanks again!
On Nov 23, 3:50 pm, Benny Tsai wrote:
> Indeed there is :)
>
> http://clojuredocs.org/clojure_core/clojure.core/cycle
>
> On Nov 23, 12:37 am, Stefan Rohlfing
> wrote:
>
>
>
>
>
>
>
> > Hi Benny,
>
> > Your solution is much more elegant and flexible as my hacking of the
Indeed there is :)
http://clojuredocs.org/clojure_core/clojure.core/cycle
On Nov 23, 12:37 am, Stefan Rohlfing
wrote:
> Hi Benny,
>
> Your solution is much more elegant and flexible as my hacking of the
> core function!
>
> How would you implement 'pad-padding' (I like this name) if every item
>
Hi Benny,
This implementation looks great!
If I could only find out what went wrong with my (not so elegant)
solution...
Stefan
On Nov 23, 3:30 pm, Benny Tsai wrote:
> Or, to put it all together into a modified partition:
>
> (defn my-partition
> ([n coll]
> (partition n n coll))
> ([
Hi Benny,
Your solution is much more elegant and flexible as my hacking of the
core function!
How would you implement 'pad-padding' (I like this name) if every item
of the padding should be repeated in order, not only the last one?
(defn pad-padding [padding]
(concat padding (repeat padding)))
Or, to put it all together into a modified partition:
(defn my-partition
([n coll]
(partition n n coll))
([n step coll]
(partition n step coll))
([n step pad coll]
(let [expanded-pad (concat pad (repeat (last pad)))]
(partition n step expanded-pad coll
user=> (my-p
Sorry, pad-padding is a terrible name choice on my part :) Maybe
something like "repeat-last" would be at least a little bit better.
On Nov 23, 12:17 am, Benny Tsai wrote:
> Since (repeat) returns a lazy sequence, and partition will only take
> as many as is needed, I think you don't even have t
Since (repeat) returns a lazy sequence, and partition will only take
as many as is needed, I think you don't even have to specify how many
times to repeat:
user=> (partition 3 3 (repeat "a") [1 2 3 4 5 6 7])
((1 2 3) (4 5 6) (7 "a" "a"))
And if the desired behavior is to repeat the last element o
Hi Meikel,
What I want to accomplish is to have the function 'fill the gap' if
not enough padding is supplied.
With the standard 'partition' function this does not work, as it only
adds as much padding as provided:
(partition 3 3 ["a"] [1 2 3 4 5 6 7 8 9 10])
;; ((1 2 3) (4 5 6) (7 8 9) (10 "a")
Hi,
while not having looked at your code, partition does what you want:
user=> (partition 3 3 (repeat 3 "a") [1 2 3 4 5 6 7])
((1 2 3) (4 5 6) (7 "a" "a"))
user=> (partition 3 3 (repeat 3 "a") [1 2 3 4 5 6 7 8])
((1 2 3) (4 5 6) (7 8 "a"))
user=> (partition 3 3 (repeat 3 "a") [1 2 3 4 5 6 7 8 9])
Dear Clojure Group,
I am trying to adjust the implementation of the 'partition' function
so that the last element of a provided padding such as ["a" "b"] will
be repeated if necessary to ensure the length of the last list
returned by 'padding' is the same as the other lists.
This is the original
On Mon, Nov 22, 2010 at 14:56, Benny Tsai wrote:
> My guess is that they're being deprecated in favor of their
> counterparts in clojure.core:
>
> string -> clojure.string
> io -> clojure.java.io
Ah right, I think I remember that now. Thanks!
--
You received this message because you are subs
Now in clojars as well, use [dr-evil "1.0.0-SNAPSHOT"] in your
project.clj
On Nov 21, 2:57 pm, Miki wrote:
> Hello All,
>
> Dr. Evil is a simple web debugger that provides a REPL to your web
> application in a "hidden" location.
>
> Usage is simple - add "EVIL" definition to your application
> "d
On Nov 22, 12:54 pm, Ralph wrote:
> That is almost certainly true, since the Microsoft have probably done
> extensive optimization on the CLR.
>
> On Nov 22, 1:18 pm, Mark Engelberg wrote:
>
> > I doubt that F# Mono benchmarks are representative of F#'s performance on
> > Windows.
If Microsof
My guess is that they're being deprecated in favor of their
counterparts in clojure.core:
string -> clojure.string
io -> clojure.java.io
On Nov 22, 2:49 pm, Michael Ossareh wrote:
> On Sun, Nov 7, 2010 at 06:50, Stuart Sierra
> wrote:
>
> >http://build.clojure.org/releases/org/clojure/contrib/
On Nov 22, 10:18 am, Mark Engelberg wrote:
> I doubt that F# Mono benchmarks are representative of F#'s performance on
> Windows.
Perhaps they are representative of F#'s performance on Mono on
Windows :-)
But I wouldn't take a bet on that - performance measurements can be
very brittle.
--
Y
On Sun, Nov 7, 2010 at 06:50, Stuart Sierra wrote:
> http://build.clojure.org/releases/org/clojure/contrib/
>
> --
> 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 n
That is almost certainly true, since the Microsoft have probably done
extensive optimization on the CLR.
On Nov 22, 1:18 pm, Mark Engelberg wrote:
> I doubt that F# Mono benchmarks are representative of F#'s performance on
> Windows.
--
You received this message because you are subscribed to th
On Mon, Nov 22, 2010 at 2:29 PM, nicolas.o...@gmail.com
wrote:
>> Type hints don't reduce flexibility AT ALL.
>>
>> user=> (defn t1 [x] (.length x))
>> #'user/t1
>> user=> (t1 "foo")
>> 3
>> user=> (t1 'foo)
>> #> field found: length for class clojure.lang.Symbol
>> (NO_SOURCE_FILE:141)>
>>
>> Sin
On Tue, Nov 16, 2010 at 3:59 PM, wrote:
> Daniel Gagnon wrote ..
> > I spoke to the guys on reddit. They said it is tongue-in-cheek.
>
> > They have no knowledge of functional programming
>
> ???
>
> > but strongly feel it isn't suited to their field.
>
> ???
>
> Isn't this a bit contrad
> Type hints don't reduce flexibility AT ALL.
>
> user=> (defn t1 [x] (.length x))
> #'user/t1
> user=> (t1 "foo")
> 3
> user=> (t1 'foo)
> # field found: length for class clojure.lang.Symbol
> (NO_SOURCE_FILE:141)>
>
> Since it calls a String method it doesn't work if you call it with a
> non-Str
On Mon, Nov 22, 2010 at 1:32 PM, James Reeves wrote:
> Aquamacs is just Emacs with its UI tweaked to act more like a native
> OSX application.
Gee, why don't Windows users get an emacs that acts enough like a
Windows application not to unpleasantly surprise them if they're used
to, say, NetBeans?
The main use I've had for with-meta is in macros, to attach e.g. type
hints to a symbol that's going into the macro expansion. There, the ^
reader macro adds the metadata too early rather than with-meta adding
it too late: ^ hints some symbol in the macro body and the compiler
will apply the type h
Aquamacs is just Emacs with its UI tweaked to act more like a native
OSX application.
- James
On 22 November 2010 17:29, HB wrote:
> I read that Rick is using Aquamacs,
> What is the advantages of Aquamacs over Emacs+Slime?
>
> On Nov 22, 6:44 pm, Moritz Ulrich
> wrote:
>> My favorite is Emacs
I doubt that F# Mono benchmarks are representative of F#'s performance on
Windows.
--
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
On Mon, Nov 22, 2010 at 11:47 AM, John Fingerhut
wrote:
> max live=63.1 MB - The maximum heap size before any GC invocation
> was 63.1 MB. The name "max live" is probably not the best name
> for that value, since objects in heap before a GC begins are often
> not all live.
You'll
On Mon, Nov 22, 2010 at 10:10 AM, nicolas.o...@gmail.com
wrote:
> Clojure also offers an alternative to the full duck-typing/reflection scheme
> while being more dynamic than interface: protocols.
>
> As many LISPs, it offers dynamicity with possible static typing
> optimization when it is useful.
I read that Rick is using Aquamacs,
What is the advantages of Aquamacs over Emacs+Slime?
On Nov 22, 6:44 pm, Moritz Ulrich
wrote:
> My favorite is Emacs in combination with Slime. It features *great*
> integration through Slime and nice extensibility. It's also a good thing
> that Emacs is *made*
2010/11/22 Mike K
> In "Programming Clojure" Stuart Halloway says:
>
> It is important to note that the metadata reader macro is not the same
> as with-meta. The metadata reader macro adds metadata for the
> compiler, and with-meta adds metadata for your own data:
>
> (def ^{:testdata true} foo (
Tim, if you want to take another shot at a logo, feel free!
Ken, yeah, I forgot to remove the favicon and the twitter avatar. I
guess I should do that.
On 22 November 2010 14:30, Tim Visher wrote:
> Hah. There does seem to be some confusion about the logo. :)
>
> Oh well, it was still a neat li
Hi,
I cannot but encourage you to give Eclipse's plugin (Counterclockwise) a
try.
Please note that since more and more of Counterclockwise internals itself is
written in Clojure, one /could/ say that Counterclockwise is (more and more)
*made* for programming in Clojure because it's written in Clo
On Mon, Nov 22, 2010 at 11:36 AM, HB wrote:
> Hi,
> I installed this Clojure Textmate bundle:
> https://github.com/swannodette/textmate-clojure
> and Cake build tool:
> https://github.com/ninjudd/cake
>
> Running cake start in the terminal, I got these warnings (actually,
> all Cake commands are
On Mon, Nov 22, 2010 at 5:00 AM, Ralph wrote:
> On the Programming Languages Comparison Site (http://
> shootout.alioth.debian.org/u64/benchmark.php?
> test=all&lang=clojure&lang2=fsharp), if you run the Clojure vs. F#
> comparison, Clojure scores about the same in speed as F# (but does use
> mor
My favorite is Emacs in combination with Slime. It features *great*
integration through Slime and nice extensibility. It's also a good thing
that Emacs is *made* for programming in Lisp because it's written in a lisp
(Emacs Lisp).
On Mon, Nov 22, 2010 at 2:36 PM, HB wrote:
> Hi,
> I'm pretty sur
Hi,
I installed this Clojure Textmate bundle:
https://github.com/swannodette/textmate-clojure
and Cake build tool:
https://github.com/ninjudd/cake
Running cake start in the terminal, I got these warnings (actually,
all Cake commands are generating these warning):
/Library/Ruby/Gems/1.8/gems/cake-
I think it is due to the fact that [1 2 3] is self-evaluating.
If you were to write
(defn f [x] ^{:order :ascending} x)
(f [1 2 3])
the data would be on x in the compiler but never on [1 2 3]
with-meta would do the right thing.
On Mon, Nov 22, 2010 at 3:57 PM, Mike K wrote:
> In "Programmin
In "Programming Clojure" Stuart Halloway says:
It is important to note that the metadata reader macro is not the same
as with-meta. The metadata reader macro adds metadata for the
compiler, and with-meta adds metadata for your own data:
(def ^{:testdata true} foo (with-meta [1 2 3] {:order :ascen
> At first this surprised me, since Clojure is dynamically typed, while
> F# is statically typed. After some thought, however, it occurred to me
> that Clojure can generate code very similar to statically typed
> languages using type hints. Of course, as soon as you add type hints,
> the code is no
Hi,
During the discussions of the topic "Jython Interoperability
problem",
Mikhail Kryshen suggested implementations of Clojure data structures
outside Clojure:
>Clojure's data structures modified for use outside of Clojure:
>http://github.com/krukow/clj-ds
>Persistent analogue of the Java
2010/11/22 David Nolen
> On Mon, Nov 22, 2010 at 8:00 AM, Ralph wrote:
>
>> At first this surprised me, since Clojure is dynamically typed, while
>> F# is statically typed. After some thought, however, it occurred to me
>> that Clojure can generate code very similar to statically typed
>> langua
Probably would have been more clear if I showed an example in a function
argument vector also:
(defn foo {:count 2 :name "billy"})
(defn print-foo [{c :count n :name}]
(println "count:" c "name:" n))
(print-foo foo)
On Mon, Nov 22, 2010 at 9:30 AM, Mark Rathwell wrote:
>
> as for replacing
Hah. There does seem to be some confusion about the logo. :)
Oh well, it was still a neat little project to mess with.
On Sun, Nov 21, 2010 at 10:08 PM, Ken Wesson wrote:
> When I bring up the site, the new logo appears in the top left corner
> but the tab still has the old favicon.
>
> --
> Yo
as for replacing accessor methods:
java:
class Foo {
private int count;
private String name;
public Foo(String name) {
this.name = name;
}
public String getName() {
return this.name;
}
public String getCount() {
return this.count;
}
Hi Anton,
Take a look at this, which was mentioned recently:
https://github.com/ninjudd/classlojure
(not used myself)
HTH,
--
Laurent
2010/11/22 Anton Dorozhkin
> Thank you for your response.
>
> Everything is static in RT and Compiler classes, so different
> ClassLoaders looks like to be t
as for first and next:
You can do this
(let [fst (first [1 2 3 4 5 6])
rst (rest [1 2 3 4 5 6])]
(println "first: " fst)
(println "rest: "rst))
or
(let [[fst & rst] [1 2 3 4 5 6]]
(println "first: " fst)
(println "rest: "rst))
both print this:
first: 1
rest: (2 3 4 5 6)
--
On Mon, Nov 22, 2010 at 8:00 AM, Ralph wrote:
> At first this surprised me, since Clojure is dynamically typed, while
> F# is statically typed. After some thought, however, it occurred to me
> that Clojure can generate code very similar to statically typed
> languages using type hints. Of course,
Hi All,
I'm currently ploughing my way through Michael Fogus and Chris Housers
"The Joy of Clojure". I am currently reading up on destructuring. The
authors sum up the chapter by concluding that destructuring is the
idiomatic clojure replacement for accessor methods in OO languages.
Can someone exp
Hi,
I'm pretty sure that this question is already been asked but failed to
find it.
What is your editor/IDE for Clojure?
I didn't try them all, which IDE has the best Clojure support these
days: IntelliJ, NetBeans or Eclipse?
I'm not pretty happy with IntelliJ plugin.
Thanks for help and time.
--
On the Programming Languages Comparison Site (http://
shootout.alioth.debian.org/u64/benchmark.php?
test=all&lang=clojure&lang2=fsharp), if you run the Clojure vs. F#
comparison, Clojure scores about the same in speed as F# (but does use
more memory).
At first this surprised me, since Clojure is d
this might be a good place to start ..
http://shootout.alioth.debian.org/
On Mon, Nov 22, 2010 at 4:45 AM, nickik wrote:
> Hallo all,
>
> I know that what I'm asking here is not 100% about clojure but I hope
> people in here can help me anyway.
>
> Me and a classmade of mine have to do a project
> Yes, 1.3 supports only long and double primitives as local variables.
> But the bug doesn't seem to be new. I get the same error if I try to
> assign an int into a long deftype field in 1.2.
>
>
So there is a bug in the way bad primitive assignement are reported or handled.
Has it been reported
I agree that Common Lisp is big and it might take some time to learn.
But it is not a waste of time either. It is an interesting language,
and it is interesting
to see the points of divergence with Clojure and understand them.
However, it might not be the fastest path to Clojure. There are good
bo
51 matches
Mail list logo