By Example - another Clojure introduction wiki page

7 views
Skip to first unread message

Timothy Pratley

unread,
Jan 13, 2009, 9:12:56 AM1/13/09
to Clojure
I've written small wiki article which dives right into the look and
meaning of common Clojure constructs with examples. Personally I find
I learn best by examples and when starting out they were hard to find,
whereas formal descriptions were there but rather cryptic when you
don't understand the context. My intention is to provide an initial
understanding of how programs look, what they mean, and what can be
accomplished because of their features... from which someone would
then move to one of the more complete articles and references.

http://en.wikibooks.org/wiki/Clojure_Programming/By_Example

I hope someone finds it useful :)

Regards,
Tim.

GS

unread,
Jan 13, 2009, 9:12:04 PM1/13/09
to Clojure
That's really good, Tim. I hope you continue with it :) AFAIC, just
about every function in core, set, zip and xml needs to be documented
by example. I'm just not smart enough to read the API docs of a lot
of functions and understand how to use them.

Some efficiency could be gained by demonstrating several functions at
once, clearly labeling them. An example without much thought:

(Heading) map, range

(map sqr (range 1 10 2)) ; after defining sqr

Cheers,
Gavin

e

unread,
Jan 13, 2009, 11:12:45 PM1/13/09
to clo...@googlegroups.com
i know that will be awesome for me.  I just wish clojure.org was the only place I had to go to get stuff like that.  Why not wikify it all there?

Nick Vogel

unread,
Jan 13, 2009, 11:42:51 PM1/13/09
to clo...@googlegroups.com
It is, that article is part of the wiki linked to directly from clojure.org.

e

unread,
Jan 14, 2009, 12:35:07 AM1/14/09
to clo...@googlegroups.com
define "directly"  I clicked on clojure.org.  I don't see the link.  I stared at the page for a good 30 seconds.  I don't see a "links" section. . . . maybe it's there and I'm bad at reading.  Ah it's inline in the getting started dialog.  In my opinion, that wiki link ought to be prominently displayed on the left, maybe even above rationale . . . .in fact, stick the rationale on the wiki page as the preface to the "book" . . . in fact stick the whole page on the wiki page . . . .and at that point why not just have the wiki on clojure.org.  Trust me.  I'm a newby, and Tim is being insightful in making a single, quick reference goto place for information on the subject of clojure . . . .a most curious thing to have be confusing given that there's a website on the topic, clojure.org.

I'm going to memorize clojure.org.  Much harder will it be to memorize, go to clojure.org, then "getting started", then "wiki" . . .and then . . . hmmmmm no link so search what? . .. I dunno, go back to this thread . . .read read . . .ah yes, here it is, "By Example".  So I can search on By Example, or I can find this thread.  finally I'm there.

Not Tim's fault.  And I'm glad he's doing it.  Consider this feedback and opinion.  You are getting a data point on how one person thinks (or fails to think).

e

unread,
Jan 14, 2009, 12:35:35 AM1/14/09
to clo...@googlegroups.com
 . . . that person being me if it wasn't clear :)

e

unread,
Jan 14, 2009, 12:43:57 AM1/14/09
to clo...@googlegroups.com
actually I think I've seen that page before.  I guess I new the way to get there once.

Nick Vogel

unread,
Jan 14, 2009, 1:12:02 AM1/14/09
to clo...@googlegroups.com
It's in the upper right hand corner of the main page.  The stuff on the left seems to be about the language itself, while the links in the upper right reference the various external sources.  I'm the kind of person who explores every nook and cranny of a webpage though so I can't speak for how easily the human eye is drawn there.  As for the wiki itself, I agree that it's not entirely clear right now, but if you look at the pending revisions for the main wiki page, Tim already submitted a revision with a link to his article included, it's just awaiting approval.  

Mark Volkmann

unread,
Jan 14, 2009, 5:11:30 PM1/14/09
to clo...@googlegroups.com
On Tue, Jan 13, 2009 at 8:12 PM, GS <gsin...@gmail.com> wrote:
>
> On Jan 14, 1:12 am, Timothy Pratley <timothyprat...@gmail.com> wrote:
>> I've written small wiki article which dives right into the look and
>> meaning of common Clojure constructs with examples. Personally I find
>> I learn best by examples and when starting out they were hard to find,
>> whereas formal descriptions were there but rather cryptic when you
>> don't understand the context. My intention is to provide an initial
>> understanding of how programs look, what they mean, and what can be
>> accomplished because of their features... from which someone would
>> then move to one of the more complete articles and references.
>>
>> http://en.wikibooks.org/wiki/Clojure_Programming/By_Example
>>
>> I hope someone finds it useful :)
>
> That's really good, Tim. I hope you continue with it :) AFAIC, just
> about every function in core, set, zip and xml needs to be documented
> by example. I'm just not smart enough to read the API docs of a lot
> of functions and understand how to use them.

Someone already started working on documenting every function with an
example. See http://en.wikibooks.org/wiki/Clojure_Programming/Examples/API_Examples.

--
R. Mark Volkmann
Object Computing, Inc.

e

unread,
Jan 14, 2009, 11:31:03 PM1/14/09
to clo...@googlegroups.com
example's of API isn't the same as real, known, problems and how to solve them in clojure.  Like my merge sort problem before.  I think the last post there of the loop/recur and how it's better than the with-local-vars version . . .and what leaking is about how it's not really recursion is all good stuff.  That was the culmination of my first lesson.  That and how merge used conditionals . . .and maybe a few other merge implementations ...

It's a great idea to take CS beginner problems that most have seen and can understand . . .and transform to clojure.

Next I want to do quicksort, but not the cheasy way they show in Haskell intros where the partition isn't in place.  I wanna know what the persistent analog is to doing that right.  I saw the Haskell one and it was NUTS!!!!!!.  The guy has real dedication.  check it out: http://augustss.blogspot.com/2007/08/quicksort-in-haskell-quicksort-is.html
Reply all
Reply to author
Forward
0 new messages