# No more 'isprime' function in Julia 1.9.3？

**URL:** <https://discourse.julialang.org/t/no-more-isprime-function-in-julia-1-9-3/107069>\
**Category:** General Usage\
**Tags:** question\
**Created:** [December 3, 2023, 6:16am UTC](https://discourse.julialang.org/t/no-more-isprime-function-in-julia-1-9-3/107069 "2023-12-03T06:16:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jiang\_ming\_zhang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jiang_ming_zhang/32/204063_2.png) [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Post date:** [December 3, 2023, 6:16am UTC](https://discourse.julialang.org/t/no-more-isprime-function-in-julia-1-9-3/107069/1 "2023-12-03T06:16:04Z")

</div>

I typed ?, then isprime, and got the message

> Couldn’t find isprime

But I saw this function in the [video](https://www.youtube.com/watch?v=p7JSWCxbJd0)

Is the function deleted?

---

<div class="post-metadata">

**Author:** ![abraemer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abraemer/32/51403_2.png) [@abraemer](https://discourse.julialang.org/u/abraemer)\
**Post date:** [December 3, 2023, 6:37am UTC](https://discourse.julialang.org/t/no-more-isprime-function-in-julia-1-9-3/107069/2 "2023-12-03T06:37:20Z")

</div>

This function can be found in the package [`Primes.jl`](https://github.com/JuliaMath/Primes.jl). So you need to do `Pkg.add("Primes")` aonce to add to the current environment and then you can load it with `using Primes`. Afterwards the function `isprime` will be available.

---

<div class="post-metadata">

**Author:** ![jiang\_ming\_zhang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jiang_ming_zhang/32/204063_2.png) [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Post date:** [December 3, 2023, 6:41am UTC](https://discourse.julialang.org/t/no-more-isprime-function-in-julia-1-9-3/107069/3 "2023-12-03T06:41:22Z")

</div>

For a guy used to MATLAB, the ‘using’ practice is annoying.

---

<div class="post-metadata">

**Author:** ![TheCedarPrince](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thecedarprince/32/17323_2.png) [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)\
**Post date:** [December 3, 2023, 6:51am UTC](https://discourse.julialang.org/t/no-more-isprime-function-in-julia-1-9-3/107069/4 "2023-12-03T06:51:25Z")

</div>

Yea, having used MATLAB for a while, the change-up can be a bit onerous at first. It does get a bit easier with time. Also, a pattern that is valid both in Julia and Python is something like:

```julia
import Primes:
    isprime

# rest of your code here

```

You can exactly see where things are coming from where sometimes finding the right toolbox in MATLAB can be a little tricky. Hope that helps makes the transition a little easier!

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [December 3, 2023, 7:17am UTC](https://discourse.julialang.org/t/no-more-isprime-function-in-julia-1-9-3/107069/5 "2023-12-03T07:17:37Z")

</div>

It might be worth nothing why we have the “`using` practice”.

1. **Reduced startup time** : Loading all features/packages automatically on startup would take quite some time. And it would be largely unnecessary because we would load all kinds of features that you’re not going to use anyways. (I might have used `isprime` like once or twice in over 7 years of using Julia.)

2. **Faster development** : Backed in features are tied to the Julia release cycle (say, ~ 2 releases per year). Packages (that you load via `using`) can move much faster and tag new releases - with new amazing features - at a much higher frequency. (Imagine `isprime` had a bug and you would have to wait half a year for the fix to land in a new Julia version.)

3. **Extensibility** : Everyone can create there own package and than load it via `using`. No need to “ask for permission” or to debate with the Julia devs about whether this feature is (generally) useful enough to be baked into Julia itself.

(There are likely more reasons but those are the most important ones IMO.)

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [December 3, 2023, 7:21am UTC](https://discourse.julialang.org/t/no-more-isprime-function-in-julia-1-9-3/107069/6 "2023-12-03T07:21:39Z")

</div>

One more thing, you can load all the packages that you regularly need in your `startup.jl` so that you don’t have to type `using ...` all the time. Or create your own “superpackage” that just loads all relevant packages and re-exports all features. In this case, it would just be a single `using AllMyTools`.
