From db84fb28effa91e82c83151168a27c8d85759973 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Wed, 20 Oct 2010 13:11:00 +0200 Subject: beta 2010.10.20 13:11 --- scripts/context/lua/mtxrun.lua | 47 ++++++++++++++++++---------------- scripts/context/stubs/mswin/mtxrun.lua | 47 ++++++++++++++++++---------------- scripts/context/stubs/unix/mtxrun | 47 ++++++++++++++++++---------------- 3 files changed, 75 insertions(+), 66 deletions(-) (limited to 'scripts') diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index cae4c8d3e..b792e35af 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -771,28 +771,6 @@ end table.fastcopy = fastcopy table.copy = copy --- roughly: copy-loop : unpack : sub == 0.9 : 0.4 : 0.45 (so in critical apps, use unpack) - -function table.sub(t,i,j) - return { unpack(t,i,j) } -end - -function table.replace(a,b) - for k,v in next, b do - a[k] = v - end -end - --- slower than #t on indexed tables (#t only returns the size of the numerically indexed slice) - -function table.is_empty(t) -- obolete, use inline code instead - return not t or not next(t) -end - -function table.has_one_entry(t) - local n = next(t) - return n and not next(t,n) -end function table.tohash(t,value) local h = { } @@ -1365,6 +1343,31 @@ function table.print(...) table.tohandle(print,...) end +-- -- -- obsolete but we keep them for a while and will comment them later -- -- -- + +-- roughly: copy-loop : unpack : sub == 0.9 : 0.4 : 0.45 (so in critical apps, use unpack) + +function table.sub(t,i,j) + return { unpack(t,i,j) } +end + +-- slower than #t on indexed tables (#t only returns the size of the numerically indexed slice) + +function table.is_empty(t) + return not t or not next(t) +end + +function table.has_one_entry(t) + local n = next(t) + return n and not next(t,n) +end + +function table.replace(a,b) + for k,v in next, b do + a[k] = v + end +end + end -- of closure diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua index cae4c8d3e..b792e35af 100644 --- a/scripts/context/stubs/mswin/mtxrun.lua +++ b/scripts/context/stubs/mswin/mtxrun.lua @@ -771,28 +771,6 @@ end table.fastcopy = fastcopy table.copy = copy --- roughly: copy-loop : unpack : sub == 0.9 : 0.4 : 0.45 (so in critical apps, use unpack) - -function table.sub(t,i,j) - return { unpack(t,i,j) } -end - -function table.replace(a,b) - for k,v in next, b do - a[k] = v - end -end - --- slower than #t on indexed tables (#t only returns the size of the numerically indexed slice) - -function table.is_empty(t) -- obolete, use inline code instead - return not t or not next(t) -end - -function table.has_one_entry(t) - local n = next(t) - return n and not next(t,n) -end function table.tohash(t,value) local h = { } @@ -1365,6 +1343,31 @@ function table.print(...) table.tohandle(print,...) end +-- -- -- obsolete but we keep them for a while and will comment them later -- -- -- + +-- roughly: copy-loop : unpack : sub == 0.9 : 0.4 : 0.45 (so in critical apps, use unpack) + +function table.sub(t,i,j) + return { unpack(t,i,j) } +end + +-- slower than #t on indexed tables (#t only returns the size of the numerically indexed slice) + +function table.is_empty(t) + return not t or not next(t) +end + +function table.has_one_entry(t) + local n = next(t) + return n and not next(t,n) +end + +function table.replace(a,b) + for k,v in next, b do + a[k] = v + end +end + end -- of closure diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun index cae4c8d3e..b792e35af 100755 --- a/scripts/context/stubs/unix/mtxrun +++ b/scripts/context/stubs/unix/mtxrun @@ -771,28 +771,6 @@ end table.fastcopy = fastcopy table.copy = copy --- roughly: copy-loop : unpack : sub == 0.9 : 0.4 : 0.45 (so in critical apps, use unpack) - -function table.sub(t,i,j) - return { unpack(t,i,j) } -end - -function table.replace(a,b) - for k,v in next, b do - a[k] = v - end -end - --- slower than #t on indexed tables (#t only returns the size of the numerically indexed slice) - -function table.is_empty(t) -- obolete, use inline code instead - return not t or not next(t) -end - -function table.has_one_entry(t) - local n = next(t) - return n and not next(t,n) -end function table.tohash(t,value) local h = { } @@ -1365,6 +1343,31 @@ function table.print(...) table.tohandle(print,...) end +-- -- -- obsolete but we keep them for a while and will comment them later -- -- -- + +-- roughly: copy-loop : unpack : sub == 0.9 : 0.4 : 0.45 (so in critical apps, use unpack) + +function table.sub(t,i,j) + return { unpack(t,i,j) } +end + +-- slower than #t on indexed tables (#t only returns the size of the numerically indexed slice) + +function table.is_empty(t) + return not t or not next(t) +end + +function table.has_one_entry(t) + local n = next(t) + return n and not next(t,n) +end + +function table.replace(a,b) + for k,v in next, b do + a[k] = v + end +end + end -- of closure -- cgit v1.2.3