smalltalk-tng

view r1/tng.scm @ 321:c4a0718c2d3c

Sketch of dependencies
author Tony Garnock-Jones <tonygarnockjones@gmail.com>
date Sat Oct 08 15:36:03 2011 -0400 (7 months ago)
parents
children
line source
1 ;; ---------------------------------------------------------------------------
2 ;; tng.scm - ThiNG main file. Load this with sdl-csi.
3 ;; ---------------------------------------------------------------------------
5 ;; The following is required because chicken by default has
6 ;; trailing-':' keyword mode, which makes literal symbols that end
7 ;; with ':' behave wrongly. If you don't set the keyword-style to
8 ;; #:none, then you get this:
9 ;;
10 ;; (eq? 'a: (string->symbol "a:")) ==> #f
11 ;;
12 (require 'extras)
14 (load "macros.scm")
15 (require 'util)
16 (require 'oo)
17 (require 'kernel)
18 (require 'parsetng)
19 (require 'compile)
20 (require 'interp)
21 (require 'ui)
22 (require 'image)
24 (reset-primitive-table!)
26 (define boot-image-name "BOOTSTRAP.image")
28 (if (file-exists? boot-image-name)
29 (call-with-input-file boot-image-name
30 (lambda (port)
31 (let ((image (read port)))
32 (deserialize-image! image))))
33 (bootstrap-image!))
35 ;; Be careful not to invoke any methods before the image is prepared!
36 ;; If you turn on debug, and the image-loader or -bootstrapper prints
37 ;; any objects, and the following record-printer is installed, then
38 ;; things break.
39 ;;
40 (define-record-printer (object o out)
41 (display (send/previous-method/missing-handler #f
42 (lambda (argv) "#<OBJECT>")
43 'printString
44 (vector o))
45 out))
47 (metalevel-spawn *nil* (lambda () (metalevel-eval `(send "do" ((ref "BootBlock"))))))
48 (ui-mainloop)
49 (exit 0)