lua-users home
lua-l archive

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


Here is a related ugly Lua/Python polyglot:

#!/usr/bin/env python
_rem={}
_rem={ #_rem --[=[
}
# Python code
""" # ]=] }
-- Lua code
_rem={ #_rem --[=[
""" # } ]=] }

I use a simpler version of this so I can have code which declares a table in both Lua and Python with comments for both Lua and Python.

— Sam

On 2020-08-12 11:19, Egor Skriptunoff wrote:
Nice idea with if-false-then-else!
Another way is to start with variable assignment:

#!/bin/sh
a=a--[[
...shell code...
]]
...Lua code...