Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 56037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T17:28:18+00:00 2026-05-10T17:28:18+00:00

More information from the Perl 6 Wikipedia entry Junctions Perl 6 introduces the concept

  • 0

More information from the Perl 6 Wikipedia entry

Junctions

Perl 6 introduces the concept of junctions: values that are composites of other values.[24] In the earliest days of Perl 6’s design, these were called ‘superpositions’, by analogy to the concept in quantum physics of quantum superpositions — waveforms that can simultaneously occupy several states until observation ‘collapses’ them. A Perl 5 module released in 2000 by Damian Conway called Quantum::Superpositions[25] provided an initial proof of concept. While at first, such superpositional values seemed like merely a programmatic curiosity, over time their utility and intuitiveness became widely recognized, and junctions now occupy a central place in Perl 6’s design.

In their simplest form, junctions are created by combining a set of values with junctive operators:

my $any_even_digit = 0|2|4|6|8; # any(0, 2, 4, 6, 8) my $all_odd_digits = 1&3&5&7&9; # all(1, 3, 5, 7, 9) 

| indicates a value which is equal to either its left or right-hand arguments. & indicates a value which is equal to both its left and right-hand arguments. These values can be used in any code that would use a normal value. Operations performed on a junction act on all members of the junction equally, and combine according to the junctive operator. So, (‘apple’|’banana’) ~ ‘s’ would yield ‘apples’|’bananas’. In comparisons, junctions return a single true or false result for the comparison. ‘any’ junctions return true if the comparison is true for any one of the elements of the junction. ‘all’ junctions return true if the comparison is true for all of the elements of the junction.

Junctions can also be used to more richly augment the type system by introducing a style of generic programming that is constrained to junctions of types:

sub get_tint ( RGB_Color|CMYK_Color $color, num $opacity) { ... } sub store_record (Record&Storable $rec) { ... } 
  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T17:28:19+00:00Added an answer on May 10, 2026 at 5:28 pm

    How many days are in a given month?

    given( $month ){   when any(qw'1 3 5 7 8 10 12') {     $day = 31   }   when any(qw'4 6 9 11') {     $day = 30   }   when 2 {     $day = 29   } } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Java is reading the locale, timezone and encoding information (and perhaps more) from the
I have a Javascript Highchart that I'm displaying and trying to get more information
How can I get more information from an error like this? => Booting WEBrick
I'm looking to write an iPhone app that populates a UITable with information from
I've read many times that Assemblies generated from F# or any other .NET language
As a developer I find I am gathering more and more information from blogs
Recently, I start to use ojAlgo library. You can get more information from http://ojalgo.org/index.html
In TFS, how do I request more information from the owner of a work
I've got an app that displays information from our web service. The user has
Edit: After receiving more information from DCoder, the phrase I was searching for here

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.