--- Begin Message ---

Correct. This is a exercism task.

and yes, there are no variables given but that does not in my oponion means that I cannot add a instance or a class variable I myself was thinking about adding two instance variables named digits which hold the first 9 characters and a variable named controlDigit

Can I do it then this way

1) Check if the string is empty , if so return false otherwise made a new object like this in IsValidIsbn

isValidIsbn: aString
    if aString isEmpty
      ifTrue: [False]
     ifFalse: [ self new
                         digits := something.
                         controlDigit := something.]


I can also do what I think you are describing

isValidIsbn: AString
    if aString isEmpty
       ifTrue: [ ^false]
       ifFalse: [ISBN isValidIsbn10]

and then as you describe so have a isValidISBN10 method in the class side where I  do the check there so  the class ISBN has the two instance variables digits and controlDigit

Roelof







--- End Message ---

Reply via email to