gtef

function gtef( 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-gtef-v1
local function gtef( val ) --> func
   return function ( oth )
      return oth >= val
   end
end

return gtef

Examples

local t = require( "taptest" )
local gtef = require( "gtef" )

func = gtef( 2 )

t( func( 3 ), true )
t( func( 2 ), true )
t( func( 1 ), false )

t()

See also