Some feedback from a newbie

57 views
Skip to first unread message

Roger Erens

unread,
Apr 1, 2013, 5:01:14 PM4/1/13
to fp...@googlegroups.com
Hi,

so far I've enjoyed your book very much, thank you for writing it!
There are some remarks I would like to make, maybe you find them useful.

1)
In 1.2 you mention vimclojure. Its author announced recently its discontinued development, and advises to use
fireplace.vim (as the world was not ready for foreplay.vim) instead.

2)
In 1.8 you explain that substitution within a kind of assignment statement does not make sense. Along the explanation, you're mentioning the number 4 out of the blue.
I think it would be clearer to use this code
((fn [n] (assign n (+1 n) (+ n n)) 4)
which illustrates how you would like to use the function. And you might mention that we (have to or want to) substitute all the n's in both forms of the body at the same time. (Since to me the phrase "the two instances of n on the second line have already been substituted away" seemed to me to imply some order in time).

3)
Currently in Light Table Playground 0.1.7 on a mac:  (I used the (use 'clojure.repl) form)
- from 1.10:
'(1 2) appears on the right as '(1 2) instead of (1 2)
(quote (1 2)) appears on the right as (1 2)
- from 1.13:
[(+ 1 1) (- 1 1)] appears on the right as [(+ 1 1) (- 1 1)]
'[inc dec] appears as '[inc dec]
'a appears as 'a

4)
In 1.14 the link to the anti-if campaign made me procrastinate. Can you only show it on April Fool's Day? :-)

5)
In 1.15 the notation for rest arguments is not so clearly shown (the line shows 'args' twice) because in the first example you're illustrating it at the same time how it is used in the first example with an unfamiliar form; also the underlining does not seem to add much (by now in the book, it is quite clear what is the first argument in a list). I would suggest first explaining that
[& args] says "take any arguments after this point and wrap them up in a sequential collection (list, vector, whatever), which is named 'args' here". Then illustrate with an example that has a 'function body' that the reader recognizes from an earlier example, e.g.:
((fn [& args] (prn args)) 1 2 3 4)

6)
In 1.18, the function to try 'remove' is followed by 'and create the function argument with fn' which does not make sense to me

7)
Also in 1.18, the current wordings tricked me into believing that I should call your function 'solver'. I'd suggest changing
"the easiest way to avoid duplication is to create and call a function"
into something like
"the easiest way to avoid duplication is to create functions that accept sequences as arguments":
(def your-function
 (fn [your-sequence]
  (do-something-with your-sequence)
  ...
  (do-something-else-with your-sequence)
  ...))

(your-function [1 2 3 4 5 6 7])

8)
At the end of chapter 2, you define what an object is. It looks as if every object has a dispatch function that decides which function the programmer meant to call. But in Chapter 'Roman I' just preceding chapter 2, you write "A dispatch function selects one of those methods by examining the class of the receiver" which gives me the impression that there's only one, global, dispatch function.

9)
In 3.4, exercise 5:
I'd think that OO-programmers would find it more elegant to feed a function valid-triangle? with a Triangle argument instead of a bunch of Points. So my solution would also involve the function 'vals' which obtains (amongst others) the Points from a Triangle.

Well, that's how far I got at the moment!

Roger

Reply all
Reply to author
Forward
0 new messages