Urgent.News

One page, thousands of outlets. See who else covered it.

Editions

Tech

Raku: a language that counts to infinity (Part 1)

We've already seen that Raku understands characters like ∞ , and it would be logically that you can use them with ease, similar to any other constructs of the language. Take, for example, a sequence with no definite end. You define a pattern and take as many items as you need. say (1, 1, * + * ... ∞)[^10]; Here, the pattern defines a Fibonacci sequence and we only take the first 10 elements of…

Raku, a programming language, understands characters like infinity (∞). This allows users to utilize such symbols with ease, much like any other language constructs. A sequence lacking a definite end can be defined using a pattern and taking desired elements from it. In the example, a Fibonacci sequence is defined and only the first ten elements are taken: (1 1 2 3 5 8 13 21 34 55).

There may be scenarios where a stop condition needs to be set. In that case, an explicit stop rule can be applied, just like in the example provided, where the sequence stops when the next number exceeds 100: (1 1 2 3 5 8 13 21 34 55 89).

For more complex data manipulation, an infinite list can be saved in a variable and used like any other array in a Raku program. The sequence is lazy by default, meaning it only computes values when required. To verify if a sequence is lazy, use the .is-lazy method on the sequence.

Lazy computations can be treated similarly to non-infinite data. For instance, squaring the numbers of an infinite sequence is possible by mapping the values: (1 4 9 16 25) for the first five squares and 1000000 for the 999th item.

Filtering a lazy sequence is also straightforward. In the example, the first ten prime numbers and the first prime number greater than 1000 are displayed: (2 3 5 7 11 13 17 19 23 29) and 1009, respectively.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Your dog walker says they went. This makes the walk say so too.

This is a submission for Weekend Challenge: Dog Days Edition TL;DR — A walker records the walk on their phone, the route is hashed in the browser, and a 147-byte attestation signed by the walker's own…

  • Dog walker records and hashes walk route on Solana devnet
  • Owner verifies walk trace by comparing computed hash with attestation
  • Verification process requires only two clicks without wallets or SOL

How to Handle O365 Shared Mailboxes in CI/CD Test Automation

Testing email workflows—like OTP verification, password resets, or automated notifications—is a core requirement for robust end-to-end (E2E) automation.

  • Register Azure AD app with Mail.ReadWrite and Mail.Send permissions
  • Obtain OAuth 2.0 tokens via Azure AD token endpoint
  • Send emails through shared mailbox using POST request to sendMail endpoint

AIOps Is More Than Just a Chatbot

It started with a Discord bot React ChatBotify is an open-source project I maintain, and part of that meant looking after its websites and servers.

More from Sunday 16 August →