1#| -*-Scheme-*-
2
3Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
4    1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
5    2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Massachusetts
6    Institute of Technology
7
8This file is part of MIT/GNU Scheme.
9
10MIT/GNU Scheme is free software; you can redistribute it and/or modify
11it under the terms of the GNU General Public License as published by
12the Free Software Foundation; either version 2 of the License, or (at
13your option) any later version.
14
15MIT/GNU Scheme is distributed in the hope that it will be useful, but
16WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18General Public License for more details.
19
20You should have received a copy of the GNU General Public License
21along with MIT/GNU Scheme; if not, write to the Free Software
22Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,
23USA.
24
25|#
26
27(load-option 'CREF)
28
29(if (not (name->package '(EDWIN)))
30    (let ((package-set (package-set-pathname "edwin")))
31      (if (not (file-exists? package-set))
32	  (cref/generate-trivial-constructor "edwin"))
33      (construct-packages-from-file (fasload package-set))))
34
35(if (lexical-unreferenceable? (->environment '(EDWIN CLASS-CONSTRUCTOR))
36			      'CLASS-DESCRIPTORS)
37    (begin
38      (let ((sf-and-load
39	     (lambda (files package)
40	       (fluid-let ((sf/default-syntax-table (->environment '())))
41		 (sf-conditionally files))
42	       (for-each (lambda (file)
43			   (load (string-append file ".bin") package))
44			 files))))
45	(sf-and-load '("macros") '(EDWIN MACROS))
46	(sf-and-load '("clsmac") '(EDWIN CLASS-MACROS))
47	(sf-and-load '("xform")
48		     '(EDWIN CLASS-MACROS TRANSFORM-INSTANCE-VARIABLES))
49	(sf-and-load '("class") '(EDWIN))
50	(sf-and-load '("clscon") '(EDWIN CLASS-CONSTRUCTOR)))))
51
52(let ((read-class-definitions
53       (lambda (filename)
54	 (if (environment-bound? system-global-environment 'with-notification)
55	     (with-notification
56		 (lambda (port)
57		   (write-string "Pre-loading class definitions from " port)
58		   (write filename port))
59	       (lambda ()
60		 (syntax* (read-file (string-append filename ".scm"))
61			  (->environment '(EDWIN WINDOW)))))
62	     (begin
63	       (fresh-line)
64	       (write-string "Pre-loading class definitions from ")
65	       (write filename)
66	       (syntax* (read-file (string-append filename ".scm"))
67			(->environment '(EDWIN WINDOW)))
68	       (write-string " -- done")
69	       (newline))))))
70  (read-class-definitions "window")
71  (read-class-definitions "utlwin")
72  (read-class-definitions "modwin")
73  (read-class-definitions "bufwin")
74  (read-class-definitions "comwin")
75  (read-class-definitions "buffrm")
76  (read-class-definitions "edtfrm"))
77
78(load "decls")
79
80(cref/generate-constructors "edwin" 'ALL)
81(sf-conditionally "edwin.ldr")