From mantoniotti at common-lisp.net Sun Mar 6 15:29:36 2011 From: mantoniotti at common-lisp.net (mantoniotti) Date: Sun, 06 Mar 2011 10:29:36 -0500 Subject: [definer-cvs] CVS definer Message-ID: Update of /project/definer/cvsroot/definer In directory cl-net:/tmp/cvs-serv9292 Modified Files: definer-pkg.lisp definer.system Added Files: COPYING definer.asd Log Message: Adde files COPYING and .asd. Edited and updated the package and system. --- /project/definer/cvsroot/definer/definer-pkg.lisp 2004/04/22 18:05:06 1.1.1.1 +++ /project/definer/cvsroot/definer/definer-pkg.lisp 2011/03/06 15:29:36 1.2 @@ -2,7 +2,7 @@ ;;; definer-pkg.lisp -- -;;; Copyright (c) 2003-2004 Marco Antoniotti, All rigths reserved. +;;; Copyright (c) 2003-2011 Marco Antoniotti, All rigths reserved. ;;; ;;; Permission to use, modify, and redistribute this code is hereby ;;; granted. @@ -11,7 +11,7 @@ (defpackage "NET.NTUNIOTT.CL.EXT.SYNTAX.DEFINER" (:use "COMMON-LISP") - (:nicknames "CL.EXT.SYNTAX.DEFINER" "DEFINER") + (:nicknames "CL.EXT.SYNTAX.DEFINER" "DEFINER" #-lispworks "DEF") (:export "DEF" "BUILD-DEFINITION-FORM") --- /project/definer/cvsroot/definer/definer.system 2004/04/22 18:10:23 1.1 +++ /project/definer/cvsroot/definer/definer.system 2011/03/06 15:29:36 1.2 @@ -1,10 +1,13 @@ -;;; -*- Mode: Lisp -*- +;;;; -*- Mode: Lisp -*- -;;; definer.system -- +;;;; definer.system -- +;;;; +;;;; See the file COPYING for license and copying information. (mk:defsystem "DEFINER" + :author "Marco Antoniotti" :components ("definer-pkg" "definer")) -;;; end of file -- definer.system -- +;;;; end of file -- definer.system -- --- /project/definer/cvsroot/definer/COPYING 2011/03/06 15:29:36 NONE +++ /project/definer/cvsroot/definer/COPYING 2011/03/06 15:29:36 1.1 Copyright (c) 2003-2011 Marco Antoniotti All rights reserved. Permission is hereby granted, without written agreement and without license or royalty fees, to use, copy, modify, and distribute this software and its documentation for any purpose, provided that the above copyright notice and the following two paragraphs appear in all copies of this software. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE AUTHOR(S), HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE AUTHOR(S) UNIVERSITY, COMPANY AND/OR AFFILIATION SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE AUTHOR(S) HAVE NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --- /project/definer/cvsroot/definer/definer.asd 2011/03/06 15:29:36 NONE +++ /project/definer/cvsroot/definer/definer.asd 2011/03/06 15:29:36 1.1 ;;;; -*- Mode: Lisp -*- ;;;; definer.asd -- ;;;; ;;;; See the file COPYING for license and copying information. (asdf:defsystem "DEFINER" :author "Marco Antoniotti" :components ((:file "definer-pkg") (:file "definer" :depends-on ("definer-pkg"))) ) ;;;; end of file -- definer.asd -- From mantoniotti at common-lisp.net Sun Mar 6 15:51:47 2011 From: mantoniotti at common-lisp.net (mantoniotti) Date: Sun, 06 Mar 2011 10:51:47 -0500 Subject: [definer-cvs] CVS definer/docs Message-ID: Update of /project/definer/cvsroot/definer/docs In directory cl-net:/tmp/cvs-serv14840/docs Log Message: Directory /project/definer/cvsroot/definer/docs added to the repository From mantoniotti at common-lisp.net Sun Mar 6 15:51:47 2011 From: mantoniotti at common-lisp.net (mantoniotti) Date: Sun, 06 Mar 2011 10:51:47 -0500 Subject: [definer-cvs] CVS definer/docs/html Message-ID: Update of /project/definer/cvsroot/definer/docs/html In directory cl-net:/tmp/cvs-serv14840/docs/html Log Message: Directory /project/definer/cvsroot/definer/docs/html added to the repository From mantoniotti at common-lisp.net Sun Mar 6 15:52:45 2011 From: mantoniotti at common-lisp.net (mantoniotti) Date: Sun, 06 Mar 2011 10:52:45 -0500 Subject: [definer-cvs] CVS definer/docs/html/images Message-ID: Update of /project/definer/cvsroot/definer/docs/html/images In directory cl-net:/tmp/cvs-serv14889/docs/html/images Log Message: Directory /project/definer/cvsroot/definer/docs/html/images added to the repository From mantoniotti at common-lisp.net Sun Mar 6 15:55:55 2011 From: mantoniotti at common-lisp.net (mantoniotti) Date: Sun, 06 Mar 2011 10:55:55 -0500 Subject: [definer-cvs] CVS definer/docs/html Message-ID: Update of /project/definer/cvsroot/definer/docs/html In directory cl-net:/tmp/cvs-serv15006/docs/html Added Files: bdf.html def.html index.html main.css Log Message: Added documentation tree. --- /project/definer/cvsroot/definer/docs/html/bdf.html 2011/03/06 15:55:55 NONE +++ /project/definer/cvsroot/definer/docs/html/bdf.html 2011/03/06 15:55:55 1.1 DEFINER: BUILD-DEFINITION-FORM
Common Lisp Extension: DEFINER
 

Generic function BUILD-DEFINITION-FORM

Syntax:

  build-definition-form what name definition-forms &optional prefix-options
  => <undefined>
  

Arguments and Values:

what---a symbol, or some structured object, e.g. a cons

name---a symbol, or some structured object, e.g. a cons

definition-forms---a compound form

Description:

Constructs the underlying CL, or other library, definition form based on the arguments received.

The methods of this generic function are called by the DEF macro to perform the eventual expansion of the definition.

The optional parameter prefix-options can be used to pass around extra information - usually, but not necessarily, in the form of a list of symbols - when what, or name is a structured, non-symbol, object.

Examples:

A few simple examples are the following.

  • Definitions corresponding to defvar, defparameter, and defconstant
      (defmethod build-definition-form ((what (eql 'var))
                                        (name symbol)
                                        definition-forms
                                        &optional prefix-options)
         `(defvar ,name , at definition-forms))
      
      (defmethod build-definition-form ((what (eql parameter))
                                        (name symbol)
                                        definition-forms
                                        &optional prefix-options)
         `(deparameter ,name , at definition-forms))
      
      (defmethod build-definition-form ((what (eql 'constant))
                                        (name symbol)
                                        definition-forms
                                        &optional prefix-options)
         `(defconstant ,name , at definition-forms))
      
  • The definition for the special indicator definer; cfr. the description for DEF.
      (defmethod build-definition-form ((what (eql 'definer))
    				    (for-what symbol)
    				    definition-forms
    				    &optional prefix-options)
        (destructuring-bind ((&key
    			  ((:type-of-naming-form name-type) 'symbol) ; Non evaluated
    			  ((:name name-var) 'name)                   ; Non evaluated
    			  ((:body-name def-form-var) 'definition-forms) ; Non evaluated
    			  )
    			 &body definer-forms)
    	definition-forms
          `(defmethod build-definition-form ((what (eql ',for-what))
    					 (,name-var ,name-type)
    					 ,def-form-var
    					 &optional prefix-options)
    	 , at definer-forms)))
      

Side Effects:

User caused.

Affected By:

None.

Exceptional Situations:

Environment dependent.

 
 
--- /project/definer/cvsroot/definer/docs/html/def.html 2011/03/06 15:55:55 NONE +++ /project/definer/cvsroot/definer/docs/html/def.html 2011/03/06 15:55:55 1.1 DEFINER: DEF
Common Lisp Extension: DEFINER
 

Macro DEF

Syntax:

General form:

  def what name &rest definition-forms
  => <undefined>
  

Special definer form:

  def definer what (&key type-of-naming-form name body-name) &body definer-forms
  => <undefined>
  

Arguments and Values:

Simple DEF form:

what---a symbol, a cons, or the symbol definer

name---a symbol or a cons

definition-forms---a compound form

Special DEF DEFINER form:

what---a symbol, a cons, or the symbol definer

type-of-naming-form---the symbol symbol, or the symbol cons (or some other type specifier); the default is SYMBOL

name---a symbol that is used within the body definer-forms to retrieve the name of the object being defined; the default is the symbol name

body-name---a symbol that is used within the body definer-forms to retrieve the actual definition forms for the definer; the default is the symbol definition-forms

definer-forms---a compound form

Description:

Calls the appropriate CL definition form, or a user definition form built by a specialized call to BUILD-DEFINITION-FORM.

what is a symbol or a cons which directs the underlying form builder code in a method of BUILD-DEFINITION-FORM to produce the appropriate result.

name is a symbol or a cons which can be processed to produce the actual name of the obejct being defined.

The actual contents of definition-forms depend on what is being defined.

Using the definer indicator

what can be the predefined symbol definer. In this case the DEF macro behaves as follows. A BUILD-DEFINITION-FORM method on name is defined. The keyword parameters that can be passed to the DEF are meant to ease the writing of definer-forms.

type-of-naming-form is used in a DECLARE form to aid the compiler. name-var is a symbol that is used within the body definer-forms to retrieve the name of the object being defined. body-name is a symbol that is used within the body definer-forms to retrieve the actual definition forms for the definer.

Examples:

See the main page.

Side Effects:

name is defined as a what in the environment. what is defined depends on the current set of methods for the generic function BUILD-DEFINITION-FORM.

Affected By:

None.

Exceptional Situations:

Environment dependent.

 
 
--- /project/definer/cvsroot/definer/docs/html/index.html 2011/03/06 15:55:55 NONE +++ /project/definer/cvsroot/definer/docs/html/index.html 2011/03/06 15:55:55 1.1 DEFINER: A COMMON LISP Extension
Common Lisp Extension: DEFINER