# New generic procedures feature

**URL:** <https://fortran-lang.discourse.group/t/new-generic-procedures-feature/8917>\
**Category:** Uncategorized\
**Created:** [December 3, 2024, 2:13am UTC](https://fortran-lang.discourse.group/t/new-generic-procedures-feature/8917 "2024-12-03T02:13:55Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![certik](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/certik/32/4_2.png) [@certik](https://fortran-lang.discourse.group/u/certik)\
**Post date:** [December 3, 2024, 2:29pm UTC](https://fortran-lang.discourse.group/t/new-generic-procedures-feature/8917/5 "2024-12-03T14:29:09Z")

</div>

> [@everythingfunctional](#):
>
> They work differently and serve different purposes. Templates are for cases you want to be able to work with types you don’t know about yet. Generic procedures are for when you know all the types you want to work with ahead of time.

Hm, in my mind they serve exactly the same purpose, it’s just a different way you write the requirement, in fact that’s likely how we will implement it also. The `type(real, integer, logical)` in my mind is just a type `T` with a requirement `real | integer | logical` meaning only those types can work. In fact it’s been requested to be able to write requirements in this way, see the examples in [Traits, Generics, and modern-day OO for Fortran](https://fortran-lang.discourse.group/t/traits-generics-and-modern-day-oo-for-fortran/8426), such as [Traits-for-Fortran/Code/Fortran/functional1.f90 at 51778c3a6ca47c9eda20e4450fe81708c67398b2 · difference-scheme/Traits-for-Fortran · GitHub](https://github.com/difference-scheme/Traits-for-Fortran/blob/51778c3a6ca47c9eda20e4450fe81708c67398b2/Code/Fortran/functional1.f90).

How do these templates work differently? I can’t see any difference, except the slightly different / incompatible syntax? It would be good to unify it. Do you also call it with the `^()` syntax to specify exact types?

---

_[View the full topic](https://fortran-lang.discourse.group/t/new-generic-procedures-feature/8917)._
