gtf

function gtf( val ) --> func

Description

Creates a function that takes one parameter and compares it with val via the > operator.

Parameters

val

The basic value for the comparsion.

Return Values

func

A new function that takes one parameter and returns true or false.

Code

--ZFUNC-gtf-v1
local function gtf( val ) --> func
   return function ( oth )
      return oth > val
   end
end

return gtf

Examples

local t = require( "tapered" )
local gtf = require( "gtf" )

func = gtf( 2 )

t.ok( func( 3 ) )
t.nok( func( 2 ) )
t.nok( func( 1 ) )

t.done()

See also