ecl-logo Documentation

SafeEvaluate

SafeEvaluate[input,expr]out

evaluates expr if no members of the list input match NullP|{}; otherwise, returns Null.

Details

  • Always pass items to be checked for Null-ness as a list, ESPECIALLY when only passing one item.
  • Input
    Output
    Attributes
  • HoldRest

Examples

Basic Examples  (3)

Evaluates if no part of 'input' matches NullP:

Multiple expressions can be checked for Null-ness by passing them to 'input' in a list:

Returns Null if 'input' matches NullP:

Additional Examples  (3)

Returns Null if 'input' is an empty list:

This includes any nested lists of only Null:

A partially null element of the input list will still evaluate:

Attributes  (1)

HoldRest  (1)

The expression passed in as the second argument is held and only evaluated if the proper conditions are met: