# Why fdistccdf function is ccdf?

**URL:** <https://discourse.julialang.org/t/why-fdistccdf-function-is-ccdf/87771>\
**Category:** New to Julia\
**Tags:** question, package\
**Created:** [September 25, 2022, 8:52am UTC](https://discourse.julialang.org/t/why-fdistccdf-function-is-ccdf/87771 "2022-09-25T08:52:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![xuanquansheng](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xuanquansheng/32/32400_2.png) [@xuanquansheng](https://discourse.julialang.org/u/xuanquansheng)\
**Post date:** [September 25, 2022, 8:52am UTC](https://discourse.julialang.org/t/why-fdistccdf-function-is-ccdf/87771/1 "2022-09-25T08:52:39Z")

</div>

I see a code as follows:

```julia-auto
p = fdistccdf(dof_, dof_tstat_, F)
# source code of pkg FixedEffectModels

```

 ![image](https://global.discourse-cdn.com/julialang/original/3X/5/7/57ae36c017b5cfbf170bb17b7cb5e74efed133eb.png)

# it can be seen this function is in pkg `StatsFuns`

So I click it in the VS code, it jumps to

 ![image](https://global.discourse-cdn.com/julialang/original/3X/5/2/5210a928e069723104407a8bd0d0ffc561aebfa7.png)

- so why a function named `fdistccdf` will be math with `ccdf`?
- is the dollar sign cause this? What does it mean?

---

<div class="post-metadata">

**Author:** ![sgaure](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sgaure/32/14779_2.png) [@sgaure](https://discourse.julialang.org/u/sgaure)\
**Post date:** [September 25, 2022, 9:33am UTC](https://discourse.julialang.org/t/why-fdistccdf-function-is-ccdf/87771/2 "2022-09-25T09:33:27Z")

</div>

It is the `$`, yes. If you look further up in the file you’ll see that the definition is inside a `quote`. The `$` signifies that the value of the following expression (`ccdf`, and `pdecls...`, `pargs...`, etc) from outside the `quote` should be inserted there. The variables `ccdf`, `pfun`, `pargs`, and `pdecls` are defined before the `quote`. The definition means that the `fdistccdf` is a call to a compiled function (via `ccall`).

This is an example of metaprogramming, i.e. construction of julia expressions from strings and other things. It is described here: [https://docs.julialang.org/en/v1/manual/metaprogramming/](https://docs.julialang.org/en/v1/manual/metaprogramming/)

---

<div class="post-metadata">

**Author:** ![xuanquansheng](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xuanquansheng/32/32400_2.png) [@xuanquansheng](https://discourse.julialang.org/u/xuanquansheng)\
**Post date:** [September 25, 2022, 10:30am UTC](https://discourse.julialang.org/t/why-fdistccdf-function-is-ccdf/87771/3 "2022-09-25T10:30:10Z")

</div>

> [@sgaure](#):
>
> If you look further up in the file you’ll see that the definition is inside a `quote`. The `$` signifies that the value of the following expression (`ccdf`, and `pdecls...`, `pargs...`, etc) from outside the `quote` should be inserted there.

It help me to understand this code perfectly, thx. So packages of julia may need more document, or it’s hard to understand.
