That whole form is not something you would be likely to write. I think the
exercise is just trying to demonstrate that the version with the -> is
equivalent to the version without the arrow and perhaps also that (= a b c)
can be used instead of (and (= a b) (= b c)).

-- 
Michael Wood
On 01 May 2014 5:02 PM, "Roelof Wobben" <rwob...@hotmail.com> wrote:

> oke,
>
> I misunderstood everyone.
> The right answer is last.
>
> (def A (__ (sort (rest (reverse [2 5 4 1 3 6])))))
> which would be :
>
> (def A (last (sort (rest (reverse [2 5 4 1 3 6])))))
> which resolves to 5
>
> (def B (-> [2 5 4 1 3 6] (reverse) (rest) (sort) (__)))
> Which would be :
>
> (def B (-> [2 5 4 1 3 6] (reverse) (rest) (sort) (last)))
>
> which resolves also to 5
>
> so the last part :
>
> ( = a b 5) is also true ( = 5 5 5)
>
> Still I find it wierd to make such sort of form.
>
> Roelof
>
>
> Op donderdag 1 mei 2014 16:35:59 UTC+2 schreef Erlis Vidal:
>
>> Look that (def A ...) won't compile as given, so you cannot say A is [1 2
>> 3 4 5], A is something else once you make it compile filling the blank
>> space with the missing function.
>>
>>
>> On Thu, May 1, 2014 at 10:24 AM, Maik Schünemann <maiksch...@gmail.com>wrote:
>>
>>> The task is to replace __ with the function 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 <maiksch...@gmail.com>wrote:
>>>
>>>>
>>>>
>>>>
>>>> On Thu, May 1, 2014 at 3:51 PM, Roelof Wobben <rwo...@hotmail.com>wrote:
>>>>
>>>>>
>>>>>
>>>>> Op donderdag 1 mei 2014 15:20:38 UTC+2 schreef Erlis Vidal:
>>>>>
>>>>>> I think the confusion is because they used multiple values when
>>>>>> comparing the equality
>>>>>>
>>>>>> (= (__ (sort (rest (reverse [2 5 4 1 3 6]))))
>>>>>>    (-> [2 5 4 1 3 6] (reverse) (rest) (sort) (__))
>>>>>>    5)
>>>>>>
>>>>>> This can be seen as :
>>>>>> (def A (__ (sort (rest (reverse [2 5 4 1 3 6])))))
>>>>>> (def B (-> [2 5 4 1 3 6] (reverse) (rest) (sort) (__)))
>>>>>>
>>>>>> Then the 4Clojure exercise can be written as:
>>>>>>
>>>>>> (= A B 5)
>>>>>>
>>>>>> Do not feel bad, this took me some time to realize 5 was not 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.
>>>>>
>>>>    This is the output when you don't write the function to replace __.
>>>>
>>>>
>>>>>
>>>>>
>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Thu, May 1, 2014 at 7:52 AM, Roelof Wobben <rwo...@hotmail.com>wrote:
>>>>>>
>>>>>>> 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 clo...@googlegroups.com
>>>>>>>
>>>>>>> Note that posts from new members are moderated - please be patient
>>>>>>> with your first post.
>>>>>>> To unsubscribe from this group, send email to
>>>>>>> clojure+u...@googlegroups.com
>>>>>>>
>>>>>>> For more options, visit this group at
>>>>>>> http://groups.google.com/group/clojure?hl=en
>>>>>>> ---
>>>>>>> You received this message because you are subscribed to the Google
>>>>>>> Groups "Clojure" group.
>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>> send an email to clojure+u...@googlegroups.com.
>>>>>>>
>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>
>>>>>>
>>>>>>  --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Clojure" group.
>>>>> To post to this group, send email to clo...@googlegroups.com
>>>>> Note that posts from new members are moderated - please be patient
>>>>> with your first post.
>>>>> To unsubscribe from this group, send email to
>>>>> clojure+u...@googlegroups.com
>>>>> For more options, visit this group at
>>>>> http://groups.google.com/group/clojure?hl=en
>>>>> ---
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Clojure" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to clojure+u...@googlegroups.com.
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>>> To post to this group, send email to clo...@googlegroups.com
>>> Note that posts from new members are moderated - please be patient with
>>> your first post.
>>> To unsubscribe from this group, send email to
>>> clojure+u...@googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/group/clojure?hl=en
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to clojure+u...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>  --
> 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 email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to