beautypg.com

Apple WebObjects 3.5 User Manual

Page 180

background image

Chapter 10

The WebScript Language

180

Modern:

function submit() {

//

}

Method Definition With Arguments

Classic:

- takeValuesFromRequest:(WORequest *)request

inContext:(WOContext *)context {

//

}

Modern:

//Note: no static typing allowed.
function takeValues(fromRequest:= request inContext:= context){

//

}

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);