PCE version 4C man_modulenamespaceid_tablemodified current_idOIxN class/whenN referenceC hash_tablerefersizeOIxaIsN V.when.elseCman_variable_card identifiermodule last_modifiednamesummary descriptionsee_alsoinheritdefaultsOIxN V.when.elseRICdateOIx,„mNelsenCstringOIxÖEither of <-then or <-else is evaluated depending on the result of testing <-condition. If this slot contains a function, this function is evaluated and the result returned. Otherwise the plain value is returned.nnnsNC.whenCman_class_card identifiermodule last_modifiednamesummary descriptionsee_alsoinherituser_interfacebugsOIxNC.whenRIOIx,„l˜NwhennOIxëWhen executed, a when object tests the condition and then evaluates either the then- or else-function, returning its result. The example below illustrates how a method `number <-absolute' could be attached to class number to return its absolute value: ?- send(class(number), get_method, get_method(absolute, int, new(vector), when(@receiver < 0, -(@receiver), @receiver?value))). ?- new(N, number(-4)), get(N, absolute, V). ==> V = 4.CchainsizeOI xIEN$class/if$C.ifXnnnsN V.when.thenOI xN V.when.thenRIOI x,„lÂNthennnnOI xIEN V.when.elseXnXuCnumberOI xx