Re: OK idea to replace conj and cons with "prepend" and "append" macros that have consistent behavior and return same types as args?

2018-07-23 Thread Didier

>
> And it’s worth noting that Rich has said nth is “somewhat of a mistake”: 
> https://gist.github.com/reborg/dc8b0c96c397a56668905e2767fd697f#why-cannot-last-be-fast-on-vector
>  
> 


Well, I think this is as canonical to answering the OP as we'll get, at 
least in terms of why there's no polymorphic comb method in Clojure that 
works on everything. 

On Monday, 23 July 2018 11:53:48 UTC-7, Sean Corfield wrote:
>
> But Clojure is geared more towards professional programmers who understand 
> that different data structures have different strengths and weaknesses, and 
> who prefer to use an API that makes those strengths and weaknesses 
> explicit, rather than fooling you into doing something inefficient.  (nth 
> being a notable exception).
>
>  
>
> And it’s worth noting that Rich has said nth is “somewhat of a mistake”: 
> https://gist.github.com/reborg/dc8b0c96c397a56668905e2767fd697f#why-cannot-last-be-fast-on-vector
>
>  
>
> (that whole answer is worth reading, in the context of this thread)
>
>  
>
> Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
> An Architect's View -- http://corfield.org/
>
> "If you're not annoying somebody, you're not really alive."
> -- Margaret Atwood
>
>  
> --
> *From:* clo...@googlegroups.com   > on behalf of Mark Engelberg  >
> *Sent:* Sunday, July 22, 2018 11:41:58 PM
> *To:* clojure
> *Subject:* Re: OK idea to replace conj and cons with "prepend" and 
> "append" macros that have consistent behavior and return same types as args? 
>  
> The book "Simply Scheme" teaches Scheme via a library that lets students 
> do things to either the left or right side of the list, even though the 
> operations on the right side of the list are inefficient.  That author 
> found it to be more intuitive to his students.
>
> But Clojure is geared more towards professional programmers who understand 
> that different data structures have different strengths and weaknesses, and 
> who prefer to use an API that makes those strengths and weaknesses 
> explicit, rather than fooling you into doing something inefficient.  (nth 
> being a notable exception).
>
> IMHO, a programming language for professionals will never be the ideal 
> choice for beginners, although Clojure is better than most professional 
> languages for that purpose.
>
> On Sun, Jul 22, 2018 at 7:29 PM, Christian Seberino  > wrote:
>
>>
>> Just what is it that you want to teach? Principles of computation, or 
>>> Clojure? Not the same. If the former, forget Clojure and give them a week 
>>> to work thru The Little Schemer. Then move on to clojure and the much more 
>>> complex stuff involved.
>>>
>>
>> I think you bring up a good point.
>> I wonder if we all have one of 2 mental images of what people mean by a 
>> "Clojure intro class".  Many probably mean something like a real corporate 
>> class where
>> people are trying to train developers on Clojure to get real work done.  
>>  I think more of the SICP/Scheme/MIT class where you have a lot of smart
>> people with no programming experience and you want to give them a solid 
>> academic intro.
>>
>> I agree Scheme is great for that.  However, what I find delicious is that 
>> Clojure is this >| |<--- close to being *both* a super practical 
>> language
>> *and* a better/cleaner teaching language!  This might surprise some but I 
>> actually think some things are more elegant in Clojure than Scheme!
>> For example, I like "fn" over "lambda".  Also, I like the seq abstraction 
>> over nested conses for the fundamental data structure.
>>
>> cs
>>
>>
>> -- 
>> 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 subscri

clojure test has 10 failures

2018-07-23 Thread Alex Miller
Could you explain more about your environment and how you ran the tests?

-- 
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.


clojure test has 10 failures

2018-07-23 Thread 冯忠孝
 [java] Ran 635 tests containing 17442 assertions.
 [java] 10 failures, 0 errors.



 [java] Testing clojure.test-clojure.printer
 [java]
 [java] FAIL in (print-throwable) (printer.clj:124)
 [java] expected: (= (-> (Exception. "heyo") Throwable->map) (-> 
(Exception. "heyo") pr-str read-string))
 [java]   actual: (not (= nil {:cause nil}))
 [java]
 [java] FAIL in (print-throwable) (printer.clj:124)
 [java] expected: (= (-> (Throwable. "I can a throwable" (Exception. 
"chain 1" (Exception. "chan 2"))) Throwable->map) (-> (Throwable. "I can a 
throwable" (Exception. "chain 1"
(Exception. "chan 2"))) pr-str read-string))
 [java]   actual: (not (= nil {:cause nil}))


[java] Testing clojure.test-clojure.errors
 [java]
 [java] FAIL in (Throwable->map-test) (errors.clj:67)
 [java] base functionality
 [java] expected: (= cause "I am a string literal")
 [java]   actual: (not (= nil "I am a string literal"))
 [java]
 [java] FAIL in (Throwable->map-test) (errors.clj:68)
 [java] base functionality
 [java] expected: (= 1 (count via))
 [java]   actual: (not (= 1 0))
 [java]
 [java] FAIL in (Throwable->map-test) (errors.clj:69)
 [java] base functionality
 [java] expected: (vector? via)
 [java]   actual: (not (vector? nil))
 [java]
 [java] FAIL in (Throwable->map-test) (errors.clj:70)
 [java] base functionality
 [java] expected: (= ["I am a string literal"] (map :message via))
 [java]   actual: (not (= ["I am a string literal"] ()))
 [java]
 [java] FAIL in (Throwable->map-test) (errors.clj:75)
 [java] causes
 [java] expected: (= cause "double two")
 [java]   actual: (not (= nil "double two"))
 [java]
 [java] FAIL in (Throwable->map-test) (errors.clj:76)
 [java] causes
 [java] expected: (= ["I am not a number" "double two"] (map :message 
via))
 [java]   actual: (not (= ["I am not a number" "double two"] ()))
 [java]
 [java] FAIL in (Throwable->map-test) (errors.clj:89)
 [java] nil stack handled
 [java] expected: (= cause "abc")
 [java]   actual: (not (= nil "abc"))
 [java]
 [java] FAIL in (Throwable->map-test) (errors.clj:90)
 [java] nil stack handled
 [java] expected: (= trace [])
 [java]   actual: (not (= nil []))



-- 
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.


RE: OK idea to replace conj and cons with "prepend" and "append" macros that have consistent behavior and return same types as args?

2018-07-23 Thread Sean Corfield
But Clojure is geared more towards professional programmers who understand that 
different data structures have different strengths and weaknesses, and who 
prefer to use an API that makes those strengths and weaknesses explicit, rather 
than fooling you into doing something inefficient.  (nth being a notable 
exception).

And it’s worth noting that Rich has said nth is “somewhat of a mistake”: 
https://gist.github.com/reborg/dc8b0c96c397a56668905e2767fd697f#why-cannot-last-be-fast-on-vector

(that whole answer is worth reading, in the context of this thread)

Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood


From: clojure@googlegroups.com  on behalf of Mark 
Engelberg 
Sent: Sunday, July 22, 2018 11:41:58 PM
To: clojure
Subject: Re: OK idea to replace conj and cons with "prepend" and "append" 
macros that have consistent behavior and return same types as args?

The book "Simply Scheme" teaches Scheme via a library that lets students do 
things to either the left or right side of the list, even though the operations 
on the right side of the list are inefficient.  That author found it to be more 
intuitive to his students.

But Clojure is geared more towards professional programmers who understand that 
different data structures have different strengths and weaknesses, and who 
prefer to use an API that makes those strengths and weaknesses explicit, rather 
than fooling you into doing something inefficient.  (nth being a notable 
exception).

IMHO, a programming language for professionals will never be the ideal choice 
for beginners, although Clojure is better than most professional languages for 
that purpose.

On Sun, Jul 22, 2018 at 7:29 PM, Christian Seberino 
mailto:cseber...@gmail.com>> wrote:

Just what is it that you want to teach? Principles of computation, or Clojure? 
Not the same. If the former, forget Clojure and give them a week to work thru 
The Little Schemer. Then move on to clojure and the much more complex stuff 
involved.

I think you bring up a good point.
I wonder if we all have one of 2 mental images of what people mean by a 
"Clojure intro class".  Many probably mean something like a real corporate 
class where
people are trying to train developers on Clojure to get real work done.   I 
think more of the SICP/Scheme/MIT class where you have a lot of smart
people with no programming experience and you want to give them a solid 
academic intro.

I agree Scheme is great for that.  However, what I find delicious is that 
Clojure is this >| |<--- close to being *both* a super practical 
language
*and* a better/cleaner teaching language!  This might surprise some but I 
actually think some things are more elegant in Clojure than Scheme!
For example, I like "fn" over "lambda".  Also, I like the seq abstraction over 
nested conses for the fundamental data structure.

cs



--
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.

-- 
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 

Re: OK idea to replace conj and cons with "prepend" and "append" macros that have consistent behavior and return same types as args?

2018-07-23 Thread Moe Aboulkheir
On Mon, Jul 23, 2018 at 3:29 AM, Christian Seberino 
wrote:

>  This might surprise some but I actually think some things are more
> elegant in Clojure than Scheme!
>

Expect these revelations to continue.

-- 
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.