Permalink
Browse files

give constants their prototype

So these subs do not take any arguments
  • Loading branch information...
FROGGS committed Apr 15, 2014
1 parent 7a768b0 commit 5c69e311f05e9e3f0d96fb921ef321420a99e0e8
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/Perl5/constant.pm
View
@@ -6,7 +6,9 @@ sub EXPORT(*@ops) {
my %o;
for @ops -> $k, $v {
- %o{ '&' ~ $k } := sub { $v };
+ %o{ '&' ~ $k } := -> { $v };
+ # constants do not swallow arguments
+ nqp::getlexrelcaller(nqp::ctx(), '%prototype'){$k} := '';
}
%o

0 comments on commit 5c69e31

Please sign in to comment.