On Mar 17, 2009, at 4:44 AM, Christophe Grand wrote:

How do you cope with type-hinted vars or macros? (ok #'declare does not
work for macros neither)

With autodef, one could have to either move the definition or add a
declare just to be able to add a type hint.

The class of vars you're talking about are vars whose metdata and/or value is needed at compile time. autodef as I've described it would not help with those. To operate properly, they would still need to be declared and/or defined before code that uses them is compiled.

The common theme is that all vars must have complete definitions before their metadata and/or value is used. The vars you mention are used earlier than others.

I think there is the potential for a good deal of confusion in the cases you mention. Macros that were autodef'd because calls to them were compiled into other functions would be called from those sites if they were ordinary functions. Compiled code for hinted vars would not benefit from the hints.

On the other side of the argument, the situation with autodef is exactly the same as a policy (implemented by hand) of declaring all vars you wish to define out of order using un-hinted declares. Autodef simply makes that process automatic.

A complete solution would include a provision like "require for syntax" (and likely other kinds of require/loading) that would allow a module system to supply the compiler with all it needs independent of the ordering of functions within a module or modules within a system.

--Steve

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to