lua-users home
lua-l archive

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

On 23/09/2013 2.09, Miles Bader wrote:
It's not really clear to me where the line between an "internal DSL"
and "just Lua" is... but my raytracer uses Lua as a scene-description
language, e.g.:

I have the same doubt. In any case, in the DSL for one of my adventure engines I used this form:

  look.clock = Msg('M_007')

  act.clock = Msg('M_005')

  use.hammer.clock = function()

  use.any.clock = Msg('M_008')

where (self-built) tables such as "use.hammer.clock" describe a possible player's action and the right side describes the desired effect, either as a user-defined function or as a pre-built command.

(the DSL I designed for a game-book compiler was more interesting, but it also had a preprocessing stage so it was not entirely pure Lua)