How to put an object from an array in Julia, its refrences

I am trying to remove a specific object from an array

I have an array with an Object Family defined by me

A =[Family(), ....]

I am implementing a function minimumso that I can pass an array Aand get an object

family = minimal(A)

and then I want to remove this object from the array A

pop!(A , family)

I got error pop! has no method matching pop!...

I was looking for the correct version of the pop method, but I did not find anything that I can use, any idea how to repair this code?

+2
source share
1 answer

pop!should jump out from the very last pressed object. In fact, deleteat!this is what you were looking for:

deleteat!(A, index)

you can get the index directly from a function minimal, I think.

+6
source

Source: https://habr.com/ru/post/1686376/


All Articles