# Function as argument of another function

**URL:** <https://discourse.processing.org/t/function-as-argument-of-another-function/6383>\
**Category:** Coding Questions\
**Created:** [December 6, 2018, 9:05pm UTC](https://discourse.processing.org/t/function-as-argument-of-another-function/6383 "2018-12-06T21:05:55Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [December 6, 2018, 11:07pm UTC](https://discourse.processing.org/t/function-as-argument-of-another-function/6383/4 "2018-12-06T23:07:40Z")

</div>

> [@jb4x](#):
>
> I’m trying to pass a function as an argument of another function but can’t figure out how…

I’ve wet my feet a little on the Java package [java.util.function](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/function/package-summary.html) by instantiating a [[u]Predicate[/u]](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/function/Predicate.html) and passing it as an argument at these 2 old sketch links below: 🤪

1. [Querying ArrayList - Processing 2.x and 3.x Forum](http://Forum.Processing.org/two/discussion/21761/querying-arraylist#Item_2)
2. [Forum.Processing.org/two/discussion/22823/how-to-implement-this-method#Item\_2](http://Forum.Processing.org/two/discussion/22823/how-to-implement-this-method#Item_2)

Of course it’s not even close to an actual lambda `->` syntax. But it’s as far as we can go under the PDE. 🙄

---

_[View the full topic](https://discourse.processing.org/t/function-as-argument-of-another-function/6383)._
