Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Convert any-num to the rand/srand dynops
The Random PMC was deprecated in Parrot 1.1 and is being removed as part
of 1.5 . This fixes the Rakudo build to use the dynamically loadable
math ops instead.
  • Loading branch information
leto committed Aug 16, 2009
1 parent 8219fe4 commit 9256dae
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/builtins/any-num.pir
Expand Up @@ -19,14 +19,13 @@ the size of that file down and to emphasize their generic,
=cut

.namespace []
.loadlib 'math_ops'
.sub 'onload' :anon :init :load
$P0 = get_hll_namespace ['Any']
'!EXPORT'('abs,int,log,polar,sqrt,truncate,unpolar', 'from'=>$P0)

## pre-seed a random number generator
$P0 = root_new ['parrot';'Random']
set_hll_global ['Any'], '$!random', $P0
srand()
'srand'()
.end


Expand Down Expand Up @@ -103,9 +102,7 @@ error.
if has_seed goto have_seed
seed = time
have_seed:
$P0 = get_hll_global ['Any'], '$!random'
$I0 = seed
$P0 = $I0
srand seed
.return ()
.end

Expand Down

0 comments on commit 9256dae

Please sign in to comment.