Header: mruby/range.h

Function Summary collapse

Define Summary

#define MRUBY_RANGE_H
#define MRB_RANGE_EMBED
#define mrb_gc_free_range
#define RANGE_BEG
#define RANGE_END
#define mrb_range_beg
#define mrb_range_end
#define mrb_range_excl_p
#define mrb_range_raw_ptr
#define mrb_range_value
#define RANGE_EXCL

Function Details

struct RRange* mrb_range_ptr(mrb_state * mrb, mrb_value range)

mrb_value mrb_range_new(mrb_state * mrb, mrb_value start, mrb_value end, mrb_bool exclude)

Initializes a Range.

If the third parameter is FALSE then it includes the last value in the range. If the third parameter is TRUE then it excludes the last value in the range.

Parameters:

  • start

    the beginning value.

  • end

    the ending value.

  • exclude

    represents the inclusion or exclusion of the last value.

enum mrb_range_beg_len(mrb_state * mrb, mrb_value range, mrb_int * begp, mrb_int * lenp, mrb_int len, mrb_bool trunc)

(failure) out of range