Technically: bitstring -> A binary that is 1-bit aligned, so it could be, say, 6 bits long, or 35 bits, or whatever. binary -> A binary that is 8-bit aligned, this is the one that should almost always be used unless you have some specialized network packet parsing or so, this is also what a String is in Elixir. A bitstring is a binary (so strings would go there), however if you gave it a binary that was not 8-bit aligned then most things trying to use it would loudly break. A binary is not a bitstring. Thus if you only want Strings then use binary. :-)
On Thursday, July 21, 2016 at 11:51:43 AM UTC-6, ...Paul wrote: > > On Thu, Jul 21, 2016 at 10:27 AM, OvermindDL1 <overm...@gmail.com > <javascript:>> wrote: > >> Also, unless you specifically want to support bitstrings (non-aligned >> binaries), then you probably want your guard to be `is_binary/1` instead of >> `is_bitstring/1`. :-) >> > > Dagnabbit. I thought bitstring was what appropriately handled wide > characters, and binary could be anything. That's a wee bit confusing, that > bitstrings are actually "random binaries" and binaries are "strings"? :P > > BTW, thanks for the tip on using module_info! > > ...Paul > > > -- You received this message because you are subscribed to the Google Groups "elixir-lang-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-talk+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-talk/24ab8a1a-2558-4028-8d83-a9ec1dd8c30a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.