lua-users home
lua-l archive

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

> > I personally often use such calls in my micro-DSLs. Like this:
> > foo "name"
> > {
> >   bar "bar";
> >   baz "baz";
> > }
> But could other implementations be clear without using parenthesis-free
> calls?
> I have to admit that the code above is easier for a non programmer to
> understand than a verbatim modification to parenthesis-free calls:
> foo("name")(
> {
>   bar("bar")
>   baz("baz")
> })
> But I bet the error messages are completely unintelligible! I guess a
> user would just compare against a known good example until all it works.

Actually, in this case error messages may be made quite comprehensible
(at least in most cases) at (relatively) low cost by using of
sand-boxing and by adding explicit validation run step with custom
constructed validation environments... If someone is interested, I may
dig out my old paper draft on this subject.

About "weirdness" compared to "conventional" Lua... One should not
consider code written in such way as conventional Lua. It may be said
that such code it is written in... hmm... a declarative
domain-specific language, based on Lua. (Please pardon me if I'm
incorrect in terminology).