5 ms·
"<-" as the assignment operator. That's cute. I have also seen "_" as the assignment operator in some old Squeak code though.
by i_feel_great 8y ago
"<-" as the assignment operator. That's cute.
I have also seen "_" as the assignment operator in some old Squeak code though.
- cmrdporcupine 8y agoThe _ symbol is rendered as an arrow in the Squeak environment.
- radiowave 8y agoSqueak used to use a font which had a left-arrow glyph where underscore would normally be.
- jecel 8y agoThe first ASCII draft (1963) had a left arrow and a right arrow which were later replaced by _ and ^. When Smalltalk-80 was developed, it replaced its non standard character set with ASCII but Xerox (like a few other companies) used the older version and that is what got adopted and which Squeak inherited. Smalltalk V was developed on the PC and borrowed := from Pascal to represent assignment supposing that most of its new users would be coming from that language. This became an option for Squeak/Pharo and since using this would free the underscore (with the proper fonts) for names imported from other languages there has been a lot of pressure to rewrite all old code to eliminate the left arrow.
- jecel 8y agoOoops - I meant that left and up arrows were replaced by _ and ^. The up arrow was used to indicate return and Smalltalk V used the caret (^) for that, which was a reasonable approximation.
- orhmeh09 8y agoIn R, <- is the predominant assignment operator, and until 2003 it supported _ as well, for compatibility with its predecessor, S. Here’s a post about it: https://colinfay.me/r-assignment/ https://colinfay.me/r-assignment/ Modern ligatures fonts like Fira Code turn the bracket and dash into an actual arrow, which is nice!
- truculent 8y agoNice link! FWIW, You also see <- within Haskell's do notation. Apparently F# and OCaml use it in places, too: https://en.wikipedia.org/wiki/Assignment_(computer_science)#Notation https://en.wikipedia.org/wiki/Assignment_(computer_science)#...