JuliaLang/julia — pull request #9350 by sbromberger (2014-12-14 03:34:31+00:00)
Title: Ipnetwork.jl

Many changes here, but the bottom line is that two new concrete types have been introduced: `IPv4Net` and `IPv6Net`, and they provide network/subnet representation. They can approximate collections of `IPv4` and `IPv6` types (with `contains` and `in` functioning as expected).

The IP-specific code was getting pretty big, so I moved it out of `socket.jl` into `ipnetwork.jl` and simply did an `include("ipnetwork.jl")` in `socket.jl`. I added the IPv4Net and IPv6Net types to `base/exports.jl` as well.

I created a `repr`/`string` function for `IPv6` based on the old `print` function, and modified `print` to just call this `string` function (I needed a string for the `IPv6Net` type).

See https://gist.github.com/sbromberger/4acc9694b1b580241278 for examples.