lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Jan 16, 2008 1:24 AM, Miles Bader <miles@gnu.org> wrote:
> Philippe Lhoste <PhiLho@GMX.net> writes:
> >> Incidentally, any syntactic reason not to allow other "parenthesis-less"
> >> calls?
> >>
> >> E.g., you can use:  fun 'blargh'
> >> sometimes I'd kinda like to be able to use:  fun 3
> >> as well...
> >
> > Perhaps because fun 3+4 would look ambiguous and error prone? Somehow,
> > the quotes *are* the delimiters of the function parameter, so they are
> > no ambiguous.
>
> I dunno, I don't really see that as a problem -- just say it's exactly
> the same as any unary operator, and binds tightly.  It's no different
> than -3+4, or as somebody else mentioned, fun "a".."b".
>
> -Miles
>
> --
> `To alcohol!  The cause of, and solution to,
>  all of life's problems' --Homer J. Simpson
>

fun "a".."b" is invalid, though - the parser won't accept it. The
equivalent would be to only allow a single number parameter.