github.com/arnodel/golua@v0.0.0-20230215163904-e0b5347eaaa1/lib/base/lua/warn.lua (about)

     1  -- off by default
     2  warn("discarded warning")
     3  
     4  warn("@on")
     5  
     6  warn("a warning")
     7  --> =Test warning: a warning
     8  
     9  warn("this", 12, 9.5)
    10  --> =Test warning: this129.5
    11  
    12  warn("some", "@on", "other", "@off")
    13  --> =Test warning: some@onother@off
    14  
    15  warn("@off")
    16  
    17  warn("discarded")
    18  print("hello")
    19  --> =hello
    20  
    21  print(pcall(warn))
    22  --> ~false\t.*value needed
    23  
    24  print(pcall(warn, {}))
    25  --> ~false\t.*string expected
    26