Hacker News new | past | comments | ask | show | jobs | submit login

Same reason for Red aswell as for Rebol. There are many more primitive/literals like that, tuple! [1] for example is used to represent RGB colors (255.0.255), ipv4 addresses (192.168.0.1) or even version numbers (2.7.8). Time/Date [2][3] also are basic datatypes with proper literal form.

From Rebol console (these types not yet all implemented in Red):

  >> red + blue
  == 255.0.255
  >> 192.168.100.123 and 255.0.0.0
  == 192.0.0.0
  >> yesterday: now/date - 24:00
  == 15-Nov-2014
  >> in-one-year: now + 365
  == 16-Nov-2015
  >> yesterday < in-one-year
  == true
Rebol provides around 55 datatypes, with a good part of them having a specific literal form. The standard library is actually built-in the language, through this rich set of datatypes (each datatype overloads the basic language functions and operators). You don't need to "import" any of it, it's right there, but almost transparent to the users. The footprint for that is small, the full uncompressed runtime in binary form is about 500KB only.

This unusual (but very effective in practice) approach, is one of the features that got me hooked to Rebol in the first place, 15 years ago.

[1] http://www.rebol.com/docs/core23/rebolcore-16.html#section-3...

[2] http://www.rebol.com/docs/core23/rebolcore-16.html#section-3...

[3] http://www.rebol.com/docs/core23/rebolcore-16.html#section-3...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: