Changes between Version 10 and Version 11 of AppleCurrencyConverterWritingLisp


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

--

Legend:

Unmodified
Added
Removed
Modified
  • AppleCurrencyConverterWritingLisp

    v10 v11  
    4343}}}
    4444
    45 This is the method that actually does the currency conversion. It's very simple—really, it just multiples currency times rate. Most of the text in the definition is Objective C bridge code that links the definition to the right class with the right argument and return types.
     45This is the method that actually does the currency conversion. It's very simple--really, it just multiples currency times rate. Most of the text in the definition is Objective C bridge code that links the definition to the right class with the right argument and return types.
     46
     47objc:defmethod is a version of DEFMETHOD that creates Objective C method definitions.
     48
     49The 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.
     50
     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. 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.
     52
     53
    4654
    4755[AppleCurrencyConverter Start] [AppleCurrencyConverterCreatingaLispFile Previous]