src/swipl-devel/packages/xpce/man/refmanual/md/behaviour.md

class behaviour {#class-behaviour}

Behaviour is an super-class of class method and class variable, the classes than can define behaviour at the class level. Class behaviour itself has few properties, but sharing these simplifies and speeds up message passing.

The sub-classes class send_method, class get_method and class variable all define the methods ->send and <-get which executes them in a send- or get operation. Sending a message to an object is thus realised using:

send(Object, Selector, Arg ...) :-
    get(Object, send_method, Selector,
        tuple(Receiver, Behaviour)),
    send(Behaviour, send, Receiver, Args ...)

(Pseudo code; Prolog cannot handle Arg ...)

@see class interceptor @see class object @see class class

Instance variables {#class-behaviour-instvars}



Try the rswipl package in your browser

Any scripts or data that you put into this service are public.

rswipl documentation built on June 16, 2026, 5:07 p.m.