Re : Re: novel feedback is always welcome

2011-08-01 Thread Nicolas
y I'am tThe main point for me of this whole discussion is that someone should use clojurescript if he want to use clojure instead of javascript on the browser. Like GWT, JWT, ZK or other, you do not longer develop in the client language. You develop in a different language and compile/generate

Re: New to Clojure -- Errors Are Frustrating

2011-08-03 Thread Nicolas
On 3 août, 03:00, Mark wrote: > The compiler might not be able to do better but the runtime system certainly > could.  In this case, both filtered and more information is what's needed.   > Why couldn't the runtime generate a message like: > Symbol "fac" of type clojure.lang.IFn is used where type

Re: Bret Victor - Inventing on Principle

2012-03-02 Thread Nicolas
The talk was really enligthing... but I would say it is still research. While I can trust you can make, say an intuitive and reactive UI for flash like animations, I think there are still problems to take care of for the program example. Here this is just a simple algorithm without long calls ins

Re: Can Clojure be as readable as Python or Ruby ?

2012-03-08 Thread Nicolas
ike you want to. That would be interesting to see and experiment on. Have a nice day, all! Nicolas. On 8 mar, 08:37, Sean Corfield wrote: > On Wed, Mar 7, 2012 at 5:10 PM, Mark Engelberg > wrote: > > * introducing variables creates new indenting level, making code "creep to >

Re: Can Clojure be as readable as Python or Ruby ?

2012-03-09 Thread Nicolas
Well maybe the problem of the let? macro is that it is not standard. If you use standard constructs and I'am proeficient with clojure I'll understand your code fast. I'll concentrate on understanding your code relevant for your application and domain. But just adding a few new constructs specific t

Re: Can Clojure be as readable as Python or Ruby ?

2012-03-09 Thread Nicolas
(Sorry for split post). So I'am not against let? macro of whatever you might need. That why we have a lisp here. But be sure you really need it/use it. And it is designed to be intuitive as possible. On 9 mar, 23:05, Nicolas wrote: > Well maybe the problem of the let? macro is that i

Re: Why cannot "last" be fast on vector?

2012-06-29 Thread Nicolas
27;t share your views. Regards, Nicolas Bousquet. On 29 juin, 01:32, Warren Lynn wrote: > This is an off-shoot subject from my last post "General subsequence > function". > > I found people had similar questions before (one year > ago):http://groups.google.com/grou

Re: On Lisp with Clojure

2011-09-09 Thread Nicolas
I would rather say difficult than impossible... and maybe not that important. After all JVM is turring complete. If scheme can do it compiling down to machine code, clojure could do it compiling down to JVM bytecode. On Sep 7, 1:54 am, Brian Goslinga wrote: > On Sep 6, 11:20 am, Michael Jaaka >

Re: suggestion for clojure development

2011-09-28 Thread Nicolas
On Sep 28, 1:30 pm, Gary Poster wrote: > On Sep 28, 2011, at 1:26 AM, Sean Corfield wrote: > > Perhaps Java has been different, but the languages I use and follow have not, > with the exception of JavaScript.  I perceive it to be a mildly unfortunate > fact of life at this point. > > Gary Java

Re: producing Blub code and vv.

2011-09-29 Thread Nicolas
Clojure has native interoperability with JVM & CLR. This mean that you can have part of your code written in Clojure, part in Java/Jython/ JRuby if your target the JVM or C# if you target CLR. Of course you'll not be able to mess everything like first half of a method in Clojure, second half in jav

Re: Using Clojure to Generate Java Source?

2011-09-29 Thread Nicolas
Best would be to act as professionnal: - try to convince your new boss of the benefits of using clojure from a business point of view. - if this fail, either go back to writing java or quit. But do not try to abuse your boss and company by developping in clojure behind the scene and deliver some c

Re: suggestion for clojure development

2011-09-30 Thread Nicolas
I think that backward compatibilities problem do hurt. Some people will not invest in an "unstable" language by default and some will be tempted to give up after experimenting too many problem with it. We don't choose a language,we choose a full echosystem that include libraries, IDE tooling, docu

Re: producing Blub code and vv.

2011-10-03 Thread Nicolas
After all an human can do it manually. But I see it as more a research topic than engineering topic. With low probability of sucess. It is a good thing to work on it then when many things aren't here yet for clojure? Best Regards, Nicolas. On Sep 30, 5:48 am, Hank wrote: > > I thin

Re: Macro tutorials?

2011-10-10 Thread Nicolas
A good book to learn lisp macros, is On Lisp from Paul Graham. This book really cover advanced topics and concepts, and has many chapters related to macros. The book is freely available in online format from Paul Graham Website: http://www.paulgraham.com/onlisp.html On Oct 6, 1:02 pm, Michael Jaa

Re: Reactions to google dart?

2011-10-14 Thread Nicolas
For me the real meaning of this is that support for new features in closure library will stop in its actual form in the years to come. Only bugs will be corrected, no more. This is already the case in a sence I think, because before Dart, GWT was viewed as the new official way to make new web appli

Re: Blog post declare type implements protocol feature

2011-10-26 Thread Nicolas
Yes you need to provide an implementation of the protocol for the type directly or a parent interface. What the initial author says is that you can do that on any type, even on an outside library, without changing the initial Type source code or recompile it. You can do that at runtime and because

Re: repl output for list seems inconsistent and a holdover from yesteryear

2011-10-27 Thread Nicolas
Hi! Well [1 2 3] is just a syntaxic sugar for (vector 1 2 3): =>(vector 1 2 3) [1 2 3] When you enter a vector in the repl, it is evaluted to itself. Here an example that show it: =>[1 2 (+ 1 2)] [1 2 3] And you can use the vector function for the same result: =>(vector 1 2 (+ 1 2)) [1 2 3] The

Re: Trickiness with protocols and extends (1.3.0)

2011-10-28 Thread Nicolas
In your example, extending cascade.Asset work because it is considered as a java interface, and is supported for interoperability. But this is likely not what you really want to do as Asset is still not a clojure type. Hope this help, Nicolas On 28 oct, 19:46, Howard Lewis Ship wrote: > I&

Lazy behavior

2011-10-31 Thread Nicolas
subpart of the file for example, another function another part and call them sequentially. But as shown in the simple previous example it simply doesn't work. My understanding is that some immutable thing is in the middle and it act like the data reference isn't changed between calls.

Re: Lazy behavior

2011-11-01 Thread Nicolas
#x27;t seems clojurish while I'am not sure on the memory usage implications on the first for the lazy sequence. Any insights? Best Regards, Nicolas On 1 nov, 01:09, nchurch wrote: > The problem you're having doesn't have anything to do with file > reads.  Every time you c

Re: Lazy behavior

2011-11-02 Thread Nicolas
Hi, I'am not really sure on your explanation here. For me if the processor, JVM or clojure compiler cannot prove it doesn't change the semantics, the optimization will not be applyed. readLine behing a java method call, it can perform any operations and thus clojure compiler will not change the e

Re: Proposal: libraries should have type hints

2011-11-22 Thread Nicolas
performance. And if you need this boost. I think then that's the library author responsability and own right to figure by himself where ultimate performance is needed or instead where greater flexibility is to be prefered. Bye, Nicolas. On Nov 21, 5:12 pm, Tassilo Horn wrote: >

Dropping strings.

2009-04-29 Thread Nicolas Buduroi
Hi, I was wondering if there's a drop function somewhere in contrib that work for strings. I didn't found any so I wrote my own: (defn drop-str ([s] (drop-str 1 s)) ([n s] (apply str (drop n (seq s) This is not really fast, a better version would be something like that: (defn drop-str [

Re: Dropping strings.

2009-04-30 Thread Nicolas Buduroi
> You can use (.substring s n), if n is larger than string length it > will return a empty string. Hum... that's not my experience, I'm at my job right now so I can't double check this. Looking at the javadoc, it appears that if n is larger than the string length it will throw an IndexOutOfBounds

Re: Clojure 1.0

2009-05-04 Thread Nicolas Buduroi
Wow, I really didn't expected this one! I also came to realize that I've been using Clojure for a year now, the longest period of time I've devoted to a single non-mainstream language. A million thanks! Congratulations to Rich and all contributors. On May 4, 8:58 am, Rich Hickey wrote: > After

How is Clojure API reference generated?

2009-06-09 Thread Nicolas Buduroi
Hi, I'm wondering how Clojure API reference page is generated? I'd like to adapt it for the future Compojure website if possible. On another note, how is Clojure website built and what language/framework does it use? Thanks - budu --~--~-~--~~~---~--~~ You receive

Reading files with nio.

2009-06-09 Thread Nicolas Buduroi
Hi, I've been playing with nio lately and it's been quite fun to delve in lower level stuff again, didn't do that in a long time. I've translated a small example, just to read a file, and the result is performing really well. Here's the code: (defn read-file [#^String f #^String cs #^Integer buff

Re: Reading files with nio.

2009-06-10 Thread Nicolas Buduroi
I've got an even faster version using memory-mapped file I/O. It also simplify the code a little bit. (defn fast-read-file [#^String filename #^String charset] (with-open [cin (. (new FileInputStream filename) getChannel)] (let [size (. (new File filename) length) char-buffer (. B

Re: How is Clojure API reference generated?

2009-06-11 Thread Nicolas Buduroi
Great, exactly what we needed! On Jun 11, 7:51 pm, Tom Faulhaber wrote: > Rich posted the code he uses here:http://paste.lisp.org/display/77339 > > But note that he's building it in wiki markup and not html. > > HTH, > > Tom > > On Jun 9, 4:13 pm, Nicolas Buduroi

Code generation at runtime

2009-06-22 Thread Nicolas Oury
to pull this magic out in a reusable way? Can I try to do it or it is really difficult/impossible? I think, it would quite Lispy for Clojure to have very few differences between REPL and compiled runtime. Thanks a lot for your help, Best regards, Nicolas. --~--~-~--~~---

Re: Code generation at runtime

2009-06-23 Thread Nicolas Oury
critical. Is there a way to trick an eval into believing, it is a compiler? (I know the trick must involve *compile-files* and *compile-path* in some way, but I can't manage to make this work.) Are there other people on the mailing list compiling (calling eva

Re: Small question: Best way to create a map with vector vals

2009-06-24 Thread Nicolas Oury
the API? Best regards, Nicolas. On Tue, 2009-06-23 at 15:09 -0700, samppi wrote: > The idiom (into {} coll-of-entries) is often used to create a map from > a collection of entries or two-sized vectors. But what if I want to do > something like this: > > (mystery-fn [[:a 1] [:b 3]

(create-struct) without keys.

2009-06-24 Thread Nicolas Oury
ivalent to creating an empty map. Currently, it results in some special case in macros or adding a :dummy field to any generated struct. Best regards, Nicolas. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "

Re: (create-struct) without keys.

2009-06-24 Thread Nicolas Oury
in code duplication: less readable, harder to modify, error prone. ) However, (create_struct) seems like a natural generalisation of (create_struct & keys). Best, Nicolas. On Wed, 2009-06-24 at 10:27 -0500, Mark Volkmann wrote: > On Wed, Jun 24, 2009 at 10:07 AM, Nicolas Oury &

Re: (create-struct) without keys.

2009-06-24 Thread Nicolas Oury
t a_struct &keys = (apply struct a_struct keys) But it looks a bit strange and complicated. On the other hand, most languages allow empty records. Best, Nicolas. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: (create-struct) without keys.

2009-06-24 Thread Nicolas Oury
(either modifying the constructor or first and next). Alternatively, a null keys can be replaced by an empty list in the createsSlotMap. Best, Nicolas. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure&qu

Re: A website written using Clojure.

2009-06-25 Thread Nicolas Buduroi
> I'm not running off any server. All the pages are static html, which > are generated by a Clojure script. No kidding! I've done the exact same thing for my first website. It was using Scheme though and leveraged Oleg's SXML library, it bring me back fond memories. I'm looking at that old code r

Hash Consing

2009-06-29 Thread Nicolas Oury
er is the reason I plan to use soft references and not weak references) I am not a clojure expert and I am not a java coder at all, so don't hesitate to tell me if my plans are somehow wrong. Bets regards, Nicolas. --~--~-~--~~~---~--~~ You received this message

Re: Hash Consing

2009-06-29 Thread Nicolas Oury
1) too. Of course, incremental hash consing of sets/map/vectors could give us adding/removing a children in a better time than O(num of children) but I don't have much clue on how to do that. Any ideas? Best, Nicolas. --~--~-~--~~~---~--~~ You received

Re: Would *default-precision* make sense?

2009-06-29 Thread Nicolas Oury
L to set! *war-on-reflection* and some other similar vars. (*ns*, *compile-files*, *compile-path*, etc...) I suppose the compiler does a similar thing, but I have never looked. Best, Nicolas. --~--~-~--~~~---~--~~ You received this message because you are subscri

Re: Binary Tree

2009-06-30 Thread Nicolas Oury
t you should be able to store size/depth in the vector too. Best, Nicolas. On Tue, 2009-06-30 at 02:28 -0600, Daniel Lyons wrote: > > On Jun 30, 2009, at 1:05 AM, Emeka wrote: > > > Hello All, > > > > I have a BinaryTree Nodes that I want to resolve it'

Re: ANN: clj-forms - a wrapper DSL for JGoodies Forms

2009-06-30 Thread Nicolas Oury
ne could also think of validators, etc... It seems a very nice idea. I would suggest the use of agents, for the states, rather than atom. Especially, the possibility to have watchers seems good. But I am a newbie so I can be wrong. Best, Nicolas. --~--~-~--~~~---~--~---

Re: ANN: clj-forms - a wrapper DSL for JGoodies Forms

2009-06-30 Thread Nicolas Oury
t; Then it could be great to cache the modifications in vars and commit them atomically to Refs when you close the dialog. > Watche(r)s work on all IRef types. > Thank you very much for the information. I didn't know that. Clojure is even better th

Re: loneclojurian at ICFP programming contest

2009-06-30 Thread Nicolas Oury
executing. Can a clojure expert confirms wether it would work or not? Best regards, Nicolas. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@google

Re: loneclojurian at ICFP programming contest

2009-07-02 Thread Nicolas Oury
level? Is that a loop where you run multiple times the same program? Best regards, Nicolas. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@google

Re: loneclojurian at ICFP programming contest

2009-07-03 Thread Nicolas Oury
I suspect you are not using double arrays with direct array manipulation in CLojure. I wonder whether it is linked to the fact your arrays are not in local (let) variables. I will try to randomly change a few things in your implementation tomorrow. Best, Nicolas. On Fri, Jul 3, 2009 at 9:56

Re: loneclojurian at ICFP programming contest

2009-07-04 Thread Nicolas Oury
function that call a method, that does that. As setting an array is very quick, even the slight overhead of calling a method makes the program far slower, in a tight loop. I will start another thread to ask whether this is really the problem and if it can be solved. Best, Nicolas

aset-* family of functions

2009-07-04 Thread Nicolas Oury
having array access to primitive types as fast as in java would be a good start to authorize cpu intensive programs to be written in clojure. Best regards, Nicolas. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: aset-* family of functions

2009-07-04 Thread Nicolas Oury
Thanks for the reply. It seems to speed up quite a bit the array of double. I cannot manage to make it work for the array of booleans. Is there someting different? If aset and aget are faster, what is the goal of the aset-xxx? Best, Nicolas

Re: loneclojurian at ICFP programming contest

2009-07-05 Thread Nicolas Oury
form it, because you can write easily a better implementation. (The code I wrote is really ugly, because it was made as multiple hacks, but I think with more experience than me and more cleverness in the design, you can keep the code really expressive and clear, while achieving the same level of

Re: loneclojurian at ICFP programming contest

2009-07-05 Thread Nicolas Oury
where either in my program or my computation of the speed. Let's wait for igorrumiha to check and to test this implementation. Best regards, Nicolas. On Sun, Jul 5, 2009 at 12:18 PM, fft1976 wrote: > > On Jul 5, 2:31 am, Nicolas Oury wrote: > > > After, when I run the

Re: loneclojurian at ICFP programming contest

2009-07-05 Thread Nicolas Oury
ns to find the fastest on my computer. That is quite strange the fact that the size xhange so much the result. Really a fun exercize in writing benchmarking clojure, though. Best, Nicolas. On Jul 5, 2009 6:53 PM, "igorrumiha" wrote: On Jul 5, 3:05 pm, Nicolas Oury wrote: > Actually

Calling static methods on a variable holding a class

2009-07-06 Thread Nicolas Buduroi
Hi, I needed to call a static method on a class stored in a var yesterday and found that it was a little bit trickier than I initially thought. There's three way of doing it, the two first are quite straightforward and working ;-) e.g.: (import '(java.nio ByteBuffer FloatBuffer)) (def foo ByteBu

Re: Calling static methods on a variable holding a class

2009-07-06 Thread Nicolas Buduroi
I've just figured out that the macro version in the allocate example can't be used with local variables. (let [foo ByteBuffer] (allocate1 foo 1024)) throws java.lang.UnsupportedOperationException: Can't eval locals (NO_SOURCE_FILE:94) On Jul 6, 6:59 pm, Nicolas Buduroi

Re: Calling static methods on a variable holding a class

2009-07-08 Thread Nicolas Buduroi
> If you know the method you wish to call, do you not know the class and can > thus call the static method directly? Well that was the point of the question, that is if I have to call a static method on a class we don't know in advance. I understand this capability isn't that useful and is quite

Re: Calling static methods on a variable holding a class

2009-07-08 Thread Nicolas Buduroi
> Lets say you want to call static method "foo" of a class, > but you don't know which class -- you want this to be > specified at runtime in a parameter. Something like this: > > (defn map-foo [cls coll] > (map cls/foo coll)) ; doesn't work > > As mentioned by others, one approach is to u

Re: Experiment with named args

2009-07-17 Thread Nicolas Oury
Hello, Can this construct handle higher-order functions? (I mean a function with named arguments as an argument to another function). It seems quite difficult to do a function dependent transformation on the call site when the function is unknown. Best regards, Nicolas. On Thu, 2009-07-16 at

Re: Clojure Partial Evaluator

2009-07-20 Thread Nicolas Oury
, the code can get much longer (exponentialy sometimes). How do you plan to handle these situations? Best regards, Nicolas. On Mon, Jul 20, 2009 at 3:01 PM, Meikel Brandmeyer wrote: > > Hi, > > On Jul 20, 3:48 pm, Mark Volkmann wrote: > > > I'm trying to understan

Re: Bug? Definline arguments multiply evaluated.

2009-07-30 Thread Nicolas Oury
Hello, I am not sure to agree. If I get it right, definline is used to replace defn for function that we want to be inlined. So replacing defn by definline should have no impact on the semantic of the program. Best regards, Nicolas. On Thu, 2009-07-30 at 05:34 -0700, Rich Hickey wrote

Re: Question about pmap

2009-08-06 Thread Nicolas Oury
I have no clue whether it is the case). - replace ints with longs (corresponding assumption). - I read somewhere about an option of the JVM for better cache-aware allocation. But I don't remember what it was ans whether it was in 6 or will be in 7. Cheers, Nicolas. On Thu, Aug 6, 2009

Re: Question about pmap

2009-08-06 Thread Nicolas Oury
Hello again, Another interesting test: replace the double operation by something longer, that won't allocate anything. (a long chain of math functions with primitive types...), and see if the parallelism is better. Best, Nicolas. On Thu, Aug 6, 2009 at 2:32 PM, Nicolas Oury wrote: &g

Re: Question about pmap

2009-08-08 Thread Nicolas Oury
le.) I am interested in this global cache for valueOf thing and haven't find any good explanations on that phenomena. Does someone have a link to some ressources? Thank you very much, Nicolas. On Sat, 2009-08-08 at 09:49 -0700, Bradbev wrote: > > I'm not sure how to determi

Re: Question about pmap

2009-08-09 Thread Nicolas Oury
t, that there is a lock contention for the common heap. I don't know how to separate one from the another... Best, Nicolas. > By the way GC is running periodically, but while profiling it does not > report more than 1 sec of total runtime. --~--~-~--~~~-

Re: Can Clojure be as fast as Java?

2009-08-12 Thread Nicolas Oury
performed by the compiler will improve performance and by how much. What is sure is that there is no reason why clojure should be slow, when some functional languages (including dynamically typed ones) are fast. So, one day, it will be fast. Best, Nicolas. On Tue, 2009-08-11 at 21:20 -0700

Re: Pure-functional N-body benchmark implementation

2009-08-12 Thread Nicolas Oury
o put everything in one big array, and replace bodies by their index. I wonder whether there would be a speed-up or not from removing indirections. Best, Nicolas. On Wed, 2009-08-12 at 00:26 -0400, Aaron Cohen wrote: > On Tue, Aug 11, 2009 at 8:13 PM, Andy > Fingerhut wrote: > > >

Re: Pure-functional N-body benchmark implementation

2009-08-13 Thread Nicolas Oury
h the java one... Best, Nicolas. On Wed, 2009-08-12 at 17:18 -0400, Aaron Cohen wrote: > On Wed, Aug 12, 2009 at 4:49 PM, Aaron Cohen wrote: > > I'm getting a very significant performance improvement by adding a > > couple of JVM parameters (using jdk 1.6.0_14). They are:

Re: Adding optimizations to Clojure

2009-08-15 Thread Nicolas Oury
. However, one of the point that makes Clojure performant enough in a lot of situations anyway is that you don't need to do that on your whole program. just on the very small part it spends 95% in. Best regards, Nicolas. --~--~-~--~~~---~--~~ You receive

How to have a fast access to a java array of non-primitives?

2009-08-15 Thread Nicolas Oury
st of its time there: 99.4% 0 + 8804java.lang.reflect.Array.get Does anyone know how to speed that up? Is it written somewhere in the java interop documentation? Best, Nicolas. --~--~-~--~~~---~--~~ You received this message because you are subscrib

Re: How to have a fast access to a java array of non-primitives?

2009-08-15 Thread Nicolas Oury
negligible. I guess that's the price of trying to write solutions to not very interesting micro-benchmark :). Best regards, Nicolas. On Sat, 2009-08-15 at 12:06 -0400, David Nolen wrote: > You need to specify the array type. For example the following produces > a primitive

Re: Pure-functional N-body benchmark implementation

2009-08-16 Thread Nicolas Oury
project using Clojure to know that once they find a bottleneck in a program they can rewrite it to go at the same speed as the java program doing the same thing. That's not a programming style I would advocate for a whole project though. Best regards, Nicolas. On Wed, 2009-08-12 at

Alternative implementation of structures.

2009-08-16 Thread Nicolas Oury
o the kind of programs I am writing, as well as allowing Clojure to shine in micro-benchmarks. Best regards, Nicolas. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group

Re: Is there something special about haskell, or could "verifiability announcements" happen for purely functional Clojure programs too?

2009-08-16 Thread Nicolas Oury
eezy.cs.nott.ac.uk/~npo/PowerPi.pdf So being a dynamically typed functional language with clean construct for concurrency makes Clojure an interesting language for certification I believe. Apologies for my long mail, never gives the opportunity to someone to talk about his work... Best regards, Nicola

Re: Alternative implementation of structures.

2009-08-16 Thread Nicolas Oury
> Much of what you've described is either provided by "newnew", or is > relatively easy to produce with a couple of macro wrappers involving > gen-interface and newnew: That's what I was hoping for. No code generation code to write for it. --~--~-~--~~~---~--~--

Re: Pure-functional N-body benchmark implementation

2009-08-17 Thread Nicolas Oury
. Best, Nicolas. On Sun, 2009-08-16 at 14:00 -0700, Bradbev wrote: > > > > Why can't we write programs in Clojure and > > drop down to Java if necessary? > > That's what I find funny about these threads, Clojure's Java interop > is good, Java is easy to w

Re: Pure-functional N-body benchmark implementation

2009-08-17 Thread Nicolas Oury
at native speed, at some point in the future though. And they are the right way to approach this kind of problem, I agree. Best, Nicolas. Mon, Aug 17, 2009 at 3:26 PM, e wrote: > i don't know much about this (haven't followed closely, lately), but do the > new Transients c

Re: Pure-functional N-body benchmark implementation

2009-08-17 Thread Nicolas Oury
Seems to mean that I was wrong and that the cost is both in bound check and unpacking the indices, mostly the second one. On Mon, 2009-08-17 at 09:25 -0700, Bradbev wrote: > On Aug 17, 1:32 am, Nicolas Oury wrote: > > I was referring to the rules of the benchmark game. When you

Re: Tight loop performance

2009-09-06 Thread Nicolas Oury
you want your code to perform well. Best, Nicolas. > (aset-byte dst (inc dst-offset) (byte (bit-shift-right sample > 8 > (recur (inc src-offset) (unchecked-add 2 dst-offset) > > > Adding type coercions helped a bit but it's still too slow. In

Re: Tight loop performance

2009-09-07 Thread Nicolas Oury
the right place is clojure/lang/RT.java. Best regards, Nicolas. --~--~-~--~~~---~--~~ 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

Re: Latest news on ClojureQL

2009-12-14 Thread Nicolas Buduroi
Ruby-style migrations are great but, as others have said, they lend themselves better to another layer of abstraction. I was thinking of a lower-level alternative to migration. We could find a way to construct an ast from the current database schema and then compare it with the one generated by the

Re: Funding Clojure 2010

2009-12-14 Thread Nicolas Buduroi
That's a great idea, hope it gains some traction. I'm recently unemployed and trying to bootstrap my own startup, so I'll skip this year. When my financial condition will be more solid though, I'll certainly donate something. In the meantime, as I intend to build my projects in Clojure, I'll contri

Semantic Versioning

2009-12-16 Thread Nicolas Buduroi
Hi, on the CommonJS Google Group there was a discussion on semantic versioning, a formalization of the concept of properly using a common version number scheme (Major.Minor.Patch) for libraries. http://semver.org/ I think it would be especially easy to enforce a simple version of this system in a

Re: Semantic Versioning

2009-12-16 Thread Nicolas Buduroi
s/thinking/think/ On Dec 16, 2:56 pm, Nicolas Buduroi wrote: > Hi, on the CommonJS Google Group there was a discussion on semantic > versioning, a formalization of the concept of properly using a common > version number scheme (Major.Minor.Patch) for libraries. > > http://semver.o

Re: Semantic Versioning

2009-12-17 Thread Nicolas Buduroi
On Dec 17, 3:11 am, Laurent PETIT wrote: > Isn't this the ideal that clojure and libraries are almost more or less > already following ? Yes it is, but that's because the maintainers are very disciplined and professional people. Not everybody follow this scheme properly and even the best of us ca

Re: Semantic Versioning

2009-12-17 Thread Nicolas Buduroi
On Dec 17, 3:13 am, Roman Roelofsen wrote: > Dealing with version numbers at build time is quite easy with tool > like Maven. The important thing is that everyone agrees on the same > version semantics (great summary [1]). Putting some more tooling > around this should be a good idea, yes. Talki

Re: Semantic Versioning

2009-12-18 Thread Nicolas Buduroi
On Dec 18, 4:16 am, Roman Roelofsen wrote: > IMHO, no. This is the whole problem. Library users will mostly care > about the runtime. It doesn't help at all if your code compiles, maybe > in isolated pieces, but everything blows up at runtime. For example, I > never had problems compiling against

A Help Macro

2009-12-21 Thread Nicolas Buduroi
Hi everybody, I wrote a help macro to make getting help easier within the REPL and thought others might also find it useful. It regroups into one command various helpers found in clojure-contrib: * classpath: classpath * ns-utils: docs, dir, vars * repl-utils: expression-info, show, source The

Using map on multiple collections.

2009-12-22 Thread Nicolas Buduroi
Hi, today I needed to use the map function on multiple collections which didn't had all the same length. In this case, it returns a sequence of the size of smallest one. But the problem I was facing was required to map until the end of the longest, padding the smaller ones with a default value. I c

Re: Using map on multiple collections.

2009-12-23 Thread Nicolas Buduroi
On Dec 23, 12:30 pm, kyle smith wrote: > It's a little shorter if you unconditionally concat & repeat. > > (defn append-val [val & colls] >   (let [maxlen (apply max (map count colls))] >     (map #(concat % (repeat (- maxlen (count %)) val)) colls))) > > user> (apply map + (append-val 0 [1] [2 3]

Re: Using map on multiple collections.

2009-12-25 Thread Nicolas Buduroi
On Dec 25, 1:52 am, Tom Hicks wrote: > A slight modification, which I think avoids counting each collection > twice: > > (defn append-val [val & colls] >   (let [lengths (map count colls) >         maxlen (apply max lengths)] >     (map #(concat %1 (repeat (- maxlen %2) val)) colls lengths) >   )

Re: Using map on multiple collections.

2009-12-25 Thread Nicolas Buduroi
On Dec 25, 9:08 am, "Heinz N. Gies" wrote: > On Dec 23, 2009, at 6:04 , Nicolas Buduroi wrote: > > > Hi, today I needed to use the map function on multiple collections > > which didn't had all the same length. In this case, it returns a > > sequence of the

Re: Using map on multiple collections.

2009-12-29 Thread Nicolas Buduroi
Big thanks to everyone, the suggestions given are all very welcome, even if I didn't really needed a better version as my use of mappad is really simple for now. It was just curiosity on my part. The lazy version by Heinz could be quite useful in other situations, I've added it to my toolbox. Usin

Small problem with sets documentation.

2009-12-29 Thread Nicolas Buduroi
Hi, just to warn that there's a small problem with sets documentation in the data structures page of Clojure's website. The hyperlinks to set operations and pseudo-relational algebra are broken as they haven't followed the move to the new clojure.set namespace. - budu -- You received this messag

Strange problem when adding type to a var defined by a macro.

2010-01-08 Thread Nicolas Buduroi
Hi, I'm using macros to define special vars (w/ a keyword as type) to retrieve them later with ns-utils/ns-vars and filter them. I don't know if this technique is recommended or if there's some better way to achieve this, but there's something weird happening when we try to evaluate the var defined

Re: Strange problem when adding type to a var defined by a macro.

2010-01-09 Thread Nicolas Buduroi
> The macro works fine. The problem is that the REPL tries to print the > result (which is the var you created) and the print multimethod does > not know what to do with your custom type, and the default method > throws an exception. That was it, thanks a lot. - budu -- You received this messag

Re: Strange problem when adding type to a var defined by a macro.

2010-01-10 Thread Nicolas Buduroi
> So I think the source of the exception is clear, but have you found a > solution to your original problem? Maybe if you expand on that someone > can describe a good technique. I'm using clojure-contrib's ns-utils/ns-vars and find-namespaces/find- namespaces-on-classpath to discover namespaces a

ANN: clj-doc, a library to generate API documentation for Clojure code to various markup languages.

2010-01-12 Thread Nicolas Buduroi
Hi, I announce my first open source project, it's really small and doesn't have lots of features yet, but I think it can be already useful in its current state. I'll always be open to suggestions to improve it, but as it's only version 0.3, now is the time to get things straight. There's two macro

Lazy recursive walk.

2010-01-15 Thread Nicolas Buduroi
Hi, I'm still not familiar with laziness and I'm trying to make a function recursively walk arbitrary data structures to perform some action on all strings. The non-lazy version is quite easy to do: (use 'clojure.walk 'clojure.contrib.str-utils) (defn recursive-string-walk [f form] (walk #(

Re: Lazy recursive walk.

2010-01-15 Thread Nicolas Buduroi
On Jan 15, 3:25 pm, Sean Devlin wrote: > Did you try wrapping everything w/ a call to lazy-seq? Yes, it doesn't seem change anything. -- 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

Re: Lazy recursive walk.

2010-01-17 Thread Nicolas Buduroi
> Sorry, I forgot to ask: how rapid is "rapidly"? Oh, I'd say I misused that word, at least it's way more than I need for what I use this for. I created this post only to see if someone would have an idea for a fully lazy version out of curiosity. From my experiments, the non-recursive version blo

Re: Lazy recursive walk.

2010-01-18 Thread Nicolas Buduroi
On Jan 16, 7:33 pm, Laurent PETIT wrote: > For the non lazy version , maybe using clojure.zip would help not blow > up the stack ? > > (using clojure.zip/zip + a loop with recur on clojure.zip/next) ? I've just tried it and it appears to be equivalent to the lazy walk version, which I think is fu

  1   2   3   4   >