(no title)
mVChr
|
9 years ago
I've never seen a language with such a variety of built-in data types (e.g. coordinates, tags, email, url, issues). There's support for IPv4 numbers as a base type (tuples) but I can't tell if there's support for IPv6, which shows the trouble with this approach for the language maintainers.
abecedarius|9 years ago
greggirwin|9 years ago
Red doesn't have all types in place yet (e.g. date! is coming, and maybe an @ref type, among others), but can still load the following:
Here's a quick console session showing what types it found: And you can parse at that level: Of course, you could do something similar in ES6. If you use template literals, your data might look like this: Sorry for getting carried away. :)greggirwin|9 years ago
A couple other new features make dealing with non-loadable input easier too. You can use macros to pre-process data, trap errors that `load` triggers and still get back a block of values, or spec some simple rules in `system/lexer/pre-load`. That's another way we might deal with IPv6 values.
greggirwin|9 years ago
eriknstr|9 years ago
In IPv6 or in Red, you mean?
In IPv6 the colons are there for convenience only, with the rule being that leading zeros can be omitted and that two or more consecutive groups of all zeros can be replaced with ::. You can only have one instance of :: otherwise it would be ambiguous.
For example, the IPv6 address ::1 is actually 0000:0000:0000:0000:0000:0000:0000:0001.
Likewise, 2a03:2880:fffe:c:face:b00c:0:35 is actually 2a03:2880:fffe:000c:face:b00c:0000:0035.
Once an IPv6 address has been expanded to it's full non-abbreviated form you can safely strip it of colons and use the resulting hexadecimal value to uniquely represent that address.
If you were talking about colons in Red and not in IPv6, disregard what I said.
throwaway7645|9 years ago
taliesinb|9 years ago
mapcars|9 years ago
throwaway7645|9 years ago
tejtm|9 years ago
http://compsci.ca/v3/viewtopic.php?t=17726