DennisMitchell / jellylanguage

Jelly is a recreational programming language inspired by J.
MIT License
860 stars 47 forks source link

Add integer pair literal, `⁽` #30

Closed jjallan closed 7 years ago

jjallan commented 7 years ago

Makes the integers [-31349,-100] and [1001,32250] available as three byte literals.

The two bytes following are evaluated as a base-250 number with digits of the 1-based code-page indexes. The top half of these are treated as negative numbers much like there being a sign bit. The lowest positive value, 1001, is ⁽¡¡; the largest positive value, 32250, is ⁽|ż; the lowest negative value, -31349, is ⁽}¡ (the next base 250 representation after ⁽|ż); the largest negative value, -100, is ⁽żż.

Note: There is still a little redundancy: the 30 positive multiples of 1000 [e.g. both ⁽/ż and 13ȷ are 13000], the smallest 9 negative multiples of 1000 [e.g. both ⁽ṛc and -7ȷ are -7000], the 9 integers of the form 1000+500*n [e.g. both ⁽!ż and 9.ȷ are 9500], and -500 [ẏc and-.ȷ].