Changes between Version 11 and Version 12 of AppleCurrencyConverterWritingLisp


Ignore:
Timestamp:
Jan 19, 2008, 3:52:42 PM (12 years ago)
Author:
mikel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AppleCurrencyConverterWritingLisp

    v11 v12  
    4949The syntax #/convertCurrency:atRate: uses the "#/" reader macro to read a symbol with case preserved, so that you can see in your code the same name that Objective-C uses for the method, without worrying about how the name might be converted between Lisp and Objective-C naming conventions.
    5050
    51 The number of arguments to an Objective-C method is the number of colons in the name, plus one. Each colon indicates an argument, and there is always an extra "self" argument that refers to the object that receives the message. These are normal Objective-C conventions, but we perhaps need to emphasize the details, since we are using Lisp code to call the Objective-C methods.
     51The number of arguments to an Objective-C method is the number of colons in the name, plus one. Each colon indicates an argument, and there is always an extra "self" argument that refers to the object that receives the message. The "self" argument is implicit in Objective-C definitions, but it's just another argument in the Lisp code.
     52
     53We indicate the return type and the types of arguments in the method definition by surrounding parameters and the method name with parentheses, and appending the type name. Thus, for example,
     54
     55{{{
     56(#/convertCurrency:atRate: :float)
     57}}}
    5258
    5359