Live data from Hacker News

Why Does “=” Mean Assignment?

hillelwayne.com

61–70 of 367 posts

Re: Why Does “=” Mean Assignment?

#62
post #2

The '=' sign is used because after that statement the variable will indeed have equality with the r-value. Coincidentally in async languages like Verilog there is a another assignment operator '<=' which means that the variable won't take the new value until the next clock cycle (or more explicitly the next evaluation of the process block). '=' exists also and has the same meaning as with traditional languages.

By that logic,

    a 
Should set a to the minimum of a and 1. I.e. after that statement the variable will indeed be less than or equal to the RHS.

Re: Why Does “=” Mean Assignment?

#63
post #21

Earlier quoted context omitted.

Ditto. Fun fact: various dialects of BASIC let you optionally put LET before your assignment statements. So the following are equivalent: X = 10 LET X = 10

Wait...LET was optional? Auigh! Whole months of my childhood, wasted!

Depended on the dialect. Whatever we had on my first PC as a kid, it was mandatory. Later, in HS, when we used BASIC for a first CS course, it was optional.

Re: Why Does “=” Mean Assignment?

#64
> Prolog came out the same year as C and popularized logic programming, and you can sort of fake assignment with cuts.

Can anyone explain to me what this is supposed to mean? (I know Prolog, I understand cuts very well. But I don't know what the author means here.)

Re: Why Does “=” Mean Assignment?

#65
post #2

The '=' sign is used because after that statement the variable will indeed have equality with the r-value. Coincidentally in async languages like Verilog there is a another assignment operator '<=' which means that the variable won't take the new value until the next clock cycle (or more explicitly the next evaluation of the process block). '=' exists also and has the same meaning as with traditional languages.

By that logic, a Should set a to the minimum of a and 1. I.e. after that statement the variable will indeed be less than or equal to the RHS.

Languages borrowing the syntax don't need to follow its logical consistency. I just thought it was an interesting anecdote.

Re: Why Does “=” Mean Assignment?

#68
post #12

Bcpl still exists in 2018?

Here's a PDF about running BCPL on a Raspberry Pi: http://www.cl.cam.ac.uk/~mr10/bcpl4raspi.pdf It's aimed at teaching programming to 10 year olds no prior experience. One of the first examples is implementing RSA.

Implementing a cryptosystem is one of the first things for 10 year olds with no prior programming experience???? That seems intense compared to Scratch, etc.

Re: Why Does “=” Mean Assignment?

#69
post #57
post #56

Earlier quoted context omitted.

I don't think I've heard of this before; I'd love to watch it if you have a link!

I'd also want to see the link, if available!

This is from a few years ago, my first time giving it, and I've never had the courage to actually watch it, so ymmv.

https://youtu.be/E18shi1qIHU

Re: Why Does “=” Mean Assignment?

#70
post #15

The length of symbols should roughly be negatively correlated with its frequency. Since in procedural language, assignment is a much more common operation than equality check, it is reasonable to favor "=" over ":=" or even "<-".

So you have a key with the assignment operator on.
Post reply on HN