Skip to main content

Functions

Defining and Using Functions as First Class Citizens.

  • Chapter
  • First Online:
Perl 6 Quick Syntax Reference
  • 499 Accesses

Abstract

You have already seen in previous chapters how Perl 6, having functions as first class citizens, can produce chunks of code out of thin air and work with them. The title list them as we go up the hierarchy. All of them are Callable; code is the simplest type that implements that role; blocks can define a signature or the name of the variables that will be used inside the code itself; a routine is a block that has its own name and can specify data that is going to be returned via the return statement.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 29.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 37.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2019 J.J. Merelo

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Merelo, J.J. (2019). Functions. In: Perl 6 Quick Syntax Reference. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-4956-7_8

Download citation

Publish with us

Policies and ethics