[Omake] Scoping

Aleksey Nogin nogin at metaprl.org
Wed Nov 8 20:27:33 PST 2006


On 08.11.2006 20:22, Nathaniel Gray wrote:

> I thought I understood the scoping rules, but I don't understand why
> this works:
> 
> OCAMLINCLUDES += foo/bar
> x = $(OCamlProgram a, b)
> 
> but when you substitute this:
> 
> FancyOCamlProgram(a, b)
>     OCAMLINCLUDES += foo/bar
>     return $(OCamlProgram $(a), $(b))
> x = $(FancyOCamlProgram a, b)
> 
> You don't get "-I foo/bar" in the arguments to ocamlc.  Isn't the
> (re-)definition of OCAMLINCLUDES the closest dynamically-scoped
> definition during the call to OCamlProgram?

By default, the variables defined inside functions are private
(statically scoped) ones. You probably need to use public.OCAMLINCLUDES
here...

Aleksey


More information about the Omake mailing list