Re: valid values?

2019-04-18 Thread mimosinnet

El Sunday, 03 de March del 2019 a les 02:09, ToddAndMargo via perl6-users va 
escriure:


I want to pass an integer to a sub.  The only
valid values of the integer are 1, 2, 4, 8, and 16.

Other than using "if" to test their values, is
there a way to state that an integer can only
have certain predefined values?


I like this syntax: 


sub MAIN(Int $value where $value ∈ <1 2 4 8 16 >) {

}

It is readable and I really like to use the '∈' symbol :D.

Cheers! 


--
(≧∇≦) Mimosinnet (Linux User: #463211)


lib for non-core, non-installed modules

2019-04-18 Thread mimosinnet

Dear perl6 community,

I wonder what would be the right syntax for non-core, non-installed 
modules as discussed in StackOverflow? [1]. In other words, something 
similar to FindBin::libs in perl5. 


The solution I have come across is:

use lib $*PROGRAM.dirname.IO.add('../lib');

Is there a better syntax?

Cheers!


[1] 
https://stackoverflow.com/questions/51089505/trying-to-manage-perl6s-repo-at-runtime/51092821#51092821


--
(≧∇≦) Mimosinnet (Linux User: #463211)


[perl #131167] [JVM] Newly-added NQP test for catching exceptions fails on JVM

2019-04-18 Thread Christian Bartolomaeus via RT
I have committed https://github.com/perl6/nqp/commit/59d7a8869c and this test 
passes now.

As far as I understand, the right handler was missed when moving to the 
outside, because unwind_check sets the outer handler to 0 by default if no 
outer handler is passed. We do the latter now.

I'm closing this ticket as 'resolved'.