What does “:=” do?

前端 未结 10 1733
别那么骄傲
别那么骄傲 2020-12-04 10:47

I\'ve seen := used in several code samples, but never with an accompanying explanation. It\'s not exactly possible to google its use without knowing the proper

10条回答
  •  忘掉有多难
    2020-12-04 11:23

    Colon-equals was used in Algol and its descendants such as Pascal and Ada because it is as close as ASCII gets to a left-arrow symbol.

    The strange convention of using equals for assignment and double-equals for comparison was started with the C language.

    In Prolog, there is no distinction between assignment and the equality test.

提交回复
热议问题