REBOL 3.0

NONE-transparent functions

Carl Sassenrath, CTO
REBOL Technologies
14-Apr-2007 0:05 GMT

Article #0085
Main page || Index || Prior Article [0084] || Next Article [0086] || 6 Comments || Send feedback

A none-transparent function is one that exhibits this behavior:

>> none? function none
== true

An example is:

remove find block value

The result of find can be none, but remove does not care. None is a valid argument to remove.

Another example is:

clear find block value

This behavior is productive in many cases, but not everywhere. There are times when you want to trap the error case as soon as possible.

For example:

find find block value value2

Here it is better if find is not none-transparent.

In addition to remove and clear, the new take function is also none-transparent. But are there other functions that really should be?

If you have a strong argument in favor (or against) let me know by posting a comment.

6 Comments

REBOL 3.0
Updated 12-Nov-2024 - Edit - Copyright REBOL Technologies - REBOL.net