What are the primitive Forth operators? [closed]

This thread covers your exact question. Here is a soup-to-nuts implementation with complete documentation. I wrote a subroutine threaded Forth targeting 68K when I was in college. I defined the runtime environment and dictionary format, then wrote some C code that boot strapped a Macintosh application that loaded a default dictionary, populated some I/O vectors … Read more

What does the arrow (“->”) operator do in Kotlin?

The -> is part of Kotlin’s syntax (similar to Java’s lambda expressions syntax) and can be used in 3 contexts: when expressions where it separates “matching/condition” part from “result/execution” block val greet = when(args[0]) { “Apple”, “Orange” -> “fruit” is Number -> “How many?” else -> “hi!” } lambda expressions where it separates parameters from … Read more

What does “:=” do?

http://en.wikipedia.org/wiki/Equals_sign#In_computer_programming In computer programming languages, the equals sign typically denotes either a boolean operator to test equality of values (e.g. as in Pascal or Eiffel), which is consistent with the symbol’s usage in mathematics, or an assignment operator (e.g. as in C-like languages). Languages making the former choice often use a colon-equals (:=) or ≔ … Read more

How does the bitwise complement operator (~ tilde) work?

Remember that negative numbers are stored as the two’s complement of the positive counterpart. As an example, here’s the representation of -2 in two’s complement: (8 bits) 1111 1110 The way you get this is by taking the binary representation of a number, taking its complement (inverting all the bits) and adding one. Two starts … Read more

tech