The scoping operator used in many object oriented, or OO programming languages to specify what class, object (and/or namespace in c++) a function or variable belongs to. If you see the following code:

	std::cout

This would tell you that the output stream instance cout belonged to the namespace std.


And for those of you giggling over "std" in the peanut gallery, maybe you can share what's so funny with us coders? :)

18.09.01: Thanks to Wicker808 for the factual corrections!

In Haskell, the :: operator stands for "has type", and is used in the type signatures of functions. For example, the signature of length looks like this:

length :: [a] -> Integer

This specifies that the function "length" has type: "map a list of type a onto an integer"; that is, it takes a list of a generic type (call it 'a') and returns an integer.

A lesser-known smiley or emoticon, which represents a person flaring his/her nostrils very wide, while keeping his/her mouth very tightly closed. Rarely used, as nobody is sure what emotion it is supposed to signify.

Also a symbol that means 'has a similar relationship to'. This usage is almost always found on the SATs and other standardized tests.

Example:

fish:water::worm:?

  1. bird
  2. earth
  3. dog
  4. sidewalk

Many years ago, in chatrooms, double-colons were used to set off actions, as opposed to things you were saying. Actions were written in third-person.

Example:
::smiles::
::opens his backpack and pulls out a small lantern::
::hugs LadyFyr497::

The first place I ever encountered double-colons was in AOL's Red Dragon Inn, back in 1995 or so, when I first got a modem. I still use them in chatrooms today, well, except ones that recognize /me. Maybe I'm just a sucker for mid-to-late 90's alternative culture.

Easily much classier than emoticons.

One more example of forgotten netiquette.

In SML, :: is called "cons", and is the infix operator for adding an element at the front of a list. For example, 5::[6,7] results in the list [5,6,7].

:: is right associative, so the expression 1::2::3::nil makes sense and means 1::(2::(3::nil)).

When performing pattern matching, :: is used to decompose a list into the first element (the head) and the rest of the list (the tail). Here is a small function that returns the sum of all elements in a list:

fun sum [] = 0
 |  sum (x::xs) = x + sum xs;

If x::xs is matched with a list then x is the first element in the list, and xs the rest of the list.

:: is used on the HP 48 series and HP 49 series calculators as the opening mark for a "secondary object", which is closed with ;. Secondaries are usually used to group a number of commands and functions for a SystemRPL program, but can be used to hold any other objects together as well, like a list (which on the calculator is delimited by { and }). Lists and secondaries are both examples of composite objects, and thus share many commands on the calculator. The :: and ; are similar to { and } in C, Java, and quite a few other languages.

:: also refers to "a whole heap" of zeros in an IPv6 address.

Due to the massive address space available with the IPv6 addressing scheme, its inevitable that many addresses will contain long sequences of zeros. In order to make writing these addresses easier, a special syntax is available to compress the zeros, the guidelines of which are:

  • The use of "::" indicates multiple groups of 16-bits of zeros.
  • The "::" can only appear once in an address.
  • The "::" can also be used to compress the leading and/or trailing zeros in an address.

For example the following addresses:

1080:0:0:0:8:800:200C:417A (a unicast address)
FF01:0:0:0:0:0:0:101 (a multicast address)
0:0:0:0:0:0:0:1 (the loopback address)
0:0:0:0:0:0:0:0 (the unspecified addresses)
may be represented as:
1080::8:800:200C:417A (a unicast address)
FF01::101 (a multicast address)
::1 (the loopback address)
:: (the unspecified addresses)

And remember kids, if you dont have access to it already, hassle your ISP as the end of IPv4 address space is nigh!


Rules and examples shamelessly copied from RFC2373 "IPv6 Addressing Architecture" http://www.ietf.org/rfc/rfc2373.txt

Log in or register to write something here or to contact authors.