Gary: I'm not sure that's actually what I meant, although I'm not 100% sure 
what you mean so I'm not sure :-). FWIW I *do* always want to introduce "code 
is data" to my beginners, albeit with eval, not macros, and I'm generally not 
on board with the whole concept of restricted teaching languages for the 
contexts in which I teach, although I understand that others find them useful.

Terje: What I mean is just that if you type something like (map inc (range 10)) 
into a REPL you'll get (1 2 3 4 5 6 7 8 9 10), which sure looks like a list but 
is really a lazy sequence. In most cases it doesn't matter, as it behaves as it 
would if it were a list. But sometimes it does matter, e.g. (str '(1 2 3 4 5 6 
7 8 9 10)) => "(1 2 3 4 5 6 7 8 9 10)", whereas (str (map inc (range 10))) => 
"clojure.lang.LazySeq@c5d38b66". I can't recall other specific situations in 
which it matters right now, but usually when I teach a class using Clojure, 
students run into this and are pretty confused. Once they figure out what's 
going on they often think that doall will help, but it doesn't, and I show them 
that they can apply list to the lazy sequence to get a real list. As I said, I 
know this can't change, and it's not the biggest problem in the world. But the 
fact that different kinds of things have identical printed representations is a 
less-than-lovely aspect of the language for beginners, in my experience. One of 
the the few!

 -Lee


> On Feb 26, 2016, at 6:58 AM, Gary Verhaegen <gary.verhae...@gmail.com> wrote:
> 
> On Friday, 26 February 2016, Terje Dahl <te...@terjedahl.no 
> <mailto:te...@terjedahl.no>> wrote:
> Lee.
> 
> About the confusion with parens - do you mean that an output-ed list/seq 
> looks exactly like a callable s-expression?
> Please elaborate.
> 
> Terje
> 
> Yes. If you print the list (1 2 3) it prints as a callable form, and then you 
> have to get into reading, evaluation, etc.
> 
> Aphyr's Clojure tutorial series went there. IIRC the second or third chapter 
> was devoted to that.
> 
> On the other hand, in the Racket curriculum, they define limited subsets of 
> Scheme used as teaching languages; when the student first learns about lists, 
> they construct them using cons and they print as cons forms, i.e. the 
> (in-memory) list '(1 2) would print as
> 
> (cons 1 (cons 2 (cons ())))
> 
> This is the kind of simplifications that are done in the teaching languages 
> and that allow the course to avoid a number of advanced topics in the 
> beginning. It avoids a lot of confusion at the cost of a small lie and an 
> extra effort when you want to introduce macros and the "code is data" idea. 
> (Which you usually don't want to do in an introductory course anyway.)
> 
> For a short (and, I found, very enlightening) peek at the HTDP curriculum, 
> you can skim through the Systematic Program Design course by Gregor Kiczales 
> on edX:
> 
> https://www.edx.org/xseries/how-code-systematic-program-design 
> <https://www.edx.org/xseries/how-code-systematic-program-design>
> 
> This is by a wide margin the best introductory programming course I have ever 
> seen.
> 
> Re: ClojureBridge, the curriculum is on GitHub:
> 
> https://github.com/ClojureBridge/curriculum 
> <https://github.com/ClojureBridge/curriculum>
> 
> -- 
> 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 
> <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 
> <mailto:clojure+unsubscr...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

--
Lee Spector, Professor of Computer Science
Director, Institute for Computational Intelligence
Hampshire College, Amherst, Massachusetts, USA
lspec...@hampshire.edu, http://hampshire.edu/lspector/, 413-559-5352

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