Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

left arrow operator in Julia

I have a vector

a = collect(1:4) 

What is the meaning of a <- a in Julia [result – false]

As per the documentation <- is not an assignment operator in Julia.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Here is a way to check it (so that in the future you will be able to solve similar problems more easily):

julia> dump(:(a <- a))
Expr
  head: Symbol call
  args: Array{Any}((3,))
    1: Symbol <
    2: Symbol a
    3: Expr
      head: Symbol call
      args: Array{Any}((2,))
        1: Symbol -
        2: Symbol a

So as you can see a <- a is the same as a < (-a) thus you are comparing, using the < operator the a vector with the -a vector.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading