Data types built in

For you as a developer to work with data efficiently, Red has more than 45 and counting built-in data types, from common types such as integers, chars, and strings to less common ones, such as pairs, tuples, files, URLs, emails, and so on. Moreover, you use the same set of operations to work with them, which greatly eases the learning curve. To do that in other languages, you would have to create objects from specialized classes to start working with them, or even import a library. As a first example, you can add and subtract days from a date value simply as follows:

;-- see Chapter01/special.red:1-Feb-2018 + 14         ; == 15-Feb-20181-Feb-2018 – 42         ; == 21-Dec-2017

Get Learn Red - Fundamentals of Red now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.