[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua parser enhancement request
- From: Dibyendu Majumdar <mobile@...>
- Date: Sun, 2 Aug 2015 10:58:21 +0100
On 1 August 2015 at 19:21, Tim Hill <drtimhill@gmail.com> wrote:
>
> On Aug 1, 2015, at 12:23 AM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
>
>
> Oh, the verbosity can be cured, by borrowing an idea from
> Fortran. (To go with origin-1 indexing, the arithmetic "for", etc.)
>
> Give Ravi a function IMPLICIT (capitals, please! like C preprocessor
> directives).
>
> IMPLICIT ("integer", "[^I-N]")
>
> If a name matches the pattern, values assigned to it must be
> of the indicated type. Ravi would of course not treat IMPLICIT
> as a function but as a compiler directive. It's a function to
> allow Lua to do nothing.
>
> To make Ravi programs compile under Lua, one can do this:
>
> lua -e "IMPLICIT=load''" xxx.ravi
>
>
> I actually liked the old Fortran model, and am sill ok with languages that
> use sigils for the same purpose (though Lua dropped them long ago). While
> making code look a bit more geeky they do have the huge advantage of clearly
> showing the type of the variable at its point of use as well as point of
> declaration (how many times have we had to hunt through #include files to
> find a hidden declaration?).
>
Not knowing Fortran I did not know about this feature. Sounds like a
cool feature, but not one that I think I can adopt.
Regards