/[mcclim]/mcclim/coordinates.lisp
ViewVC logotype

Contents of /mcclim/coordinates.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations)
Sat May 31 18:18:43 2003 UTC (10 years, 10 months ago) by gilbert
Branch: MAIN
CVS Tags: McCLIM-0-9, mcclim-0-9-4, McCLIM-0-9-5, McCLIM-0-9-4, McCLIM-0-9-6, McCLIM-0-9-1, McCLIM-0-9-3, McCLIM-0-9-2, HEAD
Changes since 1.5: +27 -3 lines
Took the easy route: I switched COORDINATE to being just REAL in an
attempt to keep McCLIM running using the latest CMUCL. This is however
a questionable thing as it hides the real type errors.
1 ;;; -*- Mode: Lisp; Syntax: Common-Lisp; Package: CLIM-INTERNALS; -*-
2 ;;; --------------------------------------------------------------------------------------
3 ;;; Title: The coordinate Datatype
4 ;;; Created: 1998-12-05 18:06
5 ;;; Author: Gilbert Baumann <unk6@rz.uni-karlsruhe.de>
6 ;;; License: LGPL (See file COPYING for details).
7 ;;; $Id: coordinates.lisp,v 1.6 2003/05/31 18:18:43 gilbert Exp $
8 ;;; --------------------------------------------------------------------------------------
9 ;;; (c) copyright 1998,1999,2003 by Gilbert Baumann
10
11 ;;; This library is free software; you can redistribute it and/or
12 ;;; modify it under the terms of the GNU Library General Public
13 ;;; License as published by the Free Software Foundation; either
14 ;;; version 2 of the License, or (at your option) any later version.
15 ;;;
16 ;;; This library is distributed in the hope that it will be useful,
17 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 ;;; Library General Public License for more details.
20 ;;;
21 ;;; You should have received a copy of the GNU Library General Public
22 ;;; License along with this library; if not, write to the
23 ;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 ;;; Boston, MA 02111-1307 USA.
25
26 (in-package :clim-internals)
27
28 #||
29 (deftype coordinate () 'double-float)
30
31 (defun coordinate (n)
32 "Coerces N to be a coordinate."
33 (declare (type number n))
34 (coerce n 'coordinate))
35
36 (defun coordinate-epsilon ()
37 ;; tweak if you like
38 (* #.(expt 2 10) double-float-epsilon))
39
40 (defun coordinate= (x y)
41 (< (abs (- x y)) (coordinate-epsilon)))
42
43 (defun coordinate<= (x y)
44 (<= (- x y) (coordinate-epsilon)))
45
46 (defun coordinate/= (x y)
47 (not (coordinate= x y)))
48 ||#
49
50 (deftype coordinate () 'real)
51
52 (declaim (inline coordinate))
53 (defun coordinate (n) n)
54
55 (declaim (inline coordinate-epsilon))
56 (defun coordinate-epsilon ()
57 0)
58
59 (declaim (inline coordinate=))
60 (defun coordinate= (x y)
61 (= x y))
62
63 (declaim (inline coordinate<=))
64 (defun coordinate<= (x y)
65 (<= x y))
66
67 (declaim (inline coordinate/=))
68 (defun coordinate/= (x y)
69 (/= x y))
70
71 ;; $Log: coordinates.lisp,v $
72 ;; Revision 1.6 2003/05/31 18:18:43 gilbert
73 ;; Took the easy route: I switched COORDINATE to being just REAL in an
74 ;; attempt to keep McCLIM running using the latest CMUCL. This is however
75 ;; a questionable thing as it hides the real type errors.
76 ;;

  ViewVC Help
Powered by ViewVC 1.1.5