79145282

Date: 2024-10-31 15:20:57
Score: 2
Natty:
Report link

How about this one?

if debug.getinfo(3) then
  print("in package")
else
  print("in main script")
end

Same idea, less keystrokes. Level 3 as argument is sufficient, because debug.getinfo is not called within another function.

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Starts with a question (0.5): How
  • Low reputation (1):
Posted by: Meindert Meindertsma