Click here to Skip to main content
15,886,362 members

The Insider News

   

The Insider News is for breaking IT and Software development news. Post your news, your alerts and your inside scoops. This is an IT news-only forum - all off-topic, non-news posts will be removed. If you wish to ask a programming question please post it here.

Get The Daily Insider direct to your mailbox every day. Subscribe now!

 
NewsWho has plans for making a "The end is nigh" placard? Pin
PIEBALDconsult29-Dec-22 7:41
mvePIEBALDconsult29-Dec-22 7:41 
GeneralRe: Who has plans for making a "The end is nigh" placard? Pin
Gary R. Wheeler30-Dec-22 3:56
Gary R. Wheeler30-Dec-22 3:56 
GeneralRe: Who has plans for making a "The end is nigh" placard? Pin
Richard Andrew x6431-Dec-22 17:51
professionalRichard Andrew x6431-Dec-22 17:51 
NewsHackers abuse Google Ads to spread malware in legit software Pin
Kent Sharkey29-Dec-22 7:31
staffKent Sharkey29-Dec-22 7:31 
GeneralRe: Hackers abuse Google Ads to spread malware in legit software Pin
Nelek30-Dec-22 10:43
protectorNelek30-Dec-22 10:43 
NewsPony Pin
Kent Sharkey29-Dec-22 7:31
staffKent Sharkey29-Dec-22 7:31 
GeneralRe: Pony Pin
Marc Clifton29-Dec-22 9:30
mvaMarc Clifton29-Dec-22 9:30 
GeneralRe: Pony Pin
trønderen29-Dec-22 13:05
trønderen29-Dec-22 13:05 
I tried - without success - to find the source for your quote, but didn't want to spend all evening searching Smile | :)

You make it sound as if you ask "why the h...". Smile | :) For a few years, I was programming in Planc, a (proprietary) system language that provided this behavior, through the :=: assignment operator. This language was read left-to-right, with =: as the 'normal' assignment operator, so b =: a =: c would store b into c, while b :=: a =: c would store the (old) value of a into c.

We used :=: so frequently that I have missed it in all languages I have been working in since then. If you want to propagate any value at all from an assignment operation, it is far more likely to be the old value before it disappears than the new one, which remains available in the variable. E.g. a full swap is b :=: a =: b. Linking in an object at the head of the list is newobject :=: headptr =: newobject.next, unlinking the head object is head.next :=: head =: unlinkedobject. Especially in list/pointer handling, it was a very convenient operator. Also, we used it all the time when writing logs, such as writelog("Time for this step: ", 0 :=: timer). Or you could see if a new value is actually a modification: newvalue :=: oldval <> oldval =: valuehaschanged.

Having both alternatives =: and :=: available was of course very convenient. If I had to make a choice of one, I'd go for the :=: semantics. You could easily 'simulate'=: by b :=: a; b := c, and the compiler should have no problems generating just as good code as for b =: a =: c.

The machines programmed in this language always had (thread safe) SWAP machine instructions for all data types, so =: generated a STOre instruction, while :=: generated a SWAP, not requiring any intermediate location. In other words: Providing :=: had minimal effect on the compiler.

(Edit: Corrected typo in the 'full swap' example)

Bonus 'Weird and Wonderful':

A rather complex use of expression value propagation, from another language (MARY) that also is read left-to-right, and also has the :=: operator:
C#
IF A :=: C > B THEN VECT1
ELSE VECT2
FI (INDEX)
=: CASE J IN 
   1: X :- REF INT,
   2: Y
   OUT Z
ESAC;
Here, A is stored in C, and if the old value of C is larger than B, then you pick a value from the array VECT1, otherwise you pick a value from array VECT2. In either case, you select the element by INDEX. Where you put the value of the selected array element depends on J: If J = 1, it goes into whatever location the X pointer refers to. If J = 2, it goes into the plain variable Y. For all other values, it goes into Z.

I am definitely not saying that this code is "readable" Smile | :) - I guess the authors of 'Mary Textbook' just wanted to show off ...

modified 30-Dec-22 9:56am.

GeneralRe: Pony Pin
Marc Clifton30-Dec-22 3:38
mvaMarc Clifton30-Dec-22 3:38 
NewsLastPass password vaults crackable for $100, alleges 1Password Pin
Kent Sharkey29-Dec-22 7:16
staffKent Sharkey29-Dec-22 7:16 
Newsthe latest issue of Quanta Math and Science (online, free) PinPopular
BillWoodruff29-Dec-22 5:36
professionalBillWoodruff29-Dec-22 5:36 
NewsSpray-on smart skin uses AI to rapidly understand hand tasks Pin
Kent Sharkey28-Dec-22 11:46
staffKent Sharkey28-Dec-22 11:46 
GeneralRe: Spray-on smart skin uses AI to rapidly understand hand tasks Pin
Nelek30-Dec-22 10:49
protectorNelek30-Dec-22 10:49 
GeneralRe: Spray-on smart skin uses AI to rapidly understand hand tasks Pin
Kent Sharkey30-Dec-22 11:08
staffKent Sharkey30-Dec-22 11:08 
NewsBack end developer skills you need to know Pin
Kent Sharkey28-Dec-22 11:46
staffKent Sharkey28-Dec-22 11:46 
GeneralRe: Back end developer skills you need to know Pin
Nelek30-Dec-22 11:06
protectorNelek30-Dec-22 11:06 
NewsMicrosoft calls out FTC lawsuit as unconstitutional Pin
Kent Sharkey28-Dec-22 11:31
staffKent Sharkey28-Dec-22 11:31 
GeneralRe: Microsoft calls out FTC lawsuit as unconstitutional Pin
obermd29-Dec-22 3:19
obermd29-Dec-22 3:19 
GeneralRe: Microsoft calls out FTC lawsuit as unconstitutional Pin
Richard Andrew x6431-Dec-22 17:55
professionalRichard Andrew x6431-Dec-22 17:55 
GeneralRe: Microsoft calls out FTC lawsuit as unconstitutional Pin
David O'Neil29-Dec-22 21:16
professionalDavid O'Neil29-Dec-22 21:16 
NewsIt's the end of programming as we know it -- again Pin
Kent Sharkey28-Dec-22 11:31
staffKent Sharkey28-Dec-22 11:31 
NewsHow to prevent Shift-Left approach from making developers' jobs harder Pin
Kent Sharkey28-Dec-22 8:46
staffKent Sharkey28-Dec-22 8:46 
GeneralRe: How to prevent Shift-Left approach from making developers' jobs harder Pin
Marc Clifton28-Dec-22 9:48
mvaMarc Clifton28-Dec-22 9:48 
GeneralRe: How to prevent Shift-Left approach from making developers' jobs harder Pin
obermd28-Dec-22 11:05
obermd28-Dec-22 11:05 
GeneralRe: How to prevent Shift-Left approach from making developers' jobs harder Pin
Daniel Pfeffer28-Dec-22 19:41
professionalDaniel Pfeffer28-Dec-22 19:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.