# Problem with pop!

**URL:** <https://discourse.julialang.org/t/problem-with-pop/30627>\
**Category:** General Usage\
**Created:** [November 2, 2019, 4:03pm UTC](https://discourse.julialang.org/t/problem-with-pop/30627 "2019-11-02T16:03:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Caterina\_Cerutti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/caterina_cerutti/32/11096_2.png) [@Caterina\_Cerutti](https://discourse.julialang.org/u/Caterina_Cerutti)\
**Post date:** [November 2, 2019, 4:03pm UTC](https://discourse.julialang.org/t/problem-with-pop/30627/1 "2019-11-02T16:03:07Z")

</div>

![image](https://global.discourse-cdn.com/julialang/original/3X/c/6/c6dcd46169f1763dd8b214c17f034fb4154c346c.jpeg)

I don’t understand why it doesn’t recognise the function pop!. Can someone help me please?

---

<div class="post-metadata">

**Author:** ![jbmuir](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jbmuir/32/4798_2.png) [@jbmuir](https://discourse.julialang.org/u/jbmuir)\
**Post date:** [November 2, 2019, 4:46pm UTC](https://discourse.julialang.org/t/problem-with-pop/30627/2 "2019-11-02T16:46:30Z")

</div>

The method error gives a good clue as to why this is - in Julia, multiple functions share the same name, and Julia picks which one to use based on the types of the arguments you supplied (this is known as multiple dispatch). In your case, you supplied `a_ray` (an `Array{Int64,1}`) and `4` an `Int64`; there is no function `pop!` defined for those types so you get an error.

You can see that final function in the Closest Candidates operates on `Array{Int64,1}` with no integer after; you can see this behaviour in [Collections and Data Structures · The Julia Language](https://docs.julialang.org/en/v1/base/collections/#Base.pop)!  
(arrays are an ordered container)

In general, if you get errors like this it is often helpful to go to the Julia docs and search for your function there so that you can see examples about how it should be used.

PS - there are some useful style guides for how to post questions on this forum such that people here can best help you here: [https://discourse.julialang.org/t/psa-make-it-easier-to-help-you](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you)

---

<div class="post-metadata">

**Author:** ![simeonschaub](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simeonschaub/32/216566_2.png) [@simeonschaub](https://discourse.julialang.org/u/simeonschaub)\
**Post date:** [November 2, 2019, 5:01pm UTC](https://discourse.julialang.org/t/problem-with-pop/30627/3 "2019-11-02T17:01:12Z")

</div>

For what you want to do, you might want to take a look at [Base.deleteat!](https://docs.julialang.org/en/v1/base/collections/#Base.deleteat!).
