[英]What's the difference between := and => in Ada?
As far as I know, :=
seems to do an assignation by copy. 据我所知, :=
似乎是通过副本进行分配。 The operator =>
seems to do a similar assignation, but is used when assigning a parameter to a member variable of an object. operator =>
似乎执行类似的赋值,但在将参数赋给对象的成员变量时使用。
so... 所以...
receivesTheCopy := isBeingCopied
memberVariable => passedParameter
I'm working on someone else's old code and I have a variable reaching a value that I never see explicitly assigned to it with :=
. 我正在处理其他人的旧代码,并且我有一个变量达到一个我从未看到明确分配给它的值:=
。 I was thinking that maybe when it is assigned to a memberVariable
with =>
it was passed by reference, and thus the passedParameter
variable stayed tied to the memberVariable
state. 我在想, 也许当它被分配给一个带有=>
的memberVariable
,它通过引用传递,因此传递的passedParameter
变量保持与memberVariable
状态的memberVariable
。
:=
is an assignment. :=
是一项任务。
=>
has multiple purposes: =>
有多个目的:
In neither case it has anything to do with pass-by-reference or pass-by-value. 在任何一种情况下,它都与传递引用或传值有关。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.