Skip to content

Commit

Permalink
Drop atpanic wrapper function
Browse files Browse the repository at this point in the history
The use of longjmp in lua makes dealing with lua exceptions difficult.
There doesn't seem to be a sensible way to handle those exceptions, so
the host program will exit with a panic either way. With that in mind,
the `atpanic` function doesn't seem very useful.
  • Loading branch information
tarleb committed Jul 9, 2017
1 parent 9601340 commit 5bee504
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/Foreign/Lua.hs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ module Foreign.Lua
, module Foreign.Lua.Types
, module Foreign.Lua.Util
-- * Lua API functions
, atpanic
, call
, checkstack
, close
Expand Down
7 changes: 0 additions & 7 deletions src/Foreign/Lua/Api.hs
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,6 @@ import qualified Data.ByteString as B
import qualified Data.ByteString.Unsafe as B
import qualified Foreign.Storable as F

-- | Sets a new panic function and returns the old one (see
-- <https://www.lua.org/manual/5.3/manual.html#4.6 §4.6> and
-- <https://www.lua.org/manual/5.3/manual.html#lua_atpanic lua_atpanic> in the
-- lua manual).
atpanic :: FunPtr LuaCFunction -> Lua (FunPtr LuaCFunction)
atpanic = liftLua1 lua_atpanic

-- | See <https://www.lua.org/manual/5.3/manual.html#lua_call lua_call>.
call :: NumArgs -> NumResults -> Lua ()
#if LUA_VERSION_NUMBER >= 502
Expand Down

0 comments on commit 5bee504

Please sign in to comment.