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 now! 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
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Getting Started with V Programming

You're reading from   Getting Started with V Programming An end-to-end guide to adopting the V language from basic variables and modules to advanced concurrency

Arrow left icon
Product type Paperback
Published in Dec 2021
Publisher Packt
ISBN-13 9781839213434
Length 408 pages
Edition 1st Edition
Arrow right icon
Author (1):
Arrow left icon
Navule Pavan Kumar Rao Navule Pavan Kumar Rao
Author Profile Icon Navule Pavan Kumar Rao
Navule Pavan Kumar Rao
Arrow right icon
View More author details
Toc

Table of Contents (19) Chapters Close

Preface 1. Section 1: Introduction to the V Programming Language
2. Chapter 1: Introduction to V Programming FREE CHAPTER 3. Chapter 2: Installing V Programming 4. Section 2: Basics of V Programming
5. Chapter 3: Variables, Constants, and Code Comments 6. Chapter 4: Primitive Data Types 7. Chapter 5: Arrays and Maps 8. Chapter 6: Conditionals and Iterative Statements 9. Chapter 7: Functions 10. Chapter 8: Structs 11. Chapter 9: Modules 12. Section 3: Advanced Concepts in V Programming
13. Chapter 10: Concurrency 14. Chapter 11: Channels – An Advanced Concurrency Pattern 15. Chapter 12: Testing 16. Chapter 13: Introduction to JSON and ORM 17. Chapter 14: Building a Microservice 18. Other Books You May Enjoy

Chapter 7: Functions

So far, throughout this book, we have learned about the basic programming features of V, including arrays, maps, conditionals, and iterative statements. It's time for us to learn about writing functions in V. Most programmers, when writing software applications, prefer to group a set of statements such as variable declarations and perform arithmetic or logical operations with them, or iterate over the elements of an array or map and then filter them according to their need. The art of wrapping or grouping a logically related set of statements, providing it with a name, and optionally providing input arguments and return types is often referred to as the process of writing a function.

Before we begin, here is a brief outline of the topics we will cover in this chapter:

  • Introducing functions
  • Understanding function types
  • Understanding function features

By the end of this chapter, you will have a solid understanding of the various types...

lock icon The rest of the chapter is locked
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