rb_map

This file defines additional operations on native rb_maps and rb_sets. These structures are defined in core in init.meta.rb_map. They are meta objects, and are generally the most efficient dictionary structures to use for pure metaprogramming right now.


native.rb_set.filter

filter s P returns the subset of elements of s satisfying P.

native.rb_set.mfilter

mfilter s P returns the subset of elements of s satisfying P, where the check P is monadic.

native.rb_set.union

union s t returns an rb_set containing every element that appears in either s or t.

native.rb_map.find_def

find_def default m k returns the value corresponding to k in m, if it exists. Otherwise it returns default.

native.rb_map.ifind

ifind m key returns the value corresponding to key in m, if it exists. Otherwise it returns the default value of value.

native.rb_map.zfind

zfind m key returns the value corresponding to key in m, if it exists. Otherwise it returns 0.

native.rb_map.add

Returns the pointwise sum of m1 and m2, treating nonexistent values as 0.

native.rb_map.mfilter

mfilter P s filters s by the monadic predicate P on keys and values.

native.rb_map.mmap

mmap f s maps the monadic function f over values in s.

native.rb_map.scale

scale b m multiplies every value in m by b.

native.rb_lmap.of_list

Construct a rb_lmap from a list of key-data pairs

name_set.filter

filter P s returns the subset of elements of s satisfying P.

name_set.mfilter

mfilter P s returns the subset of elements of s satisfying P, where the check P is monadic.

name_set.mmap

mmap f s maps the monadic function f over values in s.

name_set.union

union s t returns an rb_set containing every element that appears in either s or t.

name_set.insert_list

insert_list s l inserts every element of l into s.