|
Subject: Re: Declarations of constants Newsgroups: gmane.comp.lang.perl.perl6.language Date: 2005-05-31 08:37:11 GMT (3 years, 14 weeks, 1 day, 21 hours and 14 minutes ago)
Ingo Blechschmidt wrote:
> Hi,
>
> # Way 1
> my $MEANING_OF_LIFE is constant = 42;
Forgive my ignorance here, but for all of these different ways of doing
constants, will they all optimize (including partial
evaluation/currying) at compile/build/init/run-time?
my $gravity is constant = 10; # One significant figure
sub time_to_ground ($height, $accel) {
...acceleration math...
}
my $time = time_to_ground( 500, $gravity );
... thus simplifying internally to
my $time = 1234;
Adam K
|
|
|