This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

K&B doubt - p371, question about assumption remark

 
Ronald Schild
Ranch Hand
Posts: 117
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy,

I was wondering if the comment "x must be 2" was intended to be a wrong assumption or not, in:



on page 371 in K&B (as x being say, 3, and y being false reaches it). I would have understood it if a later example would have used the snippet with a real assertion ( assert( x == 2) ; ) to prove that the assumption was wrong. But it doesn't, and the example seems to illustrate solely that sometimes we are used to put assumptions in comments.

Just checking, sorry for horrible nitpicking.
[ July 08, 2008: Message edited by: Ronald Schild ]
 
Jelle Klap
Bartender
Posts: 1951
7
Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nice catch
I think the comment merely intends to illustrate that assumptions can be added to the source code in the form of debug comments.
Of course, as you said, the assumption is faulty in this case - and I can't imagine it was meant to be. Seeing as the text following the code snippet never refers back to it in trying to prove the debug comment wrong using the assertion mechanism.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic