Method: Carbon::Core::Integer::Math#define_comp_function
- Defined in:
- lib/carbon/core/integer/math.rb
#define_comp_function(left, right, op) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
Defines a compare function. The left and right integer types are given, as well as the specific operation.
108 109 110 111 112 113 114 |
# File 'lib/carbon/core/integer/math.rb', line 108 def define_comp_function(left, right, op) function_name = left.name.call(op, [left.name, right.name]) Core.define(function: function_name) do |function| function[:return] = Carbon::Boolean define_comp_definition(left, right, op, function[:definition]) end end |