lang/unsafe.sh

Low level object manipulation.

unsafe_clone()

Shallow clone.

unsafe_copy()

Copy content of src to dst without changing dst name.

unsafe_flds()

Return a list of fields of the given object.

unsafe_from_json()

Create an object from a json file.

unsafe_gc()

Clean. Should be used carefully.

unsafe_get_fld()

Get a field for object/uid.

unsafe_has_fld()

Return true if the given object/uid has the given field.

unsafe_is_instanceof()

Return true if object is instance of the given type.

unsafe_is_object()

Return true if it is a valid object.

unsafe_keys()

Return a list of keys in the same order as in the map.

unsafe_len()

Get (length, 0) of the underlying object/uid. If error, return (_, $EC).

unsafe_list_add()

Add an element into a list and return (_, 0). If error, return (_, $EC).

unsafe_list_clear()

Clean a list and return (_, 0). If error, return (_, $EC).

unsafe_list_delete()

Delete an element and return (_, 0). If element not present, return (_, 1). If error, return (_, $EC).

unsafe_list_eq()

Return (_, 0) if two lists are the same (comparing elements as references). Return (_, 1) if they are diff. Return (_, $EC) if there is an error.

unsafe_list_get()

Get an element from a list (val, 0). If error, return (_, $EC).

unsafe_list_make()

Make a list and return (uid, 0). If error, return (_, $EC).

unsafe_object_make()

Return new object (uid, 0). If error, return (_, $EC).

unsafe_set_fld()

Set a field for object/uid.

unsafe_to_json()

Output json representation of the object.

unsafe_to_string()

Output string representation of the object.

unsafe_zero()

Zero value for the given type.