# Getter functions with constant output

**URL:** <https://discourse.julialang.org/t/getter-functions-with-constant-output/117853>\
**Category:** General Usage\
**Tags:** question, book\
**Created:** [August 5, 2024, 6:34pm UTC](https://discourse.julialang.org/t/getter-functions-with-constant-output/117853 "2024-08-05T18:34:58Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![awasserman](https://avatars.discourse-cdn.com/v4/letter/a/9de0a6/32.png) [@awasserman](https://discourse.julialang.org/u/awasserman)\
**Post date:** [August 5, 2024, 9:05pm UTC](https://discourse.julialang.org/t/getter-functions-with-constant-output/117853/5 "2024-08-05T21:05:52Z")

</div>

See more discussion here:

> [@Defining methods without binding variables](https://discourse.julialang.org/t/defining-methods-without-binding-variables/112485):
>
> I’ve seen many examples of Julia code where methods are defined without any variable name bindings. My usage of terminology my be inaccurate here, but for example: eltype(::Type{\<:AbstractArray{T}}) where {T} = T As far as I can tell, this is equivalent to the following code. eltype(S::Type{\<:AbstractArray{T}}) where {T} = T But since we don’t need to do any computation with the value S, we don’t need to bind the value to this symbol, so we can just use the first way of defining the method,…

I’ve got a docs PR that I should really try to get merged that names and describes this pattern as “anonymous arguments”, as previously suggested.

> <https://github.com/JuliaLang/julia/pull/53948>
>
> Added a description of "anonymous arguments" in the methods section of the manua…l, based on this forum discussion:
> 
> https://discourse.julialang.org/t/defining-methods-without-binding-variables/112485
> 
> This PR chooses a name for the pattern of defining methods without binding values to variables ("anonymous arguments"), and it describes the use of this pattern.
> 
> Someone with a better understanding of the intention of this functionality should review this, as I'm writing it from the perspective of a user rather than a developer.

---

_[View the full topic](https://discourse.julialang.org/t/getter-functions-with-constant-output/117853)._
