REPL

2014-04-08 Thread Cecil Westerhof
Just downloaded and started with Clojure. Is there a reason that cursor movement does not work in the REPL? I am used that I can use up-cursor to execute an old commands again. -- Cecil Westerhof -- You received this message because you are subscribed to the Google Groups Clojure group

Re: REPL

2014-04-08 Thread Cecil Westerhof
. or you can do this using lein https://github.com/technomancy/leiningen, and start REPL via lein repl I will look into that also. -- Cecil Westerhof -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure

How to do this correct in Clojure

2014-04-08 Thread Cecil Westerhof
(when ( difference 1.1755025E-38) (println (format Different for %d (%e) i difference)) ))) But beside that this defines the two variables val and difference, it also generates a lot of nil values. What would be a better way to do this in Clojure? -- Cecil Westerhof

Re: How to do this correct in Clojure

2014-04-08 Thread Cecil Westerhof
the two variables val and difference, it also generates a lot of nil values. What would be a better way to do this in Clojure? -- Cecil Westerhof -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email

Re: How to do this correct in Clojure

2014-04-08 Thread Cecil Westerhof
for %d (%e) i diff) That works. Thanks. On Tuesday, April 8, 2014 9:28:44 PM UTC+2, Cecil Westerhof wrote: 2014-04-08 20:49 GMT+02:00 Toby Crawley to...@tcrawley.org: Does this give you the results you are looking for? (doall (for [i (range 1 1000) :let [val (Math/sqrt i

Output of printf is buffered

2014-04-10 Thread Cecil Westerhof
. -- Cecil Westerhof -- 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. To unsubscribe from this group, send

Re: Output of printf is buffered

2014-04-10 Thread Cecil Westerhof
2014-04-10 12:52 GMT+02:00 Kevin Ilchmann Jørgensen kijm...@gmail.com: I believe this is how the terminal behave. You can force an (clojure.core/flush) But why does println not behave this way? I think I stick to println for the moment. On Thu, Apr 10, 2014 at 12:34 PM, Cecil Westerhof

Re: Output of printf is buffered

2014-04-10 Thread Cecil Westerhof
format string is %s: %s\n, so there is a newline, but it is not acted upon. 2014-04-10 19:30 GMT+08:00 Cecil Westerhof cldwester...@gmail.com: 2014-04-10 12:52 GMT+02:00 Kevin Ilchmann Jørgensen kijm...@gmail.com: I believe this is how the terminal behave. You can force an (clojure.core

Re: Output of printf is buffered

2014-04-10 Thread Cecil Westerhof
expect that both need a flush, or both do not need a flush. (The second is in my opinion the better of the two.) 2014-04-10 19:50 GMT+08:00 Cecil Westerhof cldwester...@gmail.com: 2014-04-10 13:40 GMT+02:00 Di Xu xudi...@gmail.com: there're three buffer mode in unix, line buffered, full

Using parallellisation

2014-04-10 Thread Cecil Westerhof
) and (* val val) be calculated in parallel? -- Cecil Westerhof -- 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

Re: Using parallellisation

2014-04-10 Thread Cecil Westerhof
not understand, between finishing (check-concurrent2) and getting back to the shell there is one minute. When calling only (check-sequential) the script returns immediately back to the shell. Why is this? On Thu, Apr 10, 2014 at 7:35 AM, Cecil Westerhof cldwester...@gmail.comwrote: I have

Re: Using parallellisation

2014-04-11 Thread Cecil Westerhof
(shutdown-agents) and the delay is gone. On Thu, Apr 10, 2014 at 4:35 PM, Cecil Westerhof cldwester...@gmail.comwrote: 2014-04-10 16:45 GMT+02:00 Andy Fingerhut andy.finger...@gmail.com: Forcing small bits of computation to be done in parallel using the tools Clojure and the JVM have at hand

Is it possible to give an atomic message?

2014-04-11 Thread Cecil Westerhof
to implement it better are appreciated. -- Cecil Westerhof -- 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

Re: Is it possible to give an atomic message?

2014-04-12 Thread Cecil Westerhof
2014-04-12 11:40 GMT+02:00 Max Penet m...@qbits.cc: Be aware that SimpleDateFormat is not threadsafe though. What should I use instead of SimpleDateFormat then? -- Cecil Westerhof -- You received this message because you are subscribed to the Google Groups Clojure group. To post

My experiments with concurrent programming

2014-04-12 Thread Cecil Westerhof
)) (doseq [number threads] (check-concurrent3 number)) Is this the right way to do things, or is there a better way? -- Cecil Westerhof -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure

How to work with variables that need to change

2014-04-12 Thread Cecil Westerhof
)) needed-times But it looks a 'little' cumbersome. Is there a better way to do this? Also if I need to use several points in time, do I keep nesting 'let', or is there a better way? -- Cecil Westerhof -- You received this message because you are subscribed to the Google Groups

Re: How to work with variables that need to change

2014-04-12 Thread Cecil Westerhof
#(* % %) (range (Math/pow n 5) (count (foo 10)) (defn timed-foo [times n] (let [start (now)] (foo n) (conj times (- (now) start (reduce timed-foo [] numbers) = [0 0 4 14] I am going to look into this. On Sat, Apr 12, 2014 at 1:13 PM, Cecil Westerhof cldwester...@gmail.comwrote

Re: How to work with variables that need to change

2014-04-12 Thread Cecil Westerhof
2014-04-12 15:49 GMT+02:00 Cecil Westerhof cldwester...@gmail.com: 2014-04-12 15:06 GMT+02:00 Fergal Byrne fergalbyrnedub...@gmail.com: or to convert your code to something more functional (and including defns for now and foo): (defn now [] (. System currentTimeMillis)) I already defined

Re: How to work with variables that need to change

2014-04-12 Thread Cecil Westerhof
sized, but you can measure your (now) using criterium.bench to be sure . OK, I'll look into a rewrite. Also note that reduce in the last line is lazy by default, so ensure to wrap it in a doall or vec to make it greedy. The doseq also good I think? -- Cecil Westerhof -- You received

Is it possible to find the number of cores

2014-04-12 Thread Cecil Westerhof
of the system where the program is running. Preferable system independent. Is there also a possibility to get the load of a system? When the load is low, I could start more threads as when the load is high. -- Cecil Westerhof -- You received this message because you are subscribed to the Google Groups

Re: Is it possible to find the number of cores

2014-04-12 Thread Cecil Westerhof
2014-04-12 16:51 GMT+02:00 Patrick Kristiansen patr...@patrkris.dk: http://stackoverflow.com/questions/4759570/finding-number-of-cores-in-java Thanks. I use now: (. (. Runtime (getRuntime)) availableProcessors) On Saturday, April 12, 2014 4:43:56 PM UTC+2, Cecil Westerhof wrote: I am

Re: Is it possible to find the number of cores

2014-04-12 Thread Cecil Westerhof
(getRuntime))) (.availableProcessors runtime) On Sat, Apr 12, 2014 at 4:18 PM, Cecil Westerhof cldwester...@gmail.comwrote: 2014-04-12 16:51 GMT+02:00 Patrick Kristiansen patr...@patrkris.dk: http://stackoverflow.com/questions/4759570/finding-number-of-cores-in-java Thanks. I use now

Get rid of the clojure.jar

2014-04-12 Thread Cecil Westerhof
. How do you make a jar file with everything in it? -- Cecil Westerhof -- 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

Re: How to work with variables that need to change

2014-04-12 Thread Cecil Westerhof
milliseconds) and I would like: 2 threads took6148 milliseconds 4 threads took3069 milliseconds 6 threads took2477 milliseconds 7 threads took2249 milliseconds 8 threads took2079 milliseconds How would I do that? -- Cecil Westerhof -- You received this message because

Re: Get rid of the clojure.jar

2014-04-12 Thread Cecil Westerhof
2014-04-12 17:56 GMT+02:00 Gary Trakhman gary.trakh...@gmail.com: Oh man, please consider using leiningen. It's a whole new world :-) http://leiningen.org/ That was on my list. I'll leave this problem for the moment being then, because it will be solved 'automatically'. :-D -- Cecil

Re: How to work with variables that need to change

2014-04-12 Thread Cecil Westerhof
2014-04-12 18:19 GMT+02:00 Fergal Byrne fergalbyrnedub...@gmail.com: On Sat, Apr 12, 2014 at 4:55 PM, Cecil Westerhof cldwester...@gmail.comwrote: (- numbers (reduce timed-foo []) (map format-time) println) (- numbers (reduce timed-foo []) (map format-time

Re: How to work with variables that need to change

2014-04-12 Thread Cecil Westerhof
sized, but you can measure your (now) using criterium.bench to be sure. The now function is not called often, so it does not really matter, but I changed it anyway. As expected the time is the same, but good code is also nice to have. -- Cecil Westerhof -- You received this message because you

Re: How to work with variables that need to change

2014-04-12 Thread Cecil Westerhof
opinion. On Sat, Apr 12, 2014 at 7:03 PM, Cecil Westerhof cldwester...@gmail.comwrote: 2014-04-12 16:18 GMT+02:00 Fergal Byrne fergalbyrnedub...@gmail.com: That's fine, but note that creating new Calendar objects has an overhead, using System.currentTimeMillis() is a static OS call which

Re: Is it possible to give an atomic message?

2014-04-12 Thread Cecil Westerhof
could be the reason that it makes the code faster? I find it even a little bit strange, because the logging is only a small part of what I am doing. -- Cecil Westerhof -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email

Re: My experiments with concurrent programming

2014-04-12 Thread Cecil Westerhof
need to know what you're trying to do to address it. I just started playing with Clojure a few days ago, so I am a tabula rasa. I attached what I have until now. If it can be improved, I like to know it. -- Cecil Westerhof -- You received this message because you are subscribed to the Google

lein uberjar much faster as lein run

2014-04-22 Thread Cecil Westerhof
: Leiningen is really a good tool. Only for that you could switch to Clojure. ;-)​ ​And another question: how would I ​ ​call the normal jar? Because when I do not distribute ​ ​the jar, it pays not to make the standalone jar. 33K or 3.5M is quite a difference.​ -- Cecil Westerhof -- You

Why can I not parse the command line arguments in this way

2014-04-22 Thread Cecil Westerhof
Obvious not very neat, but I tried as a first hack to do something with the command line parameters with: (doseq [type args] ​This does not work. Why not? ​ -- Cecil Westerhof -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group

Re: lein uberjar much faster as lein run

2014-04-22 Thread Cecil Westerhof
that is comparable to uberjar. I will use this in the future. Thanks. -- Cecil Westerhof -- 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

Re: Why can I not parse the command line arguments in this way

2014-04-22 Thread Cecil Westerhof
-main [ args] (if args (doseq [type args] (println (format Got here with: %s type) It behaved perfectly. When looking again at the code, I saw that my brackets where out of place. Sorry for the noise. -- Cecil Westerhof -- You received this message because you

Books for learning Clojure

2014-04-22 Thread Cecil Westerhof
with Programming Clojure and after that The Joy of Clojure. Any idea's about this? -- Cecil Westerhof -- 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

Re: Books for learning Clojure

2014-04-22 Thread Cecil Westerhof
is not very important? Formulated otherwise: no reason to switch from my original plan? On 22/04/2014, at 15:18, Cecil Westerhof cldwester...@gmail.com wrote: I have a ‘little’ to learn. ;-) I have worked with a lot of languages, including Lisp. I was thinking about the following books (in that order

Re: Clojure Office Hours

2014-04-22 Thread Cecil Westerhof
: it gets your blood streaming. :-D​ -- Cecil Westerhof -- 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

Re: Books for learning Clojure

2014-04-22 Thread Cecil Westerhof
2014-04-22 20:18 GMT+02:00 Cecil Westerhof cldwester...@gmail.com: I have a ‘little’ to learn. ;-) I have worked with a lot of languages, including Lisp. I was thinking about the following books (in that order): - Practical Clojure - Clojure in Action - The Joy of Clojure - Clojure

Re: Books for learning Clojure

2014-04-23 Thread Cecil Westerhof
2014-04-23 15:05 GMT+02:00 Stefan Kamphausen ska2...@gmail.com: Would German be an option for you? ​With what is available, not for me, but maybe for others it would.​ -- Cecil Westerhof -- You received this message because you are subscribed to the Google Groups Clojure group. To post

Functional programming and security

2014-05-04 Thread Cecil Westerhof
I heard the stand that functional programming made it difficult to write secure programs. I do not know enough of functional programming yet to determine the value of a statement like this. What is the take here about it? -- Cecil Westerhof -- You received this message because you

What to use use for writing GUI's

2014-05-04 Thread Cecil Westerhof
. But the example I saw with seesaw was inviting. -- Cecil Westerhof -- 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

Re: What to use use for writing GUI's

2014-05-04 Thread Cecil Westerhof
develop for Windows. On 4 May 2014 19:33, Cecil Westerhof cldwester...@gmail.com wrote: I am mostly a back-end writer. I dabbled a little with Scala before going to Clojure. (And more on the back-end as on the front-end.) But there was a discussion (I do not remember if it was on a Java or Scala

Re: What to use use for writing GUI's

2014-05-04 Thread Cecil Westerhof
2014-05-04 10:20 GMT+02:00 Cecil Westerhof cldwester...@gmail.com: 2014-05-04 10:09 GMT+02:00 Colin Fleming colin.mailingl...@gmail.com: There's really no only way to do anything in Clojure, since you can always drop down to Java interop. So anything that's available to Java is available

Re: What to use use for writing GUI's

2014-05-05 Thread Cecil Westerhof
on them. On 4 May 2014 10:44, Cecil Westerhof cldwester...@gmail.com wrote: 2014-05-04 10:20 GMT+02:00 Cecil Westerhof cldwester...@gmail.com: 2014-05-04 10:09 GMT+02:00 Colin Fleming colin.mailingl...@gmail.com: There's really no only way to do anything in Clojure, since you can always

Re: What to use use for writing GUI's

2014-05-05 Thread Cecil Westerhof
I think then. (I do not remember why Swing was discouraged.) I have to look into the start-up time. I did not know about that. -- Cecil Westerhof -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure

Re: Functional programming and security

2014-05-05 Thread Cecil Westerhof
being critical. (In reason.) ​ On 4 May 2014 08:24, Cecil Westerhof cldwester...@gmail.com wrote: I heard the stand that functional programming made it difficult to write secure programs. I do not know enough of functional programming yet to determine the value of a statement like this. What

Re: Functional programming and security

2014-05-05 Thread Cecil Westerhof
them. So ... it deppends :D ​That is always the case of-course, but it was suggested that functional programming made it inherently difficult.​ -- Cecil Westerhof -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email

Re: Functional programming and security

2014-05-05 Thread Cecil Westerhof
2014-05-04 23:40 GMT+02:00 Magnus Therning mag...@therning.org: On Sun, May 04, 2014 at 09:24:08AM +0200, Cecil Westerhof wrote: I heard the stand that functional programming made it difficult to write secure programs. I do not know enough of functional programming yet to determine

Re: Functional programming and security

2014-05-05 Thread Cecil Westerhof
​No, it was suggested that for secure programming you needed to do it modular and that this was not possible with a functional language. But off-course this is important also. -- Cecil Westerhof -- You received this message because you are subscribed to the Google Groups Clojure group

Re: Functional programming and security

2014-05-05 Thread Cecil Westerhof
, even if you are not primarily a programmer, without knowing more than one language. Or Herbert Mayer: No programming language is perfect. There is not even a single best language; there are only languages well suited or perhaps poorly suited for particular purposes. -- Cecil Westerhof -- You

Re: What to use use for writing GUI's

2014-05-05 Thread Cecil Westerhof
expect everyone that is going to use my application to have at least Java 7? - ​ ​ http://docs.oracle.com/javafx/2/installation_2-2/javafx-installation-linux.htmstates: ​Web Start applications and Web applications (plugin) features are currently not supported on the Linux platform. -- Cecil

Re: Functional programming and security

2014-05-05 Thread Cecil Westerhof
2014-05-05 12:05 GMT+02:00 Magnus Therning mag...@therning.org: On Mon, May 5, 2014 at 10:09 AM, Cecil Westerhof cldwester...@gmail.com wrote: 2014-05-04 23:40 GMT+02:00 Magnus Therning mag...@therning.org: On Sun, May 04, 2014 at 09:24:08AM +0200, Cecil Westerhof wrote: I heard

Re: Why does `lein new` default to clojure 1.5.1?

2014-05-06 Thread Cecil Westerhof
PM UTC-3, g vim wrote: I have Clojure 1.6.0 installed so why does `lein new app myapp` default to Clojure 1.5.1 inside project.clj? Even worse, `lein ancient upgrade :all` doesn't return an upgrade for Clojure 1.5.1 -- Cecil Westerhof -- You received this message because you are subscribed

Re: Functional programming and security

2014-05-06 Thread Cecil Westerhof
2014-05-05 12:17 GMT+02:00 Magnus Therning mag...@therning.org: On Mon, May 5, 2014 at 10:20 AM, Cecil Westerhof cldwester...@gmail.com wrote: 2014-05-05 8:21 GMT+02:00 Magnus Therning mag...@therning.org: any language ;) However, choosing language wisely will allow you to concentrate

Re: Functional programming and security

2014-05-06 Thread Cecil Westerhof
. A FIPS ​Would forced garbage collection not take care of that? -- Cecil Westerhof -- 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

Re: Functional programming and security

2014-05-06 Thread Cecil Westerhof
it, it could be different. Any security related discussion reaches a point were sanity is left far behind don't you agree ? :))) ​Better to paranoid as to easy going. But you need to be careful that you do not go full blown over the top. -- Cecil Westerhof -- You received this message

Local variable

2014-07-08 Thread Cecil Westerhof
way to do this? -- Cecil Westerhof -- 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. To unsubscribe

Re: Local variable

2014-07-08 Thread Cecil Westerhof
2014-07-08 16:55 GMT+02:00 John Gabriele jmg3...@gmail.com: On Tuesday, July 8, 2014 9:40:54 AM UTC-4, Cecil Westerhof wrote: In Clojure you can define a local constant with let, but I need a variable (I think). I want to do the following. I have a function that checks several things

Re: Local variable

2014-07-08 Thread Cecil Westerhof
2014-07-08 18:14 GMT+02:00 John Gabriele jmg3...@gmail.com: On Tuesday, July 8, 2014 11:38:42 AM UTC-4, Cecil Westerhof wrote: 2014-07-08 16:55 GMT+02:00 John Gabriele jmg...@gmail.com: On Tuesday, July 8, 2014 9:40:54 AM UTC-4, Cecil Westerhof wrote: In Clojure you can define a local

Re: Local variable

2014-07-08 Thread Cecil Westerhof
2014-07-08 23:11 GMT+02:00 Bob Hutchison hutch-li...@recursive.ca: On Jul 8, 2014, at 9:40 AM, Cecil Westerhof cldwester...@gmail.com wrote: In Clojure you can define a local constant with let, but I need a variable (I think). I want to do the following. I have a function that checks

Land of lisp to Clojure

2014-07-08 Thread Cecil Westerhof
do this for variables that can be changed. So I renamed some variables. Did I understand this correctly, or is the usage of asterisks for something else? -- Cecil Westerhof -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send

Re: Land of lisp to Clojure

2014-07-09 Thread Cecil Westerhof
2014-07-09 2:24 GMT+02:00 Bruce Wang br...@brucewang.net: You might want to check out this https://github.com/quux00/land-of-lisp-in-clojure ​I will look into it. But I learn most if I do it myself. ;-)​ -- Cecil Westerhof -- You received this message because you are subscribed

Re: Land of lisp to Clojure

2014-07-09 Thread Cecil Westerhof
it. On Tue, Jul 8, 2014 at 6:24 PM, Bruce Wang br...@brucewang.net wrote: Hi Cecil, You might want to check out this https://github.com/quux00/land-of-lisp-in-clojure Cheers, Bruce On Wed, Jul 9, 2014 at 9:49 AM, Cecil Westerhof cldwester...@gmail.com wrote: I received the book land of lisp

Re: Land of lisp to Clojure

2014-07-09 Thread Cecil Westerhof
2014-07-09 5:30 GMT+02:00 John Mastro john.b.mas...@gmail.com: Cecil Westerhof cldwester...@gmail.com wrote: - The book displays all the lines of a look on separate lines. In my case it is just one long line. Am I doing something wrong? No, you're not doing anything wrong. There's nothing

Re: Local variable

2014-07-09 Thread Cecil Westerhof
2014-07-09 4:19 GMT+02:00 Bob Hutchison hutch-li...@recursive.ca: On Jul 8, 2014, at 7:08 PM, Cecil Westerhof cldwester...@gmail.com wrote: 2014-07-08 23:11 GMT+02:00 Bob Hutchison hutch-li...@recursive.ca: On Jul 8, 2014, at 9:40 AM, Cecil Westerhof cldwester...@gmail.com wrote

Re: Land of lisp to Clojure

2014-07-09 Thread Cecil Westerhof
2014-07-09 9:39 GMT+02:00 Cecil Westerhof cldwester...@gmail.com: Or you could use a definition of look more like this, which uses println to print each item on its own line (not sure if you wanted to retain the parens or not, but both are easily doable). (defn look [] (doseq [d

Re: Land of lisp to Clojure

2014-07-09 Thread Cecil Westerhof
2014-07-09 10:38 GMT+02:00 Cecil Westerhof cldwester...@gmail.com: 2014-07-09 9:39 GMT+02:00 Cecil Westerhof cldwester...@gmail.com: Or you could use a definition of look more like this, which uses println to print each item on its own line (not sure if you wanted to retain the parens

How to access record in a hashmap

2014-07-09 Thread Cecil Westerhof
) and with: ('bucket object-locations) Personally I find the first better, but ‘Clojure Programming' uses the second possibility. What is the better way and why? -- Cecil Westerhof -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email

Re: How to access record in a hashmap

2014-07-09 Thread Cecil Westerhof
a HashMap. But better save as sorry. I will change it. On Wednesday, July 9, 2014 3:48:53 PM UTC+2, Cecil Westerhof wrote: When you have: (def object-locations { 'whiskey 'living-room 'bucket'living-room 'chain 'garden 'frog 'garden 'dummy

Re: How to access record in a hashmap

2014-07-09 Thread Cecil Westerhof
PM UTC+2, Cecil Westerhof wrote: When you have: (def object-locations { 'whiskey 'living-room 'bucket'living-room 'chain 'garden 'frog 'garden 'dummy 'nowhere 'test 'nowhere }) You can retrieve the location of the bucket

Re: How to access record in a hashmap

2014-07-09 Thread Cecil Westerhof
.) And it is displayed as: You see a whiskey on the floor. You see a bucket on the floor. Maybe it does not work in all cases: so I need to do some testing. ​Let change the rest also to keywords.​ On Wed, Jul 9, 2014 at 9:28 AM, Cecil Westerhof cldwester...@gmail.com wrote: 2014-07-09 17:18 GMT+02:00

Re: How to access record in a hashmap

2014-07-09 Thread Cecil Westerhof
2014-07-09 17:50 GMT+02:00 Cecil Westerhof cldwester...@gmail.com: 2014-07-09 17:32 GMT+02:00 Timothy Baldridge tbaldri...@gmail.com: (name :foo) will return the name as a string (symbol (name :foo)) Converts the name of the keyword to a symbol ​It is not even necessary. I changed

When to use ! in function name

2014-07-10 Thread Cecil Westerhof
are. So it has a side effect. But most of my functions have this. So, should I append them all with a '!'? -- Cecil Westerhof -- 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: When to use ! in function name

2014-07-11 Thread Cecil Westerhof
. In the book the where talking about side-effects, but only a change in global​ ​ state is more reasonable.​ On Thu, Jul 10, 2014 at 12:28 PM, Cecil Westerhof cldwester...@gmail.com wrote: When a function returns a true/false value you should end it with a '?'. Clojure Programming says that with side

Re: When to use ! in function name

2014-07-11 Thread Cecil Westerhof
2014-07-10 18:46 GMT+02:00 Stefan Kamphausen ska2...@gmail.com: On Thursday, July 10, 2014 5:28:26 PM UTC+2, Cecil Westerhof wrote: When a function returns a true/false value you should end it with a '?'. Clojure Programming says that with side effects you should end the function name

Re: When to use ! in function name

2014-07-11 Thread Cecil Westerhof
, but it is idempotent. -- Cecil Westerhof -- 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

Re: When to use ! in function name

2014-07-11 Thread Cecil Westerhof
2014-07-11 11:28 GMT+02:00 Stefan Kamphausen ska2...@gmail.com: On Friday, July 11, 2014 11:10:53 AM UTC+2, Cecil Westerhof wrote: 2014-07-10 18:34 GMT+02:00 Plínio Balduino pbal...@gmail.com: IMO, ! is used when change any global state. A side effect like print on screen is not enough

Re: When to use ! in function name

2014-07-11 Thread Cecil Westerhof
effect (a pgm will eventually use it), writing to a database, ... qualify. ​Then writing to a log file should qualify also. And as I understand it, it does not. -- Cecil Westerhof -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group

Re: When to use ! in function name

2014-07-11 Thread Cecil Westerhof
2014-07-11 14:28 GMT+02:00 Stefan Kamphausen ska2...@gmail.com: On Friday, July 11, 2014 11:33:34 AM UTC+2, Cecil Westerhof wrote: 2014-07-10 19:10 GMT+02:00 Softaddicts lprefo...@softaddicts.ca: ​but as I understood from others it is not about side-effects, but global state. as James

Why does the first expression take much longer

2014-07-12 Thread Cecil Westerhof
is happening here?​ -- Cecil Westerhof -- 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. To unsubscribe from

Re: Land of lisp to Clojure

2014-07-12 Thread Cecil Westerhof
.)] :dummy ['(Only for testing purposes.)] }) Because this is only accessed sequential, I would think it would be more efficient as a list then as a vector. (It is certainly less work to enter.) Or would a vector be here more efficient also? -- Cecil Westerhof -- You received this message

Re: Why does the first expression take much longer

2014-07-12 Thread Cecil Westerhof
retention. But I do not understand this. What is happening here?​ -- Cecil Westerhof -- 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

Moving average from Java to Clojure

2014-07-20 Thread Cecil Westerhof
, or is there a better way? -- Cecil Westerhof -- 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. To unsubscribe from

Why does this not give output

2014-08-05 Thread Cecil Westerhof
be expected with a good random generator?​ -- Cecil Westerhof -- 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

Why a Long class instead of integer class

2014-08-05 Thread Cecil Westerhof
) and (int (inc (aget intArr index))) Because of the class of those values is Long. Why are those not Integer? -- Cecil Westerhof -- 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: Why does this not give output

2014-08-05 Thread Cecil Westerhof
2014-08-05 19:04 GMT+02:00 Thomas Heller th.hel...@gmail.com: If you don't need the result of the for loop (which you don't in your example) use doseq. Same syntax as for but not lazy and no return value (well, nil to be exact) ​I already use dotimes, or is doseq better?​ -- Cecil

Re: Why a Long class instead of integer class

2014-08-05 Thread Cecil Westerhof
AM UTC-5, Michael Klishin wrote: On 5 August 2014 at 19:43:21, Cecil Westerhof (cldwes...@gmail.com) wrote: Because of the class of those values is Long. Why are those not Integer? To avoid the performance penalty of automatic promotion. In dynamically typed languages with auto-promotion

Re: Why does this not give output

2014-08-06 Thread Cecil Westerhof
[10 100 1000 2000 5000 1]] I still have a lot to learn, but I certainly like the expressiveness of clojure. On Wed, Aug 6, 2014 at 12:13 AM, Cecil Westerhof cldwester...@gmail.com wrote: 2014-08-05 19:04 GMT+02:00 Thomas Heller th.hel...@gmail.com: If you don't need the result

Presentation about Clojure

2014-08-21 Thread Cecil Westerhof
I am far from an expert on Clojure, but I am thinking about giving a talk about it on an Open Source event. Any tips about what to treat and what not to treat? I will have about 45 minutes. -- Cecil Westerhof -- You received this message because you are subscribed to the Google Groups

Re: Presentation about Clojure

2014-08-21 Thread Cecil Westerhof
, is there someone who has done something like this? What are the questions to expect. Then I can prepare myself.​ On Thu, Aug 21, 2014 at 12:06 PM, Cecil Westerhof cldwester...@gmail.com wrote: I am far from an expert on Clojure, but I am thinking about giving a talk about it on an Open Source event

Re: Presentation about Clojure

2014-08-21 Thread Cecil Westerhof
On Thu, Aug 21, 2014 at 12:06 PM, Cecil Westerhof cldwester...@gmail.com wrote: I am far from an expert on Clojure, but I am thinking about giving a talk about it on an Open Source event. Any tips about what to treat and what not to treat? I will have about 45 minutes. -- Cecil

Re: Presentation about Clojure

2014-08-21 Thread Cecil Westerhof
librarty with its own dsl, you have to learn new language? - How does new people adopts in your command? - What is production use of Clojure? That's all I remember. ​Thanks: that is very useful. -- Cecil Westerhof -- You received this message because you are subscribed to the Google Groups

Re: Presentation about Clojure

2014-08-21 Thread Cecil Westerhof
did your presentation take?​ 2014-08-21 13:39 GMT+03:00 Cecil Westerhof cldwester...@gmail.com: 2014-08-21 12:33 GMT+02:00 Serzh Nechyporchuk nechyporc...@gmail.com: I can give you my presentation about Clojure. I have several questions: - (classic) parenthesis - How do you model your

Re: Presentation about Clojure

2014-08-21 Thread Cecil Westerhof
if there is interest for that. The presentation took about 45 minutes. But with questions it took about one hour. ​Should be doable then. Thanks again.​ ​I am flabbergasted how useful this newsgroup is.​ :-D 2014-08-21 14:26 GMT+03:00 Cecil Westerhof cldwester...@gmail.com: 2014-08-21 12:49

Re: Presentation about Clojure

2014-08-23 Thread Cecil Westerhof
practices in order to avoid gotchas. ​Sadly I fell more as once in the error of not taking into account that certain things are lazy. :'-( ​Thanks. New things to think about. :-D ​ -- Cecil Westerhof -- You received this message because you are subscribed to the Google Groups Clojure group

CLISP books any good to learn Clojure

2014-08-24 Thread Cecil Westerhof
There are a lot of good (or so I am told) CLISP books. For example: “Paradigms Of Artificial Intelligence Programming Case Studies In Common Lisp”. Would they be useful for learning Clojure, or is the difference to big? I should at least have http://clojure.org/lisps handy. ;-) -- Cecil

Using Clojure for Social Media

2014-10-29 Thread Cecil Westerhof
is the best Clojure library for this. But it does not handle LinkedIn. What is the best way to use Clojure to post on Facebook, LinkedIn and Twitter? -- Cecil Westerhof -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email

Re: Using Clojure for Social Media

2014-10-29 Thread Cecil Westerhof
2014-10-29 14:46 GMT+01:00 Cecil Westerhof cldwester...@gmail.com: A long time I wrote a Bash script to post on Facebook by sending emails and a PHP script to post on Twitter with OAuth2. I find them lacking and I also want to post on LinkedIn. I thought it was a good project to learn more

Why doe floor and ceil accept clojure.lang.Ratio but round not

2014-11-24 Thread Cecil Westerhof
) Why? -- Cecil Westerhof -- 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. To unsubscribe from

Best way to work with an optional type

2014-11-25 Thread Cecil Westerhof
the best way to do this? Later on I probably should use clojure.math.numeric-tower. -- Cecil Westerhof -- 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

  1   2   3   >