pluac: feature req

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

pluac: feature req

David McNab
Hi,

I just thought it would be nice if pluac could have a couple of small
features added to it:

1. a flag, eg '-req', which means that any 'require("filename")'
occurring in the main body of the file results in the full contents of
that file being included in the compilation, akin to '#include' in C

2. accept zero or more '-I dir' flags, to provide additional search
directories for 'require' files. These would work just like the '-I'
options in gcc.

Cheers
David




 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/plua/

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply | Threaded
Open this post in threaded view
|

Re: pluac: feature req

migueletto
Hi,

> I just thought it would be nice if pluac could have a couple of small
> features added to it:
>
> 1. a flag, eg '-req', which means that any 'require("filename")'
> occurring in the main body of the file results in the full contents of
> that file being included in the compilation, akin to '#include' in C
>
> 2. accept zero or more '-I dir' flags, to provide additional search
> directories for 'require' files. These would work just like the '-I'
> options in gcc.

I think these features are better implemented in a preprocessor, like
the pluac wrapper you wrote. Pluac expects to see only valid Lua code.

Keep in mind though that in Lua5 'require' is used in a different way
than the C-like include, and this may cause confusion.

Regards,
Marcio.






 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/plua/

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply | Threaded
Open this post in threaded view
|

Re: Re: pluac: feature req

David McNab
migueletto wrote:
> I think these features are better implemented in a preprocessor, like
> the pluac wrapper you wrote. Pluac expects to see only valid Lua code.

I tend to agree, but have seen how some windows or mac users might feel
intimidated at the task of setting up a C compiler if they've never done
it before.

> Keep in mind though that in Lua5 'require' is used in a different way
> than the C-like include, and this may cause confusion.

Correct - includes the file once only or not at all.

Maybe a bit of very rudimentary preprocessing in pluac might be nice for
some users, such as a 'include("filename")' function.

Not that I need it, since I wrote that python front end which manages
the gcc preprocessing then sends the code off to pluac.

Cheers
David

>
> Regards,
> Marcio.
>
>
>
>
>
>
>  
> Yahoo! Groups Links
>
>
>
>  
>
>
>
>
>


--
Cheers
David

When replying, please ensure the word 'Aotearoa' appears in your
message. This is to ensure your message will bypass my spam filter and
actually get delivered to me. If you're just replying, leave these lines
intact in your message and all will be ok. Many thanks.



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/plua/

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/