Skip to content
This repository has been archived by the owner on Jan 11, 2022. It is now read-only.

Latest commit

 

History

History
42 lines (23 loc) · 1017 Bytes

basic-data-types.md

File metadata and controls

42 lines (23 loc) · 1017 Bytes

Basic Data Types

Data types are the building blocks of the Deci language. They are the elements the language accepts and understands.

Numbers

  • 4, 4.31, 1,432,567.33, 4.5e12, 15%, 1/3

Dates and time

  • Year ⇒ Y2020
  • Month ⇒ 2020/01 2020/Jan
  • Month, for which deci assumes the current year ⇒ January
  • Day ⇒ date(2020/01/21) date(2020/January/21) date(2020/Jan/21) date(2020-01-21) date(2020-January-21) date(2020-Jan-21)

Ranges and Sequences

Ranges

Ranges are a continuous interval of values occurring between two points, which includes the last point.

You can define a range as follows:

Ascending:

  • [1 through 10]
  • [1..10]

Descending:

  • [10 through 1]
  • [10..1]

Sequences

Sequences are a discrete sequence of values within a range. They can be expressed by defining the range and the step between values:

  • [1..10 by 1][1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
  • [1 through 10 by 1][1, 2, 3, 4, 5, 6, 7, 8, 9, 10]