# Using Invisibles To Opt Out of Functions In a Chain

**URL:** <https://revolt.metaeducation.com/forum/t/using-invisibles-to-opt-out-of-functions-in-a-chain/2036>\
**Category:** Show & Tell\
**Created:** [May 14, 2018, 9:20pm UTC](https://revolt.metaeducation.com/forum/t/using-invisibles-to-opt-out-of-functions-in-a-chain/2036 "2018-05-14T21:20:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gchiu](https://revolt.metaeducation.com/forum/user_avatar/revolt.metaeducation.com/gchiu/32/22_2.png) [@gchiu](https://revolt.metaeducation.com/forum/u/gchiu)\
**Post date:** [May 14, 2018, 9:20pm UTC](https://revolt.metaeducation.com/forum/t/using-invisibles-to-opt-out-of-functions-in-a-chain/2036/1 "2018-05-14T21:20:56Z")

</div>

[One idea for using invisibles](https://revolt.metaeducation.com/forum/t/making-invisible-functions-e-g-comment-elide/2034) is to chain functions where you make some functions disappear from the chain if they're not needed.

Imagine an image processor where you apply sequential effects but only the ones specify as refinements.

```
imagemagick: func [
    data 
    :monochrome
    :sharpen
    :blur
    :pixelise
][
    ... code ..
    sharpen: either sharpen [sharpenf/] [nihil/]
    blur: either blur [blurf/] [nihil/]
    pixelise: either pixelize [pixelf/] [nihil/]

    return sharpen blur pixelise data
]

imagemagick/sharpen imagedata

```

NIHIL is an arity-0 COMMENT function that just vanishes, giving a much cleaner look. If the refinements are absent, the functions just disappear.

---

<div class="post-metadata">

**Author:** ![hostilefork](https://revolt.metaeducation.com/forum/user_avatar/revolt.metaeducation.com/hostilefork/32/421_2.png) [@hostilefork](https://revolt.metaeducation.com/forum/u/hostilefork)\
**Post date:** [December 8, 2023, 2:08am UTC](https://revolt.metaeducation.com/forum/t/using-invisibles-to-opt-out-of-functions-in-a-chain/2036/3 "2023-12-08T02:08:05Z")

</div>

> [@gchiu](#):
>
> One idea for using invisibles is to chain functions where you make some functions disappear from the chain if they're not needed.

This is a creative idea... and I think this sort of creativity is what makes the language fun...

However...

> [@gchiu](#):
>
> ```
> sharpen: either sharpen [sharpenf/] [nihil/]
> blur: either blur [blurf/] [nihil/]
> pixelise: either pixelize [pixelf/] [nihil/]
> 
> return sharpen blur pixelise data
> 
> ```

This kind of application no longer works, as there's been a necessary casualty of scaling back what "invisibility" could do inside of a single step. ☹

"Non-Interstitial Invisibility" was removed for good reasons that are outlined here:

[Making Invisible Functions (e.g. COMMENT, ELIDE)](https://revolt.metaeducation.com/forum/t/invisibility-reviewed-through-modern-eyes/2034)

So to have invisibles vaporize anything, you'd need to go through a COMPOSE or REDUCE step and then EVAL the result... so not that succinct. CASCADE is a better bet here.

Though at time of writing, you can get the original intent with macros:

```
sharpen: macro [] [return if sharpen [sharpenf]]
blur: macro [] [return if blur [blurf]]
pixelise: macro [] [return if pizelize [pixelf]]

return sharpen blur pixelise data

```
