First-cut of fixes to make symbols work with libraries

This commit is contained in:
Justin Ethier 2015-05-22 21:46:20 -04:00
parent 1e297ec2fb
commit 695131a4d8
2 changed files with 9 additions and 3 deletions

View file

@ -946,7 +946,7 @@
(if program?
(emit "#include \"runtime-main.h\""))
;; Emit symbols
;; Emit symbol definitions
(for-each
(lambda (sym)
(emit*
@ -986,6 +986,13 @@
; DEBUG (emit (string-append "printf(\"init " (lib:name->string lib-name) "\\n\");"))
))
;; Initialize symbols
(for-each
(lambda (sym)
(emit*
" quote_" (mangle sym) " = find_or_add_symbol(\"" (symbol->string sym) "\");"))
*symbols*)
;; Initialize global table
(for-each
(lambda (global)

View file

@ -145,8 +145,7 @@ typedef symbol_type *symbol;
#define symbol_plist(x) (((symbol_type *) x)->plist)
#define defsymbol(name,pname) \
static symbol_type name##_symbol = {symbol_tag, #pname, nil}; \
static const object quote_##name = &name##_symbol
static object quote_##name = nil;
/* Define numeric types */
typedef struct {tag_type tag; int value;} integer_type;