In general, there are no standards for pseudo-code. Everybody can design their own pseudo-code however they want to. Normally, an author should define the conventions they use for their pseudo-code.
Unfortunately, pseudo-code is often used without documenting it, under the assumption that it will be "obvious" to the reader what the code means. As you have discovered, what is and isn't obvious to the reader obviously depends on the reader!
In my case, the snippet you posted is obvious to me, because I am used to programming languages that use the ←
operator symbol in the same way: Scala, Haskell, historic Smalltalk.
Arrows generally are used to indicate that "some thing" is "flowing" in the direction of the arrow. A rightwards arrow typically means "goes to" in the sense of a mapping or a function. A leftwards arrow typically means "becomes" or "let" or "draws from". However, arrows can also indicate message sends or receiving messages. You have to be aware of the context.
This code looks like it is simple imperative structured programming code, so the "assignment" meaning is the more likely interpretation, but if this where pseudo-code for some process calculus, an asynchronous, concurrent, parallel, or distributed algorithm or data structure, or something along those lines, it could likely also mean "blocks until it receives a message" or something like that.
In this particular case, the two leftwards arrows have slightly different, but strongly related meaning:
The second one simply means "Legal
becomes True
", so this is a form of assignment. (This assignment syntax was actually used by historic Smalltalk versions.)
The first one also means assignment, but it is interpreted to mean that j
takes all the values on the right-hand side, one after the other. In other words, this is a FOREACH
iterator loop. (Scala actually uses the leftwards arrow in precisely this meaning in its for
comprehensions.)
:=
. (In between, it used_
which is the ASCII character with the same encoding as←
had in the original encoding.) Haskell also uses it in monad comprehensions and list comprehensions, Scala uses it infor
comprehensions. $\endgroup$=
is also possible, but using<-
is still more common. $\endgroup$i=i+1
this does not get confused by a math equation. $\endgroup$