diff -urN curl-orig/Makefile curl-mine/Makefile
--- curl-orig/Makefile	2003-01-08 18:31:05.000000000 +0100
+++ curl-mine/Makefile	2003-04-26 18:46:21.000000000 +0200
@@ -1,8 +1,8 @@
-LISP	:= cmucl
+LISP	:= /usr/bin/lisp
 all: compiled
 
 compiled:
-	$(LISP) -load "init.lisp" -eval "(progn(curl::compile-curl)(quit))"
+	$(LISP) -noinit -load "init.lisp" -eval "(progn(curl::compile-curl)(quit))"
 
 test-cur.o: test-cur.c
 	$(CC) -c test-cur.c -o test-cur.o
diff -urN curl-orig/curl-funcs.lisp curl-mine/curl-funcs.lisp
--- curl-orig/curl-funcs.lisp	2003-01-08 18:31:05.000000000 +0100
+++ curl-mine/curl-funcs.lisp	2003-04-26 20:05:30.000000000 +0200
@@ -15,7 +15,7 @@
 ;; Perform an ACS (Alternate Character Set) lookup.
 
 (defun map-acs (x)
-  (alien:deref %acs_map (char-code x)))
+  (deref %acs_map (char-code x)))
 
 ;; shutdown and restore tty
 
diff -urN curl-orig/curl-types.lisp curl-mine/curl-types.lisp
--- curl-orig/curl-types.lisp	2003-01-08 18:31:05.000000000 +0100
+++ curl-mine/curl-types.lisp	2003-04-26 19:38:35.000000000 +0200
@@ -3,9 +3,6 @@
 ;;
 (in-package "CURL")
 
-(use-package "ALIEN")
-(use-package "C-CALL")
-
 ;; refer to curses.h
 (def-alien-type chtype unsigned-long)
 (def-alien-type attrtype chtype)
diff -urN curl-orig/curl.asd curl-mine/curl.asd
--- curl-orig/curl.asd	1970-01-01 01:00:00.000000000 +0100
+++ curl-mine/curl.asd	2003-04-26 20:33:04.000000000 +0200
@@ -0,0 +1,15 @@
+(defpackage :curl-system
+  (:use asdf cl))
+
+(in-package :curl-system)
+
+(asdf:defsystem curl
+   :components ((:file "exports")
+		(:file "curl-types" :depends-on ("exports"))
+		(:file "curses-lib" :depends-on ("exports" "curl-types"))
+		(:file "curl-funcs" :depends-on ("exports" "curses-lib"))
+		(:file "curl-constants" :depends-on ("exports"))
+		(:file "cursed-tty" :depends-on ("exports"))
+		(:file "curl-screen" :depends-on ("exports"))
+		(:file "test" :depends-on ("exports"))))
+   
\ No newline at end of file
diff -urN curl-orig/curses-lib.lisp curl-mine/curses-lib.lisp
--- curl-orig/curses-lib.lisp	2003-01-08 18:31:05.000000000 +0100
+++ curl-mine/curses-lib.lisp	2003-04-26 20:11:02.000000000 +0200
@@ -4,37 +4,44 @@
 
 (in-package "CURL")
 
+;;; compatibility macro for sbcl/cmucl compliance
+(defmacro curl-def-alien-variable (&rest args)
+  `(#+cmu def-alien-variable
+   #+sbcl define-alien-variable ,@args))
+(defmacro curl-def-alien-routine (&rest args)
+  `(#+cmu def-alien-routine
+   #+sbcl define-alien-routine ,@args))
 ;; curses variables
 
 ;; The table of ACS mappings. Just guessing the array length.
 
-(def-alien-variable ("acs_map" %acs_map) (array (unsigned 32) 127))
+(curl-def-alien-variable ("acs_map" %acs_map) (array (unsigned 32) 127))
 
-(def-alien-variable ("LINES" %screen_lines) int)
-(def-alien-variable ("COLS" %screen_cols) int)
+(curl-def-alien-variable ("LINES" %screen_lines) int)
+(curl-def-alien-variable ("COLS" %screen_cols) int)
 
 ;; Return the baudrate of the associated terminal
 
-(def-alien-routine ("baudrate" %baudrate) int
+(curl-def-alien-routine ("baudrate" %baudrate) int
   )
 
 ;; Sounds audible alert, fall back to visual (flash) if unavailable.
 ;
-(def-alien-routine ("beep" %beep) int
+(curl-def-alien-routine ("beep" %beep) int
   )
 
 ;; Terminal supports redefinable color set
 
-(def-alien-routine ("can_change_color" %can-change-color) boolean
+(curl-def-alien-routine ("can_change_color" %can-change-color) boolean
   )
 
-(def-alien-routine ("cbreak" %cbreak) int)
+(curl-def-alien-routine ("cbreak" %cbreak) int)
 
-(def-alien-routine ("clearok" %clearok) int
+(curl-def-alien-routine ("clearok" %clearok) int
   (target cwindow-ptr :in)
   (flag boolean :in))
 
-(def-alien-routine ("copywin" %copywin) int
+(curl-def-alien-routine ("copywin" %copywin) int
   (target cwindow-ptr :in)
   (destination cwindow-ptr :in)
   (sminrow int :in)
@@ -46,170 +53,170 @@
   (overlay int :in))
 
 ;
-(def-alien-routine ("curs_set" %curs_set) int
+(curl-def-alien-routine ("curs_set" %curs_set) int
   (visibility integer :in))
 
-(def-alien-routine ("delwin" %delwin) int
+(curl-def-alien-routine ("delwin" %delwin) int
   (target cwindow-ptr :in))
 
-(def-alien-routine ("derwin" %derwin) cwindow-ptr
+(curl-def-alien-routine ("derwin" %derwin) cwindow-ptr
   (parent cwindow-ptr :in)
   (nline int :in)
   (ncols int :in)
   (begin_y int :in)
   (begin_x int :in))
 
-(def-alien-routine ("doupdate" %doupdate) int)
+(curl-def-alien-routine ("doupdate" %doupdate) int)
 
-(def-alien-routine ("dupwin" %dupwin) cwindow-ptr
+(curl-def-alien-routine ("dupwin" %dupwin) cwindow-ptr
   (target cwindow-ptr :in))
 
-(def-alien-routine ("echo" %echo) int)
+(curl-def-alien-routine ("echo" %echo) int)
 
 ;; release window storage, restore terminal settings.
 
-(def-alien-routine ("endwin" %endwin) int
+(curl-def-alien-routine ("endwin" %endwin) int
   )
 
-(def-alien-routine ("erasechar" %erasechar) char
+(curl-def-alien-routine ("erasechar" %erasechar) char
   )
 
-(def-alien-routine ("filter" %filter) void
+(curl-def-alien-routine ("filter" %filter) void
   )
 
 ;; Visual alert, fall back to audible if unavailable.
 
-(def-alien-routine ("flash" %flash) int
+(curl-def-alien-routine ("flash" %flash) int
   )
 
-(def-alien-routine ("flushinp" %flushinp) int
+(curl-def-alien-routine ("flushinp" %flushinp) int
   )
 
 ;; Determines terminal type and initializes curses structures. First
 ;; routine to call in most cases.
 
-(def-alien-routine ("initscr" %initscr)
+(curl-def-alien-routine ("initscr" %initscr)
   cwindow-ptr)
 
-(def-alien-routine ("keyname" %keyname) c-string)
+(curl-def-alien-routine ("keyname" %keyname) c-string)
 
-(def-alien-routine ("keypad" url-keypad) int
+(curl-def-alien-routine ("keypad" url-keypad) int
   (win cwindow-ptr :in)
   (enabled boolean :in))
 
-(def-alien-routine ("halfdelay" %halfdelay) int
+(curl-def-alien-routine ("halfdelay" %halfdelay) int
   (tenths int :in))
 
-(def-alien-routine ("has_colors" %has-colors) boolean)
+(curl-def-alien-routine ("has_colors" %has-colors) boolean)
 
-(def-alien-routine ("has_ic" %has-ic) int)
+(curl-def-alien-routine ("has_ic" %has-ic) int)
 
-(def-alien-routine ("has_il" %has-il) int)
+(curl-def-alien-routine ("has_il" %has-il) int)
 
-(def-alien-routine ("idcok" %idcok) void
+(curl-def-alien-routine ("idcok" %idcok) void
   (win cwindow-ptr :in)
   (enable boolean :in))
 
-(def-alien-routine ("idlok" %idlok) int
+(curl-def-alien-routine ("idlok" %idlok) int
   (win cwindow-ptr :in)
   (enable boolean :in))
 
-(def-alien-routine ("immedok" %immedok) void
+(curl-def-alien-routine ("immedok" %immedok) void
   (win cwindow-ptr :in)
   (enable boolean :in))
 
-(def-alien-routine ("init_color" %init-color) int
+(curl-def-alien-routine ("init_color" %init-color) int
   (color short :in)
   (r short :in)
   (g short :in)
   (b short :in))
 
-(def-alien-routine ("init_pair" %init-pair) int
+(curl-def-alien-routine ("init_pair" %init-pair) int
   (pair short :in)
   (f short :in)
   (b short :in))
 
-(def-alien-routine ("intrflush" %intrflush) int
+(curl-def-alien-routine ("intrflush" %intrflush) int
   (win cwindow-ptr :in)
   (enable boolean :in))
 
-(def-alien-routine ("isendwin" %isendwin) int)
+(curl-def-alien-routine ("isendwin" %isendwin) int)
 
-(def-alien-routine ("is_linetouched" %is-line-touched) int
+(curl-def-alien-routine ("is_linetouched" %is-line-touched) int
   (win cwindow-ptr :in)
   (line int :in))
 
-(def-alien-routine ("is_wintouched" %is-win-touched) int
+(curl-def-alien-routine ("is_wintouched" %is-win-touched) int
   (win cwindow-ptr :in))
 
-(def-alien-routine ("killchar" %killchar) char)
+(curl-def-alien-routine ("killchar" %killchar) char)
 
-(def-alien-routine ("leaveok" %leaveok) int
+(curl-def-alien-routine ("leaveok" %leaveok) int
   (win cwindow-ptr :in)
   (flag boolean :in))
 
-(def-alien-routine ("longname" %longname) c-string)
+(curl-def-alien-routine ("longname" %longname) c-string)
 
-(def-alien-routine ("meta" %meta) int
+(curl-def-alien-routine ("meta" %meta) int
   (win cwindow-ptr :in)
   (flags boolean :in))
 
-(def-alien-routine ("mvcur" %mvcur) int
+(curl-def-alien-routine ("mvcur" %mvcur) int
   (oldrow int :in)
   (oldcolumn int :in)
   (newrow int :in)
   (newcolumn int :in))
 
-(def-alien-routine ("mvderwin" %mvderwin) int
+(curl-def-alien-routine ("mvderwin" %mvderwin) int
   (win cwindow-ptr :in)
   (par-y int :in)
   (par-x int :in))
 
-(def-alien-routine ("mvwin" %mvwin) int
+(curl-def-alien-routine ("mvwin" %mvwin) int
   (win cwindow-ptr :in)
   (y int :in)
   (x int :in))
 
-(def-alien-routine ("napms" %napms) int)
+(curl-def-alien-routine ("napms" %napms) int)
 
-(def-alien-routine ("newpad" %newpad) cwindow-ptr
+(curl-def-alien-routine ("newpad" %newpad) cwindow-ptr
   (lines int :in)
   (columns int :in))
 
-(def-alien-routine ("newwin" %newwin) cwindow-ptr
+(curl-def-alien-routine ("newwin" %newwin) cwindow-ptr
   (lines int :in)
   (columns int :in)
   (begin-y int :in)
   (begin-x int :in))
 
-(def-alien-routine ("nl" %nl) int)
+(curl-def-alien-routine ("nl" %nl) int)
 
-(def-alien-routine ("nocbreak" %nocbreak) int)
+(curl-def-alien-routine ("nocbreak" %nocbreak) int)
 
-(def-alien-routine ("nodelay" %nodelay) int
+(curl-def-alien-routine ("nodelay" %nodelay) int
   (win cwindow-ptr :in)
   (bf boolean :in))
-  (def-alien-routine ("noecho" %noecho) int)
+  (curl-def-alien-routine ("noecho" %noecho) int)
 
-(def-alien-routine ("nonl" %nonl) int)
+(curl-def-alien-routine ("nonl" %nonl) int)
 
-(def-alien-routine ("noqiflush" %noqiflush) int)
+(curl-def-alien-routine ("noqiflush" %noqiflush) int)
 
-(def-alien-routine ("noraw" %noraw) int)
+(curl-def-alien-routine ("noraw" %noraw) int)
 
-(def-alien-routine ("notimeout" %notimeout) int
+(curl-def-alien-routine ("notimeout" %notimeout) int
   (win cwindow-ptr :in)
   (bf boolean :in))
 
-(def-alien-routine ("overlay" %overlay) int
+(curl-def-alien-routine ("overlay" %overlay) int
   (srcwin cwindow-ptr :in)
   (dstwin cwindow-ptr :in))
 
-(def-alien-routine ("overwrite" %overwrite) int
+(curl-def-alien-routine ("overwrite" %overwrite) int
   (srcwin cwindow-ptr :in)
   (dstwin cwindow-ptr :in))
 
-(def-alien-routine ("pnoutrefresh" %pnoutrefresh) int
+(curl-def-alien-routine ("pnoutrefresh" %pnoutrefresh) int
   (pad cwindow-ptr :in)
   (pminrow int :in)
   (pmincol int :in)
@@ -218,7 +225,7 @@
   (smaxrow int :in)
   (smaxcol int :in))
 
-(def-alien-routine ("prefresh" %prefresh) int
+(curl-def-alien-routine ("prefresh" %prefresh) int
   (pad cwindow-ptr :in)
   (pminrow int :in)
   (pmincol int :in)
@@ -227,183 +234,183 @@
   (smaxrow int :in)
   (smaxcol int :in))
 
-;(def-alien-routine ("putp" %putp) int
+;(curl-def-alien-routine ("putp" %putp) int
 ;  (str c-string :in))
 
-(def-alien-routine ("qiflush" %qiflush) int)
+(curl-def-alien-routine ("qiflush" %qiflush) int)
 
-(def-alien-routine ("raw" %raw) int)
+(curl-def-alien-routine ("raw" %raw) int)
 
-(def-alien-routine ("resetty" %resetty) int)
+(curl-def-alien-routine ("resetty" %resetty) int)
 
-(def-alien-routine ("reset_prog_mode" %reset-prog-mode) int)
+(curl-def-alien-routine ("reset_prog_mode" %reset-prog-mode) int)
 
-(def-alien-routine ("reset_shell_mode" %reset-shell-mode) int)
+(curl-def-alien-routine ("reset_shell_mode" %reset-shell-mode) int)
 
-(def-alien-routine ("savetty" %savetty) int)
+(curl-def-alien-routine ("savetty" %savetty) int)
 
-(def-alien-routine ("scr_dump" %scr-dump) int
+(curl-def-alien-routine ("scr_dump" %scr-dump) int
   (filename c-string :in))
 
-(def-alien-routine ("scr_init" %scr-init) int
+(curl-def-alien-routine ("scr_init" %scr-init) int
   (filename c-string :in))
 
-(def-alien-routine ("scrollok" %scollok) int
+(curl-def-alien-routine ("scrollok" %scollok) int
   (win cwindow-ptr :in)
   (bf boolean :in))
 
-(def-alien-routine ("scr_restore" %scr-restore) int
+(curl-def-alien-routine ("scr_restore" %scr-restore) int
   (filename c-string :in))
 
-(def-alien-routine ("scr_set" %scr-set) int
+(curl-def-alien-routine ("scr_set" %scr-set) int
   (filename c-string :in))
 
-(def-alien-routine ("typeahead" %typeahead) int
+(curl-def-alien-routine ("typeahead" %typeahead) int
   (fd int :in))
 
-(def-alien-routine ("ungetch" %ungetch) int
+(curl-def-alien-routine ("ungetch" %ungetch) int
   (ch int :in))
 
 ;; is this needed?
 ;; doesn't seem to be found in the ncurses library
-;(def-alien-routine ("use-env" %use-env) void
+;(curl-def-alien-routine ("use-env" %use-env) void
 ;  (bf boolean :in))
 
-(def-alien-routine ("waddch" %waddch) int
+(curl-def-alien-routine ("waddch" %waddch) int
   (win cwindow-ptr :in)
   (ch chtype :in))
 
-(def-alien-routine ("waddchnstr" %wasschnstr) int
+(curl-def-alien-routine ("waddchnstr" %wasschnstr) int
   (win cwindow-ptr :in)
   (ch (* chtype) :in)
   (len int :in))
 
-(def-alien-routine ("wbkgd" %wbkgd) int
+(curl-def-alien-routine ("wbkgd" %wbkgd) int
   (win cwindow-ptr :in)
   (ch chtype :in))
 
-;(def-alien-routine ("wchgat" %wchgat) int
+;(curl-def-alien-routine ("wchgat" %wchgat) int
 ;  (win cwindow-ptr :in)
 ;  (someint int :in)
 ;  (someatt attrtype :in)
 ;  (someshort int :in)
 ;  (somevoid (* void) :in))
 
-(def-alien-routine ("winchnstr" %winchnstr) int
+(curl-def-alien-routine ("winchnstr" %winchnstr) int
   (win cwindow-ptr :in)
   (ch (* chtype) :in)
   (len int :in))
 
-(def-alien-routine ("winsch" %winsch) int
+(curl-def-alien-routine ("winsch" %winsch) int
   (win cwindow-ptr :in)
   (ch chtype :in))
 
-(def-alien-routine ("wscrl" %wscrl) int
+(curl-def-alien-routine ("wscrl" %wscrl) int
   (win cwindow-ptr :in)
   (count int :in))
 
-(def-alien-routine ("wsetscrreg" %wsetscrreg) int
+(curl-def-alien-routine ("wsetscrreg" %wsetscrreg) int
   (win cwindow-ptr :in)
   (top int :in)
   (bottom int :in))
 
-(def-alien-routine ("wsyncup" %wsyncup) int
+(curl-def-alien-routine ("wsyncup" %wsyncup) int
   (win cwindow-ptr :in))
 
-(def-alien-routine ("wsyncdown" %wsyncdown) int
+(curl-def-alien-routine ("wsyncdown" %wsyncdown) int
   (win cwindow-ptr :in))
 
-(def-alien-routine ("wtimeout" %wtimeout) int
+(curl-def-alien-routine ("wtimeout" %wtimeout) int
   (win cwindow-ptr :in)
   (count int :in))
 
-;(def-alien-routine ("wtouchline" %wtouchline) int
+;(curl-def-alien-routine ("wtouchline" %wtouchline) int
 ;  (win cwindow-ptr :in)
 ;  (oneint int :in)
 ;  (twoint int :in)
 ;  (threeint int :in))
 
-(def-alien-routine ("wvline" %vline) int
+(curl-def-alien-routine ("wvline" %vline) int
   (win cwindow-ptr :in)
   (ch chtype :in)
   (row int :in))
 
-(def-alien-routine ("waddnstr" %waddnstr) int
+(curl-def-alien-routine ("waddnstr" %waddnstr) int
   (win cwindow-ptr :in)
   (str c-string :in)
   (n int :in))
 
-(def-alien-routine ("wattr_on" %wattr_on) int
+(curl-def-alien-routine ("wattr_on" %wattr_on) int
   (win cwindow-ptr :in)
   (attr attrtype :in))
 
-(def-alien-routine ("wattr_off" %wattr_off) int
+(curl-def-alien-routine ("wattr_off" %wattr_off) int
   (win cwindow-ptr :in)
   (attr attrtype :in))
 
-(def-alien-routine ("wclear" %wclear) int
+(curl-def-alien-routine ("wclear" %wclear) int
   (win cwindow-ptr :in))
 
-(def-alien-routine ("wclrtobot" %wclrtobot) int
+(curl-def-alien-routine ("wclrtobot" %wclrtobot) int
   (win cwindow-ptr :in))
 
-(def-alien-routine ("wclrtoeol" %wclrtoeol) int
+(curl-def-alien-routine ("wclrtoeol" %wclrtoeol) int
   (win cwindow-ptr :in))
 
-(def-alien-routine ("wcursyncup" %wcursyncup) void
+(curl-def-alien-routine ("wcursyncup" %wcursyncup) void
   (win cwindow-ptr :in))
 
-(def-alien-routine ("werase" %werase) int
+(curl-def-alien-routine ("werase" %werase) int
   (win cwindow-ptr :in))
 
-(def-alien-routine ("wgetch" %wgetch) int
+(curl-def-alien-routine ("wgetch" %wgetch) int
   (win cwindow-ptr :in))
 
-(def-alien-routine ("wdelch" %wdelch) int
+(curl-def-alien-routine ("wdelch" %wdelch) int
   (win cwindow-ptr :in))
 
-(def-alien-routine ("wechochar" %wechochar) int
+(curl-def-alien-routine ("wechochar" %wechochar) int
   (win cwindow-ptr :in)
   (ch chtype :in))
 
-(def-alien-routine ("wgetnstr" %wgetnstr) int
+(curl-def-alien-routine ("wgetnstr" %wgetnstr) int
   (win cwindow-ptr :in)
   (str c-string :in)
   (n int :in))
 
-(def-alien-routine ("whline" %whline) int
+(curl-def-alien-routine ("whline" %whline) int
   (win cwindow-ptr :in)
   (ch chtype :in)
   (len int :in))
 
-(def-alien-routine ("winnstr" %winnstr) int
+(curl-def-alien-routine ("winnstr" %winnstr) int
   (win cwindow-ptr :in)
   (str c-string :in)
   (n int :in))
 
-(def-alien-routine ("winsnstr" %winsnstr) int
+(curl-def-alien-routine ("winsnstr" %winsnstr) int
   (win cwindow-ptr :in)
   (str c-string :in)
   (n int :in))
 
-(def-alien-routine ("wmove" %wmove) int
+(curl-def-alien-routine ("wmove" %wmove) int
   (win cwindow-ptr :in)
   (y int :in)
   (x int :in))
 
-(def-alien-routine ("wnoutrefresh" %wnoutrefresh) int
+(curl-def-alien-routine ("wnoutrefresh" %wnoutrefresh) int
   (win cwindow-ptr :in))
 
-(def-alien-routine ("winsdelln" %winsdelln) int
+(curl-def-alien-routine ("winsdelln" %winsdelln) int
   (win cwindow-ptr :in)
   (line int :in))
 
-(def-alien-routine ("wredrawln" %wredrawln) int
+(curl-def-alien-routine ("wredrawln" %wredrawln) int
   (win cwindow-ptr :in)
   (y int :in)
   (x int :in))
 
-(def-alien-routine ("wrefresh" %wrefresh) int
+(curl-def-alien-routine ("wrefresh" %wrefresh) int
   (win cwindow-ptr :in))
 
 
diff -urN curl-orig/exports.lisp curl-mine/exports.lisp
--- curl-orig/exports.lisp	2003-01-08 18:31:05.000000000 +0100
+++ curl-mine/exports.lisp	2003-04-26 19:52:13.000000000 +0200
@@ -1,9 +1,9 @@
 ;; since this is loaded first anyways
-#-SOLARIS (system::load-object-file "/usr/lib/libncurses.so")
-#+SOLARIS (system::load-object-file "/opt/toolz/local/lib/libncurses.so")
 
-(cl:defpackage "CURL"
-  (:use "COMMON-LISP" "ALIEN" "UNIX" "C-CALL" "SYSTEM")
+(defpackage "CURL"
+  (:use "COMMON-LISP"
+	#+cmu "ALIEN" #+cmu "UNIX" #+cmu "C-CALL" #+cmu "SYSTEM"
+	#+sbcl "SB-ALIEN" #+sbcl "SB-SYS")
   (:export load-curl
 	   compile-curl
 	   curl-screen lines cols screen-beep
@@ -11,3 +11,11 @@
 	   move add-string refresh destroy
 	   ))
 
+(in-package "CURL")
+
+(defconstant +curses-object-file-name+
+  #-SOLARIS "/usr/lib/libncurses.so"
+  #+SOLARIS "/opt/toolz/local/lib/libncurses.so")
+
+(#+cmu  system::load-object-file
+ #+sbcl sb-alien:load-foreign    +curses-object-file-name+)
