tomhrr / dale

Lisp-flavoured C

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Include often causes errors, even memory errors

porky11 opened this issue · comments

I don't know many exact cases, where errors occur, mostly it happened while trying to include some files in https://github.com/porky11/dale-gl
Some simple example:

(namespace include

(include "enum.dt")

(def print-enum (fn intern void ((a enum)) ;;type enum not defined in this scope
  (printf "%u" a)))

)

(def main (fn extern-c void (void)
  (print-enum value)))

where enum.dt is:

(import enum)

(def-enum enum extern uint
  ((value 0)))

Thanks, this should be fixed now.

There were some bad assumptions with this change, so this needs a little more work now, but it shouldn't take long.

Should be OK now.