Amazon.com Widgets Page 151 - declaration vs. definition
Welcome, Guest. Please login or register.
Did you miss your activation email?
October 21, 2014, 04:57:29 AM
Home Help Search chat Login Register 
News: Read this please.The Great Kangaroo Escape Looking for reviews of the 4th ed on Amazon!   Twitter:  @skochan
                     

+ Official Forum for Programming in Objective-C (the iPhone Programming Language) - Stephen Kochan
|-+ Old Stuff
| |-+ Errata
| | |-+ 5th printing
| | | |-+ Page 151 - declaration vs. definition
Pages: [1] Go Down
Print
Author Topic: Page 151 - declaration vs. definition (Read 1062 times)
davej
Newbie
*
Posts: 9






on: May 18, 2009, 10:28:11 AM

At the top of page 151, after the code, the first line of text reads "The first line of your method definition is this:", which is followed by the code snippet:

Code: (Objective-C)
-(Fraction *) add: (Fraction *) f;

but isn't that technically the method declaration? Am I correct in my understanding that if it is the first line in the method definition it should not have the semicolon at the end?

BTW, this chapter was great, but I must admit, a little scary, too: there was a LOT of stuff that felt pretty important packed into a small space. It's going to be a real challenge to absorb it all and keep it in mind...but that's all part of the fun of programming, I guess!

Again, really enjoying the book.

--Dave--
Logged
skochan
Administrator
Hero Member
*****
Posts: 3114







Reply #1 on: May 18, 2009, 10:40:38 AM

Dave,

Yes, you're right.  It should not have the semicolon there, as per the method definition.  BTW, I don't know if I remained consistent with my use of the word "definition" vs. "declaration" in the text  as far following a strict interpretation of the those terms; I didn't want to get the reader bogged down with the terminology.  With that said, please let me know if you discover any other inconsistencies.

Cheers,

Steve Kochan
Logged
Pages: [1] Go Up
Print
Jump to:



Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Entire forum contents (c) 2009 classroomM.com. All rights reserved.