Re: palingdrome problem (4 clojure)

2015-10-07 Thread Roelof Wobben
rison & input > to reverse. If you don't actually care about the concrete sequence type > (i.e. you only want sensible equality semantics after reversing something), > dropping it as soon as possible may be a better strategy. > > Take care, > Moe > > On Wed, Oct

palingdrome problem (4 clojure)

2015-10-07 Thread Roelof Wobben
Hello, I try to solve a problem for 4clojure where I have to make a palingdrome detector. So for trying I did this : (ns fourclojure.core (:gen-class)) (defn palingdrome [string] ( reverse string)) (apply str (palingdrome '( 1 2 3) )) '321' (apply str (palingdrome "Roelof" )) "foleoR

Re: 4clojure count problem

2015-10-04 Thread Roelof Wobben
ce > > Take care, > Moe > > On Sun, Oct 4, 2015 at 8:40 AM, Roelof Wobben > wrote: > >> Oke, then I hve to find out where to put the initial value. >> >> These two do not work : >> >> (reduce (fn [counter] (inc counter)) 0 [1,2,3]) >> (reduce (

Re: 4clojure count problem

2015-10-04 Thread Roelof Wobben
lied with an initial value, reduce will use the first value > from the collection you supply - every sequence which doesn't start with > "1" will give you the wrong answer. > > Take care, > Moe > > On Sat, Oct 3, 2015 at 9:40 PM, Roelof Wobben > wrote: > >

4clojure count problem

2015-10-03 Thread Roelof Wobben
Hello, I have to make a function which counts a collection without using count. So I came up with this : (fn [coll] (reduce (fn [counter _ ] (inc counter)) coll))) it works well with coll is [ 1 2 3] but it fails with "Hello World" How can I improve my code to work in both cases. Please

Re: On Testing

2014-11-02 Thread Roelof Wobben
Here a example where midje could provide more info. I have this function : (defn pr134 [element a-seq] (and (contains? a-seq element) (nil? element)) ) and I have this test-function : (ns exercises.core-test (:use midje.sweet) (:use [exercises.core])) (facts "about `pr134`" (fa

Re: where do I think the wrong way

2014-10-29 Thread Roelof Wobben
y of doing it would be: > (conj book [:authors (conj (:authors book) new-author)]) > > Try this in a REPL: > > (def book {:title "zbook" :authors [{:name "James"}]}) > (def new-author {:name "Joe"}) > (assoc book :authors (conj (get book :auth

Re: where do I think the wrong way

2014-10-29 Thread Roelof Wobben
) Roelof Op woensdag 29 oktober 2014 12:08:35 UTC+1 schreef James Reeves: > On 29 October 2014 11:01, Roelof Wobben > > wrote: >> >> For a exercise I have to add something to the end of a existing map. >> >> So I thought this would work : >> >> (

where do I think the wrong way

2014-10-29 Thread Roelof Wobben
Hello, For a exercise I have to add something to the end of a existing map. So I thought this would work : (defn add-author [book new-author] (assoc book (conj :authors new-author))) and call the function with : (add-author little-schemer {:name "Gerald J. Sussman"}) then I see this er

Re: testing platform , midje or specjl ?

2014-10-28 Thread Roelof Wobben
) and > would have lost other battles I shouldn't have won (if you see what I mean). > > Ultimately, there are no wrong choices here - they are great. > > If it helps, I am starting a new project and starting off with > clojure.test to see how far that gets me. This is mo

Re: Cannot understand why I get this output.

2014-10-27 Thread Roelof Wobben
; Becomes: (= #{5} #{5}) > > Becomes: true > > - James > > On 27 October 2014 21:16, Roelof Wobben > > wrote: > >> Np, So if I understand it right. I see the first one in repl. >> Because midje has #{octavia} and in another function is stated : >> &

Re: Cannot understand why I get this output.

2014-10-27 Thread Roelof Wobben
{:name "Octavia E. Butler", :birth-year > 1947, :death-year 2006}}} >{:title "Wild Seed", :authors #{octavia}}) > > That should work. > > - James > > On 27 October 2014 20:20, Roelof Wobben > > wrote: > >> nope, there is som

Re: Cannot understand why I get this output.

2014-10-27 Thread Roelof Wobben
014 19:37, Roelof Wobben > > wrote: > >> of course I can. >> >> If I look at answers other people gives then this is the solution : >> >> (defn old-book->new-book [book] >> (assoc book :authors (set (book :authors))) >> ) >> &

Re: Cannot understand why I get this output.

2014-10-27 Thread Roelof Wobben
midje checks and aproves the wrong answer ( the answer in the text) and aproves the wrong answer. Roelof On Monday, October 27, 2014 8:24:12 PM UTC+1, James Reeves wrote: > On 27 October 2014 19:16, Roelof Wobben > > wrote: > >> Wierd, also on 1.5.1 I see the same output as

Re: Cannot understand why I get this output.

2014-10-27 Thread Roelof Wobben
Wierd, also on 1.5.1 I see the same output as 1.6.0. So there is a error in the page or the test are not checking it properly . Pity, this is a way I like to learn. Roelof Op maandag 27 oktober 2014 18:03:29 UTC+1 schreef Roelof Wobben: > Thanks. > > I did a peek at the answ

Re: Cannot understand why I get this output.

2014-10-27 Thread Roelof Wobben
Op maandag 27 oktober 2014 16:55:32 UTC+1 schreef Gary Verhaegen: > On Monday, 27 October 2014, Roelof Wobben wrote: >> >> I expected the outcome : *octavia* >> but I see the output : [{:death-year 2006, :name " >> Octavia E. Butler", :birth-year 1947}] >

Re: Cannot understand why I get this output.

2014-10-27 Thread Roelof Wobben
; I think you're confused on the terminal output. Try typing [octavia] in > the repl, and compare the output you get to the above code. > > Clojure prints out the raw values of any computation, not variable names. > > > > On Mon, Oct 27, 2014 at 9:45 AM, Roelof Wobben >

Re: Cannot understand why I get this output.

2014-10-27 Thread Roelof Wobben
Op maandag 27 oktober 2014 16:37:49 UTC+1 schreef James Reeves: > > On 27 October 2014 13:45, Roelof Wobben > > wrote: > >> Hello, >> >> I have this "facts". >> >> (def octavia {:name "Octavia E. Butler" >>

Re: Cannot understand why I get this output.

2014-10-27 Thread Roelof Wobben
Op maandag 27 oktober 2014 16:07:15 UTC+1 schreef Gary Verhaegen: > > On Monday, 27 October 2014, Roelof Wobben > wrote: > >> Now Im complete confused. I never succeed in reading the value of authors >> so I can do the set command. >> >> Roelof >> >

Re: Cannot understand why I get this output.

2014-10-27 Thread Roelof Wobben
et function: (set [octavia]). > > On Monday, 27 October 2014, Roelof Wobben > wrote: > >> correct, >> >> What I try to achieve is to read the vector called authors and convert it >> into a set later. >> So I thought i could read the contents of author

Re: Cannot understand why I get this output.

2014-10-27 Thread Roelof Wobben
er" >>> >>> :birth-year 1947 >>> :death-year 2006}" >>> >>> >>> In other words, it is all working correctly. >>> >>> >>> Did you mean (old-book->new-book {:title

Re: Cannot understand why I get this output.

2014-10-27 Thread Roelof Wobben
le element. That > single element being "{:name "Octavia E. Butler" > > :birth-year 1947 > :death-year 2006}" > > > In other words, it is all working correctly. > > > Did you mean (old-book->new-book {:title "Wild Seed", :authors (

Cannot understand why I get this output.

2014-10-27 Thread Roelof Wobben
Hello, I have this "facts". (def octavia {:name "Octavia E. Butler" :birth-year 1947 :death-year 2006}) (def wild-seed {:title "Wild Seed", :authors [octavia]}) So I thought when I do this : (defn old-book->new-book [book] (get book :authors)) (old-book-

after updating clojure a repl error message

2014-10-27 Thread Roelof Wobben
Hello, I updated my clojure from 1.5.1 to 1.6.0 and after I start lein repl I see this output : ERROR: Unhandled REPL handler exception processing message {:id cd35f8f4-8560-401e-8c70-466e00016c78, :op ack, :port 48024}

testing platform , midje or specjl ?

2014-10-26 Thread Roelof Wobben
Hello, Im learning clojure as the beginnner. When im googeling for a testing platform there seems to be two major choices midje and specjl. Now I see that my learning course from github uses midje. Can I better learn midje and it this one still active maintained or can I better learn specjl.

how to count items in a list

2014-10-24 Thread Roelof Wobben
Hello, Im at exercise 21 : http://iloveponies.github.io/120-hour-epic-sax-marathon/structured-data.html#exercise-20 Where I have to find out if a sequence has duplicates. But I have no clue how to handle this . I think making a set of it and then map count the old one with the set I have m

Re: map problem (Ilove ponies)

2014-10-24 Thread Roelof Wobben
t; > hth > lvh > > > On 24 Oct 2014, at 15:56, Roelof Wobben > > wrote: > > > Sorry but I still do not have a clue how clojure knows what x is. > > > > the first part where x is mentioned is the fn part and on the map part > there is no mention about x.

Re: map problem (Ilove ponies)

2014-10-24 Thread Roelof Wobben
Sorry but I still do not have a clue how clojure knows what x is. the first part where x is mentioned is the fn part and on the map part there is no mention about x. Roelof Op vrijdag 24 oktober 2014 15:51:30 UTC+2 schreef Laurens Van Houtven: > Hi Roelof, > > > I understand that part. >

Re: map problem (Ilove ponies)

2014-10-24 Thread Roelof Wobben
Op vrijdag 24 oktober 2014 15:32:33 UTC+2 schreef Laurens Van Houtven: > > Hi Roelof, > > On 24 Oct 2014, at 15:12, Roelof Wobben > > wrote: > > > I understand that part but when I look at the map part there is no x. > When I look at the function no x. >

Re: map problem (Ilove ponies)

2014-10-24 Thread Roelof Wobben
I understand that part but when I look at the map part there is no x. When I look at the function no x. So how does Clojure know what the value of x is. Roelof Op vrijdag 24 oktober 2014 15:06:05 UTC+2 schreef Laurens Van Houtven: > Hi Roelof, > > On 24 Oct 2014, at 15:00, Roel

Re: map problem (Ilove ponies)

2014-10-24 Thread Roelof Wobben
Yes. I solved the problem with : (defn second-elements [collection] (let [second-item (fn [x] (get x 1))] (map second-item collection))) one thing I m not sure I understand complete. x is the output of the map command, if so, how does Clojure know that. Roelof Op vrijdag 24 oktober

Re: map problem (Ilove ponies)

2014-10-24 Thread Roelof Wobben
I try to make exercise 16. Roelof Op vrijdag 24 oktober 2014 14:27:19 UTC+2 schreef Laurens Van Houtven: > Hi Roelof, > > > I had no idea iloveponies was a Clojure introduction. > > > https://iloveponies.github.io/120-hour-epic-sax-marathon/structured-data.html > > What exercise are you at

Re: map problem (Ilove ponies)

2014-10-24 Thread Roelof Wobben
Thanks, but still very confusing for a beginner. the exercise is talking about using a helper function and it looks like second does the same as (get coll 1 ) Roelof Op vrijdag 24 oktober 2014 14:19:28 UTC+2 schreef Laurens Van Houtven: > Hi Roelof, > > On 24 Oct 2014, at 14:1

Re: map problem (Ilove ponies)

2014-10-24 Thread Roelof Wobben
Op vrijdag 24 oktober 2014 14:09:13 UTC+2 schreef Laurens Van Houtven: > > Hi Roelof, > > On 24 Oct 2014, at 14:05, Roelof Wobben > > wrote: > > > I have to use map and get a vector of all the second items in a list. > > I know I can use map to do th

map problem (Ilove ponies)

2014-10-24 Thread Roelof Wobben
Hello, I have to use map and get a vector of all the second items in a list. I know I can use map to do things with all the items in a list. and with get I can get the second item (get collection 1) map uses this map what_has _to_be_done collection so I thougt this would work (map (get coll

midje test : Can I only run 1 test

2014-10-21 Thread Roelof Wobben
Hello, I try again to learn clojure by the ponies github pages. But sometimes there is a lot of output of midje. Can I run only 1 test ? Roelof -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegr

book for a beginner with some exercises

2014-10-14 Thread Roelof Wobben
Hello, Is there a book for a beginner in Clojure where I can learn things and practice the things I learned with some exercises ? Roelof -- 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

Re: count not supported on this type

2014-05-09 Thread Roelof Wobben
count a number, I can > only count collections". > > - James > > > On 9 May 2014 17:42, Roelof Wobben >wrote: > >> I try to make this assigment : >> >> Write the function (contains-duplicates? sequence) that takes a sequence >> as

count not supported on this type

2014-05-09 Thread Roelof Wobben
I try to make this assigment : Write the function (contains-duplicates? sequence) that takes a sequence as a parameter and returns true if sequence contains some element multiple times. Otherwise it returns false. So I did this : (defn contains-duplicates? [a-seq] (let [element (fn element

Re: find the last and the nth item without using last or nth

2014-05-06 Thread Roelof Wobben
gt; (first coll) > (recur (next coll) (+ acc 1) > > Additionally, you're using an unquoted list to test. Use a vector or quote > the list: > > (nth* [1 2 3 4 5] 2) > > - James > > > On 6 May 2014 16:05, Roelof Wobben >wrote: > >> I tried t

Re: find the last and the nth item without using last or nth

2014-05-06 Thread Roelof Wobben
cannot figure out what the coll and what the number is ? Roelof Op woensdag 30 april 2014 12:53:01 UTC+2 schreef James Reeves: > On 30 April 2014 11:41, Roelof Wobben >wrote: >> >> >> Op woensdag 30 april 2014 12:14:39 UTC+2 schreef James Reeves: >>> >>> &

Re: CompilerException java.lang.IllegalArgumentException: Mismatched argument count to recur

2014-05-06 Thread Roelof Wobben
be : (first(drop(reverse v)) Roelof Op dinsdag 6 mei 2014 13:36:53 UTC+2 schreef Roelof Wobben: > > As far as I understand recur is going back to the loop so number is never > going back to 0 > but I see the problem (-(count coll)2 is changing it value and that > schould not

Re: CompilerException java.lang.IllegalArgumentException: Mismatched argument count to recur

2014-05-06 Thread Roelof Wobben
As far as I understand recur is going back to the loop so number is never going back to 0 but I see the problem (-(count coll)2 is changing it value and that schould not happen. So I think I have to set the initial value of counter in the let. what schould happen is this coll

Re: CompilerException java.lang.IllegalArgumentException: Mismatched argument count to recur

2014-05-06 Thread Roelof Wobben
ll counter (- (count coll)2)] (if (= counter number) (first coll) (recur (next coll) (+ number 1)) But when I do (secondlast (list 1 2 3 4 5)) I still do not get a answer, Roelof > - James > > > On 6 May 2014 11:24, Roelof Wobben >wrote: > &

Re: CompilerException java.lang.IllegalArgumentException: Mismatched argument count to recur

2014-05-06 Thread Roelof Wobben
. Roelof Op dinsdag 6 mei 2014 10:51:09 UTC+2 schreef Roelof Wobben: > > > > Op dinsdag 6 mei 2014 10:43:40 UTC+2 schreef Benjamin R. Haskell: >> >> `loop` expects a vector of binding forms (with initial values), not just >> a vector of names. >> >> (loop [c

Re: CompilerException java.lang.IllegalArgumentException: Mismatched argument count to recur

2014-05-06 Thread Roelof Wobben
Op dinsdag 6 mei 2014 10:43:40 UTC+2 schreef Benjamin R. Haskell: > > `loop` expects a vector of binding forms (with initial values), not just a > vector of names. > > (loop [coll counter]; means there is one `loop` binding named `coll`, > with the initial value of `counter` > > To fix that

CompilerException java.lang.IllegalArgumentException: Mismatched argument count to recur

2014-05-06 Thread Roelof Wobben
Hello, I have this form (ns forclojure.core) (defn secondlast [coll counter] (let [ number 0 counter ( - (count coll)2)] (loop [coll counter] (if (== counter number) (first coll) (recur (next coll) (+ counter 1 )) But as soon as I try to

Re: why is this failing on a list

2014-05-04 Thread Roelof Wobben
because you cannot know how many values you have. (fn secondlast [v] (nth v (-(count v)1))) Roelof Op zondag 4 mei 2014 16:49:45 UTC+2 schreef Lee: > > > On May 4, 2014, at 10:42 AM, Roelof Wobben > > wrote: > > > For 4clojure I have to find the second to last item.

why is this failing on a list

2014-05-04 Thread Roelof Wobben
Hello, For 4clojure I have to find the second to last item. So I did this: (fn secondlast [v] (get v (-(count v)1))) Now it's only failing at this test : (= (__ (list 1 2 3 4 5)) 4) Can anyone tell me where I did take the wrong way. Roelof -- You received this message because you are

Re: Do not understand why loop takes 3 arguments who are all the same

2014-05-03 Thread Roelof Wobben
> > > (fn [default initial-keys] > (loop [remaining-keys initial-keys > result-map {}] > (if (empty? remaining-keys) >result-map >(let [key (first remaining-keys) > remaining-keys' (rest remaining-keys) > result-map' (as

Do not understand why loop takes 3 arguments who are all the same

2014-05-03 Thread Roelof Wobben
Hello, Im now at the last exercise of the beginners exercise of 4clojure. I figured out that this solution works. (fn [default lijst1] (loop [lijst lijst1 d {}] (if (empty? lijst) d (recur (rest lijst) (assoc d (first lijst) default) But as I see it lijst lijst 1 and d

Re: Do not understand the -> macro here

2014-05-01 Thread Roelof Wobben
ion that makes this true in this >> case makes [1 2 3 4 5] to 5 >> >> >> On Thu, May 1, 2014 at 4:23 PM, Maik Schünemann >> >> > wrote: >> >>> >>> >>> >>> On Thu, May 1, 2014 at 3:51 PM, Roelof Wobben >>>

Re: Do not understand the -> macro here

2014-05-01 Thread Roelof Wobben
part of B. > No problem. But still it does not make any sense. If I do it right. this schould be the output of the functions A [ 1 2 3 4 5] B [ 1 2 3 4 5] (= A B 5) --> [1,2,3,4,5] = [1,2,3,4,5] = 5 and this is not true. > > > > On Thu, May 1, 2014 at 7:52 AM, Roelof

Re: Do not understand the -> macro here

2014-05-01 Thread Roelof Wobben
Is this a nice explanation about macros : http://bryangilbert.com/code/2013/07/30/anatomy-of-a-clojure-macro/ or is there a better one for a beginner. Roelof -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to cl

Re: Do not understand the -> macro here

2014-04-30 Thread Roelof Wobben
one . That is last. But what I try to find out and do not understand is how it boils down to that question. Why make a difficult thing if you could also write down the question that you have asked. Roelof > > > On 30 April 2014 18:18, Roelof Wobben >wrote: > >> >>

Re: Do not understand the -> macro here

2014-04-30 Thread Roelof Wobben
Op woensdag 30 april 2014 19:12:24 UTC+2 schreef James Reeves: > > The 5 is just the last part of the equality statement. This might be > easier to see by adding in a "let": > > (let [x (__ (sort (rest (reverse [2 5 4 1 3 6] > y (-> [2 5 4 1 3 6] (reverse) (rest) (sort) (__))] > (= x

Re: Do not understand the -> macro here

2014-04-30 Thread Roelof Wobben
Op woensdag 30 april 2014 18:46:36 UTC+2 schreef James Reeves: > > These two forms are equivalent: > > (__ (sort (rest (reverse [2 5 4 1 3 6] > > (-> [2 5 4 1 3 6] (reverse) (rest) (sort) (__)) > > The -> macro turns the second form into the first. You can see this by > running macro

Do not understand the -> macro here

2014-04-30 Thread Roelof Wobben
On 4 clojure there it this exercise: (= (__ (sort (rest (reverse [2 5 4 1 3 6] (-> [2 5 4 1 3 6] (reverse) (rest) (sort) (__)) 5) if I understand it right this is happen reverse[ 2 5 4 1 3 6] gives [ 6 3 1 4 5 2 ] Then rest [ 6 3 1 4 5 2] gives [ 3 1 4 5 2] Sort this and you get [ 1

Re: find the last and the nth item without using last or nth

2014-04-30 Thread Roelof Wobben
Op woensdag 30 april 2014 12:14:39 UTC+2 schreef James Reeves: > > > On 30 April 2014 10:41, Roelof Wobben >wrote: > >> >> Op woensdag 30 april 2014 09:58:26 UTC+2 schreef James Reeves: >> >>> >>> Unlike vectors, seqs are simple structures an

Re: find the last and the nth item without using last or nth

2014-04-30 Thread Roelof Wobben
Op woensdag 30 april 2014 09:58:26 UTC+2 schreef James Reeves: > > On 30 April 2014 07:49, Roelof Wobben >wrote: >> >> >> Op woensdag 30 april 2014 08:21:40 UTC+2 schreef James Reeves: >> >>> >>> 1. How do you find the last element of a seq with

Re: find the last and the nth item without using last or nth

2014-04-30 Thread Roelof Wobben
Op woensdag 30 april 2014 09:58:26 UTC+2 schreef James Reeves: > > On 30 April 2014 07:49, Roelof Wobben >wrote: >> >> >> Op woensdag 30 april 2014 08:21:40 UTC+2 schreef James Reeves: >> >>> >>> 1. How do you find the last element of a seq with

Re: find the last and the nth item without using last or nth

2014-04-30 Thread Roelof Wobben
Op woensdag 30 april 2014 08:50:22 UTC+2 schreef Roelof Wobben: > > > > Op woensdag 30 april 2014 08:22:07 UTC+2 schreef Tassilo Horn: >> >> Roelof Wobben writes: >> >> > Could a recurvice way or a loop do the trick. >> >> Yes. >> &g

Re: find the last and the nth item without using last or nth

2014-04-29 Thread Roelof Wobben
Op woensdag 30 april 2014 08:22:07 UTC+2 schreef Tassilo Horn: > > Roelof Wobben > writes: > > > Could a recurvice way or a loop do the trick. > > Yes. > > > And how do I then take the right value. > > For nth, you need a counter that you can increme

Re: find the last and the nth item without using last or nth

2014-04-29 Thread Roelof Wobben
ind out the last element of a seq that may have one *or* two > elements? > Look at the length. If it has one element , see question 1 if it has 2 elements, see question 3. > > - James > > > > On 30 April 2014 07:08, Roelof Wobben >wrote: > >> Hello, >&g

find the last and the nth item without using last or nth

2014-04-29 Thread Roelof Wobben
Hello, IM busy with 4Clojure and I have now two challenges which I think can be solved the same way. On a list I first have to find the last item of a list without using last and after that I have to do the same for a nth item and im not allowed to use nth. Now I can convert the list to a ve

cursive plugin question

2014-04-29 Thread Roelof Wobben
Hello, I installed intelij with the cursive plugin. Now I wonder if this can be done in some way. Suppose I have a file with 3 functions. Can I send one to REPL so I can test if it works as I expected. Roelof -- You received this message because you are subscribed to the Google Groups "Cloj

eclipse REPL problem (no prompt)

2014-04-28 Thread Roelof Wobben
Hello, I try now the eclipse with CounterClockwise plugin. It looks to work fine except one thing. When I open a repl I do not see a sort of prompt. Does anyone know how to solve this ? Roelof -- You received this message because you are subscribed to the Google Groups "Clojure" group. To po

Re: comparison with 3 arguments. Do I understand it right ?

2014-04-23 Thread Roelof Wobben
found the solution: (defn divides? [divisor n] (zero? (mod n divisor))) Roelof Op woensdag 23 april 2014 14:59:31 UTC+2 schreef Roelof Wobben: > > > Op woensdag 23 april 2014 14:55:39 UTC+2 schreef Tassilo Horn: >> >> Roelof Wobben writes: >> >>

Re: comparison with 3 arguments. Do I understand it right ?

2014-04-23 Thread Roelof Wobben
Op woensdag 23 april 2014 14:55:39 UTC+2 schreef Tassilo Horn: > > Roelof Wobben > writes: > > > Chips I thought I understand it > > But this does not work > > > > (defn divides? [divisor n] > > (mod n divisor)) > > It seems that `div

Re: comparison with 3 arguments. Do I understand it right ?

2014-04-23 Thread Roelof Wobben
Chips I thought I understand it But this does not work (defn divides? [divisor n] (mod n divisor)) I still get a cannot be cast error message. Roelof Op woensdag 23 april 2014 14:32:41 UTC+2 schreef Roelof Wobben: > > > Op woensdag 23 april 2014 14:26:14 UTC+2 schreef Tas

Re: comparison with 3 arguments. Do I understand it right ?

2014-04-23 Thread Roelof Wobben
Op woensdag 23 april 2014 14:26:14 UTC+2 schreef Tassilo Horn: > > Roelof Wobben > writes: > > > The only thing which is failing now is this one ; > > > > (defn abs [x] > > (< x 0) > > (* x -1); > > x) > > > >

Re: comparison with 3 arguments. Do I understand it right ?

2014-04-23 Thread Roelof Wobben
Op woensdag 23 april 2014 13:23:17 UTC+2 schreef David Della Costa: > > What James meant was that you should use it like so: > > => (defn teen? [age] (< 12 age 20)) > #'user/teen? > => (teen? 50) > false > => (teen? 10) > false > => (teen? 14) > true > => (if (teen? 14) "yes is a teen" "

Re: comparison with 3 arguments. Do I understand it right ?

2014-04-23 Thread Roelof Wobben
e concisely as: > > (defn teen? [age] > (< 12 age 20)) > > The "if" statement is unnecessary. > > - James > > > On 23 April 2014 11:11, Roelof Wobben >wrote: > >> Hello, >> >> I do not understand why this work. >> >

comparison with 3 arguments. Do I understand it right ?

2014-04-23 Thread Roelof Wobben
Hello, I do not understand why this work. I have to check if someone is between 12 and 20 years. So after some trail and error this seems to work (defn teen? [age] (if (< 12 age 20) true; false)) Is it right it stated 12 < age < 20 ? Roelof -- You received this message becau

Re: Which linux distro has intelij ?

2014-04-22 Thread Roelof Wobben
:54 UTC+4 пользователь Roelof Wobben > написал: >> >> Hello, >> >> Does anyone know a Linux distro which I can use to learn clojure and >> which has inteljij aviable. >> I really like to test the cursive plugin >> >> Roelof >> >> -- Y

Which linux distro has intelij ?

2014-04-22 Thread Roelof Wobben
Hello, Does anyone know a Linux distro which I can use to learn clojure and which has inteljij aviable. I really like to test the cursive plugin Roelof -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@g

Re: Light table

2014-04-17 Thread Roelof Wobben
It seems that Nightcode works What do you experts think of this IDE. Roelof Op donderdag 17 april 2014 13:39:31 UTC+2 schreef Roelof Wobben: > Thanks all. > > Unfortunally I cannot get Lighttable work. > I work with Nixos where all the packages are stored in > /var/store/ni

Re: boolean problem

2014-04-17 Thread Roelof Wobben
Op donderdag 17 april 2014 13:26:35 UTC+2 schreef Michael Gardner: > > On Apr 17, 2014, at 02:34 , Tassilo Horn > > wrote: > > > And now you have an if without then which will give you another > > exception. > Yep, but that one I solved already. > > Not true. It's more common to use 'when

Re: Light table

2014-04-17 Thread Roelof Wobben
Emacs because old habits die hard. But > I expect to move to Light Table at some point. > > On Wednesday, April 16, 2014 9:42:40 PM UTC+2, Roelof Wobben wrote: >> >> Has anyone tried Light table as a IDE instead of Emacs ? >> >> Roelof >> >> -- You receiv

Re: boolean problem

2014-04-17 Thread Roelof Wobben
Op donderdag 17 april 2014 09:34:52 UTC+2 schreef Tassilo Horn: > > Stanislas Nanchen > writes: > > > You miss one parentheses at the end of your expression > > > > (defn boolean [x] > > (if (and (nil? x) (false? x)) > > )) > > And now you have an if without then which will give you ano

boolean problem

2014-04-17 Thread Roelof Wobben
Hello, IM working at the Iloveponies github tutorial and Im stuck here, I have to check if x is a nil or false and then the output must be false,\ Otherwise I have to be true. So I tried this : (defn boolean [x] (if (and (nil? x) (false? x)) ) But then I see a very long error message: x

Light table

2014-04-16 Thread Roelof Wobben
Has anyone tried Light table as a IDE instead of Emacs ? Roelof -- 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: is there a way I can learn clojure with a lot of exercises

2014-04-16 Thread Roelof Wobben
Op woensdag 16 april 2014 16:43:09 UTC+2 schreef Charlie Griefer: > > > On Apr 15, 2014, at 11:56 PM, Roelof Wobben > > wrote: > > I like to try clojure. > I have little or none programming background but I know I learn the best > by reading a piece of text > and

Re: braveclojure problem ( paste into emacs)

2014-04-16 Thread Roelof Wobben
> > Also, if Emacs is too difficult to work with, then it's definitely ok to > use whatever editor you like most :) > > Thanks, > Daniel > > On Wednesday, April 16, 2014 6:57:41 AM UTC-4, Roelof Wobben wrote: >> >> Hello, >> >> I try to learn c

Re: braveclojure problem ( paste into emacs)

2014-04-16 Thread Roelof Wobben
Op woensdag 16 april 2014 12:57:41 UTC+2 schreef Roelof Wobben: > > Hello, > > I try to learn coljure by using this tutorial: http://www.braveclojure.com > Im now at point 7 : http://www.braveclojure.com/basic-emacs/ > > There I must paste a text into emacs. > > But a

Re: is there a way I can learn clojure with a lot of exercises

2014-04-16 Thread Roelof Wobben
gives more insight into Clojure's inner > workings and pitfalls. > > As references use clojure-doc.org for tutorials and clojuredocs.org for > core function examples. > > On Wednesday, April 16, 2014 9:53:06 AM UTC+2, Roelof Wobben wrote: >> >> >> >> Thanks,

braveclojure problem ( paste into emacs)

2014-04-16 Thread Roelof Wobben
Hello, I try to learn coljure by using this tutorial: http://www.braveclojure.com Im now at point 7 : http://www.braveclojure.com/basic-emacs/ There I must paste a text into emacs. But as far as I know there is no mentioned how I can paste text into emacs. Roelof -- You received this message

Re: is there a way I can learn clojure with a lot of exercises

2014-04-16 Thread Roelof Wobben
Thanks, Can this site also be good : http://www.braveclojure.com/ Roelof Op woensdag 16 april 2014 09:07:36 UTC+2 schreef Bruce Wang: > Try 4clojure.com > > > On Wed, Apr 16, 2014 at 4:56 PM, Roelof Wobben > > > wrote: > >> Hello, >> >> I lik

is there a way I can learn clojure with a lot of exercises

2014-04-15 Thread Roelof Wobben
Hello, I like to try clojure. I have little or none programming background but I know I learn the best by reading a piece of text and then do exercises about it so I can check if I really understand it. What is then the best way to proceed ? Roelof -- You received this message because you ar

Re: Do I have to have knowlegde about Lisp

2014-03-10 Thread Roelof Wobben
Op maandag 10 maart 2014 15:41:12 UTC+1 schreef Roelof Wobben: > > Hello, > > I like the idea of Clojure but I wonder if I have to know a lot of Lisp to > work with Clojure. > > What is the best way to go from a absolute beginner to someone who can > work w

Do I have to have knowlegde about Lisp

2014-03-10 Thread Roelof Wobben
Hello, I like the idea of Clojure but I wonder if I have to know a lot of Lisp to work with Clojure. What is the best way to go from a absolute beginner to someone who can work with Clojure. Roelof -- You received this message because you are subscribed to the Google Groups "Clojure" group