Value assigned to a variable or variable assigned to a name

It always bothers me. I hope for the help of my native English who can speak their language.

Let's say I have:

x: = 5

I can say that "x is assigned 5". Good. But then I put forward an excuse. Which of the following expresses what is happening: "5 is assigned x" or "x is assigned 5"?

I can get one intuition by drawing an analogy with “name is assigned to value”, so that means “x is assigned to 5”. But then I can also say that "the value is assigned to the name" without "to", which indicates that "5 is assigned x" will be correct, and I am absolutely sure that this is the opposite.

+3
source share
3 answers

I am not a native English speaker, but I think it’s about the same as “John was assigned the role of R” (= “the role of R was assigned to John”). In your example, I would say that "the value 5 is assigned to X" or (a little more confusing) "X is assigned the value 5".

+3
source

I would read it as "the value 5 is assigned to the variable x".

Or in your terminology - the literal value 5 is assigned to a variable named x.

+1
source

X 5. 5 x.

. 5 . x: = 5 y: = 5. x 5, , y 5. 1 . , x 1 , y 1 , ? 5, . 5.

So, it’s right to say that “5 is assigned x.”

+1
source

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


All Articles