Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Learn Bosque Programming

You're reading from   Learn Bosque Programming Boost your productivity and software reliability with Microsoft's new open-source programming language

Arrow left icon
Product type Paperback
Published in Apr 2021
Publisher Packt
ISBN-13 9781839211973
Length 336 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
 Kaczmarek Kaczmarek
Author Profile Icon Kaczmarek
Kaczmarek
 Ibaceta Ibaceta
Author Profile Icon Ibaceta
Ibaceta
Arrow right icon
View More author details
Toc

Table of Contents (22) Chapters Close

Preface 1. Section 1: Introduction
2. Chapter 1: Exploring Bosque FREE CHAPTER 3. Chapter 2: Configuring the Bosque Environment 4. Chapter 3: Bosque Key Features 5. Section 2: The Bosque Language Overview
6. Chapter 4: Entrypoint Function 7. Chapter 5: Types and Operators 8. Chapter 6: Bosque Statements 9. Chapter 7: Project: Bosque in the Cloud 10. Section 3: Practicing Bosque
11. Chapter 8: Expressions in Bosque 12. Chapter 9: Collections 13. Chapter 10: Iterative Processing and Recursion 14. Chapter 11: Project: AI Classifier 15. Section 4: Exploring Advanced Features
16. Chapter 12: Namespaces, Concepts, and Entities 17. Chapter 13: Testing in Bosque 18. Chapter 14: Project: Path Optimizer 19. Other Books You May Enjoy Appendix A: Advanced Topics 1. Appendix B: What's Next in Bosque?

Discovering the NSIterate namespace and its helper functions

Except for a number of methods available in Bosque core collections, there is one more way in which to do iteration in Bosque. We can make use of the NSIterate namespace and its functions. While I'm writing this, there are four functions in this namespace that we will discuss here:

  • while<S>()
  • until<S>()
  • steps<S>()
  • reduce<T>()

We will now cover these briefly one by one. Let's start with the last one mentioned – the reduce<T>() function.

The reduce<T>() function

In functional programming, reducing is an operation that processes a data collection in order to produce a result using some kind of a function that combines the collection elements. So, in other words, reducing means transforming the whole collection of data into one end result. The reduce<T>() function in Bosque is used exactly for that. It's parametrized by a type, T...

lock icon The rest of the chapter is locked
Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Learn Bosque Programming
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Modal Close icon
Modal Close icon