email@example.com firstname.lastname@example.org g@
Email! values allow for directly expressing email addresses, e.g.
Email! is a member of the following typesets:
Email values can be created using literal syntax, or at runtime using a
make constructor or a
3. Literal syntax
One or more characters, followed by the
@ symbol, followed by zero or more additional characters.
4. Runtime creation
>> f: make email! "foo" == foo >> type? f == email!
>> b: to email! 'bar == bar >> type? b == email!
5. Path accessors
Path accessors provide a convenient way for getting or setting the user name or host name of an email value.
>> e: email@example.com == firstname.lastname@example.org >> e/user == "me" >> e/user: "you" == "you" >> e == email@example.com
>> e/host == "me.net" >> e/host: "red-lang.org" == "red-lang.org" >> e == firstname.lastname@example.org
All comparators can be applied on
=, ==, <>, >, <, >=, <=, =?. In addition,
max are also supported.
7. Testing values
email? to check if a value is of the
>> email? email@example.com == true
type? to return the datatype of a given value.
>> type? firstname.lastname@example.org == email!
8. Predefined words