Class: CABinCmp

Inherits:
Object
  • Object
show all
Defined in:
yard-stubs/carray_lazy.rb

Copy and conversion collapse

Instance Method Details

#copy ⇒ CArray

Evaluates the expression and returns the result as a new entity.

If an expression evaluator is registered through CArray.expression_evaluator it is asked first; the ordinary element-wise walk is what happens when it declines, when none is registered, or when the array is small enough that walking is the faster answer.

Returns:

  • (CArray) —

    a newly evaluated entity.



190
# File 'yard-stubs/carray_lazy.rb', line 190

def copy; end

#to_ca ⇒ CArray

Evaluates the expression and returns the result as a new entity.

A two-operand element-wise comparison holds no data of its own, so there is nothing to hand over unevaluated: unlike CArray#to_ca, which returns self, this materialises -- the Ruby Enumerable#to_a / lazy force convention.

The entity is detached from the operands, so writes to it reach nothing. writable: true is therefore refused rather than answered with a result that would swallow them.

Parameters:

  • writable (Boolean) —

    whether the caller needs writes to land back in the source; only false can be satisfied.

Returns:

  • (CArray) —

    a newly evaluated entity.

Raises:

  • (RuntimeError) —

    when writable: true is requested.



179
# File 'yard-stubs/carray_lazy.rb', line 179

def to_ca(writable: false); end