
Chapter 10 The WebScript Language
180
Modern:
function submit() {
// <body>
}
• Method Definition With Arguments
Classic:
- takeValuesFromRequest:(WORequest *)request
inContext:(WOContext *)context {
// <body>
}
Modern:
//Note: no static typing allowed.
function takeValues(fromRequest:= request inContext:= context){
// <body>
}
• Method Invocation — No Argument
Classic:
[self doIt];
Modern:
self.doIt();
• Method Invocation — One Argument
Classic:
[guests addObject:newGuest];
Modern:
guests.addObject(newGuest);
• Method Invocation — Two or More Arguments
Classic:
[guests insertObject:newGuest atIndex:anIndex];
Modern:
guests.insert(object := newGuest, atIndex := anIndex);
Kommentare zu diesen Handbüchern