Menu

#6 ignore keyword and ~ operator

open
nobody
None
5
2002-12-16
2002-12-16
jbrown
No

In PEU, I added "ignore" and '~', which do the same thing.

~wait_key()

for example, the above will wait for a key, but the result is ignored.

its the exact same as below:

object VOID
VOID = wait_key()

however its much faster to type ;)

for readability, you can also use ignore:

ignore wait_key()
ignore graphics_mode(-1)
ignore seek(-1)

for some examples.

Basicly, ~ takes a value, and does nothing with it. Its perfect for dumping
an unwanted result, while explicitly showing a result is being dumped,
and also its short enough so ppl cant complain of having to type it over
and over ;)

Discussion

MongoDB Logo MongoDB