XLISP send-super

Nyquist / XLISP 2.0 - Contents | Tutorials | Examples | Reference

# send-super

Type: | - | function (subr)
Source: | - | xlobj.c

## Syntax

(send-super message [args])
  message - the message selector
  args - the optional message arguments
  returns - the result of sending the message

## Description

The 'send-super' function sends the specified arguments 'args' to the 'message' specified method of the superclass. It is necessary for 'send-super' to be executed from within a method being performed on an object. It will return the result of sending the message. If 'send-super' is performed outside of a method an error will result.

    error: not in a method

## Examples

    (setq a-class (send class :new '()))                       ; create A-CLASS

    (send a-class :answer :show '()                            ; set up special SHOW method
                                '((print "nobody here") self))

    (setq an-obj (send a-class :new))                          ; create AN-OBJ of A-CLASS
    (send an-obj :show)                                        ; prints "nobody here"

    (send a-class :answer :myshow '()                          ; set up MYSHOW method which
                                  '((send-super :show )))      ;   calls :SHOW in superclass

    (send an-obj :myshow)                                      ; prints Object is ...

See the send-super function in the XLISP 2.0 manual.

Back to Top

Nyquist / XLISP 2.0 - Contents | Tutorials | Examples | Reference