Next Previous Up Top Contents Index

1.3 The core of the common extensions

define function

Definition macro

Summary

Defines a constant binding in the current module and initializes it to a new function.

Macro call

define {adjective}* function name parameter-list 
  [ body ] 
end [ function ] [ name ]

Arguments

adjective
A Dylan unreserved-namebnf.

name
A Dylan variable-namebnf.

parameter-list
A Dylan parameter-listbnf.

body
A Dylan bodybnf.

Library

dylan

Module

dylan

Description

Creates a constant module binding with the name name, and initializes it to a new function described by parameter-list, options, and any adjectives.

The adjectives permitted depend on the implementation.

The parameter-list describes the number and types of the function's arguments and return values. It is an error to supply #next in the parameter list, and there is no implicit #next parameter.

Operations

The following functions return the same values as they would if the function had been defined as a bare method with the same signature:

  function-specializers 
  function-arguments 
  function-return-values 

Calling some of the following reflective operations on a function defined with define function may be an error:

  generic-function-methods
  add-method
  generic-function-mandatory-keywords
  sorted-applicable-methods
  find-method
  remove-method
  applicable-method?

Common Dylan and Functional Extensions - 31 Mar 00

Next Previous Up Top Contents Index