I decided to implement a new Kap feature today. It's an implementation of the Range function that is already available is some other array languages.
A simple example: The following expression: 5 … 11 will return a new array: 5 6 7 8 9 10 11. The arguments doesn't have to be scalars. If they are arrays, the prefix and suffixes are preserved:
┌→────────────────────────┐
│10 20 3 4 5 6 7 8 100 200│
└─────────────────────────┘
Of course, this feature also allows you to count down:
┌→───────────┐
│10 9 8 7 6 5│
└────────────┘
None of this are things that was particularly difficult to do before this function was introduced, but it does make writing certain expressions much nicer.
The next step is to add support for character arguments as well. For now, only integers are supported.
Here's a runnable example
=> More informations about this toot | More toots from loke@functional.cafe
@loke fwiw (and it aint worth much), Google's range is one dot less, like ..
Since you like your code absolutely tiny, I thought I'd mention it.
=> More informations about this toot | More toots from ksaj@infosec.exchange This content has been proxied by September (3851b).Proxy Information
text/gemini