# Stubbing in Julia?

**URL:** <https://discourse.julialang.org/t/stubbing-in-julia/6341>\
**Category:** General Usage\
**Created:** [October 9, 2017, 3:55am UTC](https://discourse.julialang.org/t/stubbing-in-julia/6341 "2017-10-09T03:55:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ratan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ratan/32/2125_2.png) [@ratan](https://discourse.julialang.org/u/ratan)\
**Post date:** [October 9, 2017, 3:55am UTC](https://discourse.julialang.org/t/stubbing-in-julia/6341/1 "2017-10-09T03:55:54Z")

</div>

In Scala, for example, ??? is defined as throwing a NotImplementedException, is there something similar in julia for stubbing functions?

---

<div class="post-metadata">

**Author:** ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)\
**Post date:** [October 9, 2017, 3:58am UTC](https://discourse.julialang.org/t/stubbing-in-julia/6341/2 "2017-10-09T03:58:28Z")

</div>

You can define a function without adding any methods to it with the:

```
function foo end

```

syntax. This makes the binding `foo` available as a function, but upon calling it you’ll get a method error. Most any Julia user quickly realizes that method errors occur when an implementation is missing.

---

<div class="post-metadata">

**Author:** ![ratan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ratan/32/2125_2.png) [@ratan](https://discourse.julialang.org/u/ratan)\
**Post date:** [October 9, 2017, 2:30pm UTC](https://discourse.julialang.org/t/stubbing-in-julia/6341/3 "2017-10-09T14:30:03Z")

</div>

Perfect, I forgot that was syntactically allowed. Thanks!
