GithubHelp home page GithubHelp logo

Comments (5)

p6rt avatar p6rt commented on June 30, 2024

From @briandfoy

While running this program I get a MoarVM panic​:

  2 + 2 = 4
  'two' is not numeric
  MoarVM panic​: Trying to unwind over wrong handler

The program​:

  sub add-two-things ( $first, $second ) {
  CATCH {
  when X​::Str​::Numeric {
  fail q/One of the arguments wasn't a number/
  }
  }

for $first, $second {
warn "'$_' is not numeric" unless val($_) ~~ Numeric;
}

  return $first + $second;
  }

  my @​items = < 2 2 3 two nine ten 1 37 0 0 >;

  for @​items -> $first, $second {
  CONTROL {}
  my $sum = add-two-things( $first, $second );

  put $sum.defined ??
  "$first + $second = $sum" !!
  "You can't add $first and $second";
  }

--
brian d foy <brian.d.foy@​gmail.com>
http://www.pair.com/~comdog/

from old-issue-tracker.

p6rt avatar p6rt commented on June 30, 2024

From @AlexDaniel

  Golf​:

  CONTROL {}; warn 42
 
  On 2018-06-08 15​:11​:08, comdog wrote​:
  > While running this program I get a MoarVM panic​:
  >
  > 2 + 2 = 4
  > 'two' is not numeric
  > MoarVM panic​: Trying to unwind over wrong handler
  >
  > The program​:
  >
  > sub add-two-things ( $first, $second ) {
  > CATCH {
  > when X​::Str​::Numeric {
  > fail q/One of the arguments wasn't a number/
  > }
  > }
  >
  > for $first, $second {
  > warn "'$_' is not numeric" unless val($_) ~~ Numeric;
  > }
  >
  > return $first + $second;
  > }
  >
  > my @​items = < 2 2 3 two nine ten 1 37 0 0 >;
  >
  > for @​items -> $first, $second {
  > CONTROL {}
  > my $sum = add-two-things( $first, $second );
  >
  > put $sum.defined ??
  > "$first + $second = $sum" !!
  > "You can't add $first and $second";
  > }
  >
 
 
   

from old-issue-tracker.

p6rt avatar p6rt commented on June 30, 2024

The RT System itself - Status changed from 'new' to 'open'

from old-issue-tracker.

p6rt avatar p6rt commented on June 30, 2024

From @zoffixznet

On Fri, 08 Jun 2018 15​:24​:32 -0700, alex.jakimenko@​gmail.com wrote​:

Golf​:

CONTROL {}; warn 42

On 2018-06-08 15​:11​:08, comdog wrote​:

While running this program I get a MoarVM panic​:

2 + 2 = 4
'two' is not numeric
MoarVM panic​: Trying to unwind over wrong handler

The program​:

sub add-two-things ( $first, $second ) {
CATCH {
when X​::Str​::Numeric {
fail q/One of the arguments wasn't a number/
}
}

for $first, $second {
warn "'$_' is not numeric" unless val($_) ~~ Numeric;
}

return $first + $second;
}

my @​items = < 2 2 3 two nine ten 1 37 0 0 >;

for @​items -> $first, $second {
CONTROL {}
my $sum = add-two-things( $first, $second );

put $sum.defined ??
"$first + $second = $sum" !!
"You can't add $first and $second";
}

This is a dupe of MoarVM/MoarVM#572 (also filed in Rakudo's repo​: rakudo/rakudo#1605 )

Closing this ticket in favour of those Issues.

from old-issue-tracker.

p6rt avatar p6rt commented on June 30, 2024

@zoffixznet - Status changed from 'open' to 'resolved'

from old-issue-tracker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.