CL implementation questions
Per Bothner
per@bothner.com
Tue Apr 3 18:50:00 GMT 2012
On 04/03/2012 10:27 AM, Charles Turner wrote:
// decls is e.g '((integer x) (gnu.lists.sequence y))
I assume you realize you also need to support: (integer x y)
> The #setType and #setFlag methods seem to be all that's need to set
> the type of variables with :: (cf Lambda), what am I missing here?
A Declaration has both a "type expression" (typeExp field)
and a "type (value)" (type field): The former "evaluates" to
the latter. A potential use for the "type expression" might be
run-time types (or "dependent types" as in type theory). However,
this isn't really supported. What typeExp is used for is to stash
a type that hasn't been resolved to a Type - yet.
Specifically, look for the 'instanceof LangExp' in
Lambda#rewriteBody.
In the case of declare forms in a <body> you shouldn't need to
use the LangExp - just call exp2Type directly, as in let.java.
--
--Per Bothner
per@bothner.com http://per.bothner.com/
More information about the Kawa
mailing list