/[rdnzl]/RDNZL/specials.lisp
ViewVC logotype

Contents of /RDNZL/specials.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations)
Thu Aug 10 15:36:47 2006 UTC (7 years, 8 months ago) by eweitz
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +2 -1 lines
Sync with 10.1.2
1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: RDNZL; Base: 10 -*-
2 ;;; $Header: /tiger/var/lib/cvsroots/rdnzl/RDNZL/specials.lisp,v 1.6 2006/08/10 15:36:47 eweitz Exp $
3
4 ;;; Copyright (c) 2004-2006, Dr. Edmund Weitz. All rights reserved.
5
6 ;;; Redistribution and use in source and binary forms, with or without
7 ;;; modification, are permitted provided that the following conditions
8 ;;; are met:
9
10 ;;; * Redistributions of source code must retain the above copyright
11 ;;; notice, this list of conditions and the following disclaimer.
12
13 ;;; * Redistributions in binary form must reproduce the above
14 ;;; copyright notice, this list of conditions and the following
15 ;;; disclaimer in the documentation and/or other materials
16 ;;; provided with the distribution.
17
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
30 ;;; Global special variables (and constants) used by RDNZL.
31
32 (in-package :rdnzl)
33
34 #+:sbcl
35 (defmacro defconstant (name form &optional documentation)
36 ;; see <http://www.sbcl.org/manual/Defining-Constants.html>
37 `(cl:defconstant ,name
38 (cond ((boundp ',name) (symbol-value ',name))
39 (t ,form))
40 ,@(and documentation (list documentation))))
41
42 (defvar *used-namespaces* nil
43 "A list of namespaces which are `used.' See USE-NAMESPACE and
44 related functions.")
45
46 (defvar *dll-initialized* nil
47 "Whether RDNZL.dll was initialized with DllEnsureInit.")
48
49 (defconstant +private-assembly-name+ "RDNZLPrivateAssembly"
50 "The name of the assembly which is generated at run time to create
51 subtypes of DelegateAdapter.")
52
53 (defvar *callback-counter* 0
54 "The index of the last closure from which a delegate was created -
55 or 0 if no delegate has been created yet. Used as a key in the
56 *CALLBACK-HASH* hash table.")
57
58 (defvar *callback-hash* (make-hash-table)
59 "A hash table which maps integers to closures used as delegates -
60 see the instance variable indexIntoLisp in DelegateAdapter.cpp.")
61
62 (defvar *delegate-counter* 0
63 "Counter used to make sure each subtype of DelegateAdapter has a
64 unique name.")
65
66 (defvar *signature-hash* (make-hash-table :test #'equal)
67 "A hash table which maps delegate signatures to subtypes of
68 DelegateAdapter so that we only create one such subtype for each
69 signature.")
70
71 (defvar *type-hash* (make-hash-table :test #'equal)
72 "A hash table which maps short type names of `imported' types to
73 fully qualified type names \(or to T if the type can be retrieved by
74 Type::GetType without a fully qualified name).")
75
76 (defvar *direct-definitions* (make-hash-table :test #'equal)
77 "Maps function names \(for direct calls) to data structures which
78 can be used to re-construct the function.")
79
80 (defconstant +whitespace-char-list+
81 '(#\Space #\Tab #\Linefeed #\Newline #\Return #\Page)
82 "A list of all characters which are considered to be whitespace.")
83
84 (defvar *previous-readtables* nil
85 "A stack which holds the previous readtables that have been pushed
86 here by ENABLE-RDNZL-SYNTAX.")
87
88 (defvar *coerce-double-floats-to-single* nil
89 "If this is true, then BOX will convert a Lisp DOUBLE-FLOAT
90 value to System.Single. This is mainly interesting for
91 LispWorks, where Lisp floats are always DOUBLE-FLOAT.")
92
93 (pushnew :rdnzl *features*)
94
95 ;; stuff for Nikodemus Siivola's HYPERDOC
96 ;; see <http://common-lisp.net/project/hyperdoc/>
97 ;; and <http://www.cliki.net/hyperdoc>
98 ;; also used by LW-ADD-ONS
99
100 (defvar *hyperdoc-base-uri* "http://weitz.de/rdnzl/")
101
102 (let ((exported-symbols-alist
103 (loop for symbol being the external-symbols of :rdnzl
104 collect (cons symbol
105 (concatenate 'string
106 "#"
107 (string-downcase symbol))))))
108 (defun hyperdoc-lookup (symbol type)
109 (declare (ignore type))
110 (cdr (assoc symbol
111 exported-symbols-alist
112 :test #'eq))))

  ViewVC Help
Powered by ViewVC 1.1.5